]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: avoid reading TX queue indexes from the device
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 28 Apr 2017 04:06:18 +0000 (21:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 May 2017 02:37:00 +0000 (22:37 -0400)
commit999c5887d989934d1e894c152f82f27dbb958bee
tree31cb315108d969d3760458e860e18d9ebcfb9d60
parent687bd8032a0d7c5e8b63ebc6b939fe9463c48810
nfp: avoid reading TX queue indexes from the device

Reading TX queue indexes from the device memory on each interrupt
is expensive.  It's doubly expensive with XDP running since we have
two TX rings to check there.  If the software indexes indicate that
the TX queue is completely empty, however, we don't need to look at
the device completion index at all.

The queuing CPU is doing a wmb() before kicking the device TX so
we should be safe to assume on the CPU handling the completions will
never see old value of the software copy of the index.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c