diff options
author | Mintz, Yuval <Yuval.Mintz@cavium.com> | 2016-11-29 16:47:10 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-30 14:32:05 -0500 |
commit | cb6aeb07929453d5ae127b536b14f6bd3d4c5942 (patch) | |
tree | 1a77314d8d97a01e5c589bb944ecf63f7f41002b /drivers/net/ethernet/qlogic/qede/qede.h | |
parent | 496e051709588f832d7a6a420f44f8642b308a87 (diff) | |
download | linux-cb6aeb07929453d5ae127b536b14f6bd3d4c5942.tar.bz2 |
qede: Add support for XDP_TX
Add support for forwarding via XDP. Once the eBPF is attached,
driver would allocate & configure a designated transmission queue
meant solely for forwarding packets. Said queue would share the
receive-queue's interrupt line, and would have it's own Tx statistics.
Infrastructure changes required for this [spread-out through the code]:
- Determine the DMA direction of the receive buffers based on the presence
of the eBPF program.
- Turn the sw Tx ring into a union, as regular/XDP queues have different
needs for releasing resources after completion [regular requires the SKB,
XDP requires the transmitted page].
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.h')
-rw-r--r-- | drivers/net/ethernet/qlogic/qede/qede.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qede/qede.h b/drivers/net/ethernet/qlogic/qede/qede.h index cc14aed5f16e..c79dc78746fc 100644 --- a/drivers/net/ethernet/qlogic/qede/qede.h +++ b/drivers/net/ethernet/qlogic/qede/qede.h @@ -258,6 +258,7 @@ struct qede_rx_queue { u16 sw_rx_prod; u16 num_rx_buffers; /* Slowpath */ + u8 data_direction; u8 rxq_id; u32 rx_buf_size; @@ -294,6 +295,7 @@ struct sw_tx_bd { }; struct qede_tx_queue { + u8 is_xdp; bool is_legacy; u16 sw_tx_cons; u16 sw_tx_prod; @@ -310,8 +312,18 @@ struct qede_tx_queue { void __iomem *doorbell_addr; union db_prod tx_db; int index; /* Slowpath only */ +#define QEDE_TXQ_XDP_TO_IDX(edev, txq) ((txq)->index - \ + QEDE_MAX_TSS_CNT(edev)) +#define QEDE_TXQ_IDX_TO_XDP(edev, idx) ((idx) + QEDE_MAX_TSS_CNT(edev)) + + /* Regular Tx requires skb + metadata for release purpose, + * while XDP requires only the pages themselves. + */ + union { + struct sw_tx_bd *skbs; + struct page **pages; + } sw_tx_ring; - struct sw_tx_bd *sw_tx_ring; struct qed_chain tx_pbl; /* Slowpath; Should be kept in end [unless missing padding] */ @@ -336,10 +348,12 @@ struct qede_fastpath { #define QEDE_FASTPATH_COMBINED (QEDE_FASTPATH_TX | QEDE_FASTPATH_RX) u8 type; u8 id; + u8 xdp_xmit; struct napi_struct napi; struct qed_sb_info *sb_info; struct qede_rx_queue *rxq; struct qede_tx_queue *txq; + struct qede_tx_queue *xdp_tx; #define VEC_NAME_SIZE (sizeof(((struct net_device *)0)->name) + 8) char name[VEC_NAME_SIZE]; |