]> www.infradead.org Git - users/jedix/linux-maple.git/commit
enic: use atomic_t instead of spin_lock in busy poll
authorSujith Sankar <ssujith@cisco.com>
Tue, 13 Oct 2015 09:27:34 +0000 (14:57 +0530)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Mon, 19 Oct 2015 20:38:58 +0000 (13:38 -0700)
commit20156c62a4a7d4f497a647d4cea7d611d3bee764
treed2b14956808cbc54f44b4efb65cb99467c9ff840
parentc58dddac305a90248719e6d265678ddf33f21f56
enic: use atomic_t instead of spin_lock in busy poll

We use spinlock to access a single flag. We can avoid spin_locks by using
atomic variable and atomic_cmpxchg(). Use atomic_cmpxchg to set the flag
for idle to poll. And a simple atomic_set to unlock (set idle from poll).

In napi poll, if gro is enabled, we call napi_gro_receive() to deliver the
packets. Before we call napi_complete(), i.e while re-polling, if low
latency busy poll is called, we use netif_receive_skb() to deliver the packets.
At this point if there are some skb's held in GRO, busy poll could deliver the
packets out of order. So we call napi_gro_flush() to flush skbs before we
move the napi poll to idle.

Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cisco/enic/enic_main.c
drivers/net/ethernet/cisco/enic/vnic_rq.h