]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: do simple XDP TX buffer recycling
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 28 Apr 2017 04:06:17 +0000 (21:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 May 2017 02:37:00 +0000 (22:37 -0400)
commit687bd8032a0d7c5e8b63ebc6b939fe9463c48810
treeafae4127dee3ba5aaa4d353a5a0f9a9f739d619e
parent00fb9be3bb0e957696e8b944292db3d0db0a77c9
nfp: do simple XDP TX buffer recycling

On the RX path we follow the "drop if allocation of replacement
buffer fails" rule.  With XDP we extended that to the TX action,
so if XDP prog returned TX but allocation of replacement RX buffer
failed, we will drop the packet.

To improve our XDP TX performance extend the idea of rings being
always full to XDP TX rings.  Pre-fill the XDP TX rings with RX
buffers, and when XDP prog returns TX action swap the RX buffer
with the next buffer from the TX ring.

XDP TX complete will no longer free the buffers but let them
sit on the TX ring and wait for swap with RX buffer, instead.

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.h
drivers/net/ethernet/netronome/nfp/nfp_net_common.c