]> git.baikalelectronics.ru Git - kernel.git/commit
enic: use atomic_t instead of spin_lock in busy poll
authorGovindarajulu Varadarajan <_govind@gmx.com>
Thu, 25 Jun 2015 10:32:04 +0000 (16:02 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Jun 2015 12:23:01 +0000 (05:23 -0700)
commit9edf54fec1338be02c5d273276fd06a5b80e404d
treeed012c1c5ee31e5ca37ccbfe55678ae9bf055b64
parentb855776130baefe1e69986f9127fecb1e112049a
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