summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qlogic/qede/qede_main.c
diff options
context:
space:
mode:
authorMintz, Yuval <Yuval.Mintz@cavium.com>2017-04-07 11:05:01 +0300
committerDavid S. Miller <davem@davemloft.net>2017-04-07 06:26:14 -0700
commit059eeb07e175086db1f84c1d8d29bb9aa8057797 (patch)
treefd69702322ca50528093e42bd87167809e3f3c5e /drivers/net/ethernet/qlogic/qede/qede_main.c
parent15ed8a47ff0571dd268e37002511993b47e996bd (diff)
downloadlinux-059eeb07e175086db1f84c1d8d29bb9aa8057797.tar.bz2
qede: Support XDP adjustment of headers
In case an XDP program is attached, reserve XDP_PACKET_HEADROOM bytes at the beginning of the packet for the program to play with. Modify the XDP logic in the driver to fill-in the missing bits and re-calculate offsets and length after the program has finished running to properly reflect the current status of the packet. We can then go and remove the limitation of not supporting XDP programs where xdp_adjust_head is set. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qede/qede_main.c')
-rw-r--r--drivers/net/ethernet/qlogic/qede/qede_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 91c3078c1ae4..8c2baf8b2a08 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -1187,6 +1187,7 @@ static int qede_alloc_mem_rxq(struct qede_dev *edev, struct qede_rx_queue *rxq)
rxq->num_rx_buffers = edev->q_num_rx_buffers;
rxq->rx_buf_size = NET_IP_ALIGN + ETH_OVERHEAD + edev->ndev->mtu;
+ rxq->rx_headroom = edev->xdp_prog ? XDP_PACKET_HEADROOM : 0;
/* Make sure that the headroom and payload fit in a single page */
if (rxq->rx_buf_size + rxq->rx_headroom > PAGE_SIZE)