sfc: replace spinlocks with bit ops for busy poll locking
Subsystems (3)
PATCH v2 1/1 sfc: replace spinlocks with bit ops for busy poll locking
From: Bert Kenward <[email protected]>
This patch reduces the overhead of locking for busy poll. Previously the state was protected by a lock, whereas now it's manipulated solely with atomic operations.
Signed-off-by Shradha Shah <[email protected]>
--- drivers/net/ethernet/sfc/efx.c | 4 +- drivers/net/ethernet/sfc/net_driver.h | 129 +++++++++++++++------------------- 2 files changed, 58 insertions(+), 75 deletions(-)
drivers/net/ethernet/sfc/efx.c +2 -2
@@ -2062,7 +2062,7 @@ static void efx_init_napi_channel(struct efx_channel *channel)netif_napi_add (channel->napi_dev, &channel->napi_str, efx_poll, napi_weight);napi_hash_add (&channel->napi_str); -efx_channel_init_lock (channel); +efx_channel_busy_poll_init (channel); }static void efx_init_napi (struct efx_nic *efx)
@@ -2125,7 +2125,7 @@ static int efx_busy_poll(struct napi_struct *napi)if (!netif_running (efx->net_dev))return LL_FLUSH_FAILED ; -if (!efx_channel_lock_poll (channel)) +if (!efx_channel_try_lock_poll (channel))return LL_FLUSH_BUSY ; old_rx_packets = channel->rx_queue.rx_packets;
drivers/net/ethernet/sfc/net_driver.h +56 -73
182 lines not on this page · raw message
From: Shradha Shah <[email protected]>
Date: Mon, 26 Oct 2015 14:23:42 +0000
Quoted 7 lines
From: Bert Kenward <[email protected]>
This patch reduces the overhead of locking for busy poll. Previously the state was protected by a lock, whereas now it's manipulated solely with atomic operations.
Signed-off-by Shradha Shah <[email protected]>
Applied, thanks.