Commit c2d6fe61 authored by Matteo Croce's avatar Matteo Croce Committed by David S. Miller

mvpp2: XDP TX support

Add the transmit part of XDP support, which includes:
- support for XDP_TX in mvpp2_xdp()
- .ndo_xdp_xmit hook for AF_XDP and XDP_REDIRECT with mvpp2 as destination

mvpp2_xdp_submit_frame() is a generic function which is called by
mvpp2_xdp_xmit_back() when doing XDP_TX, and by mvpp2_xdp_xmit when
doing AF_XDP or XDP_REDIRECT target.

The buffer allocation has been reworked to be able to map the buffers
as DMA_FROM_DEVICE or DMA_BIDIRECTIONAL depending if native XDP is
in use or not.
Co-developed-by: default avatarSven Auhagen <sven.auhagen@voleatech.de>
Signed-off-by: default avatarSven Auhagen <sven.auhagen@voleatech.de>
Signed-off-by: default avatarMatteo Croce <mcroce@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 07dd0a7a
...@@ -1082,9 +1082,20 @@ struct mvpp2_rx_desc { ...@@ -1082,9 +1082,20 @@ struct mvpp2_rx_desc {
}; };
}; };
enum mvpp2_tx_buf_type {
MVPP2_TYPE_SKB,
MVPP2_TYPE_XDP_TX,
MVPP2_TYPE_XDP_NDO,
};
struct mvpp2_txq_pcpu_buf { struct mvpp2_txq_pcpu_buf {
enum mvpp2_tx_buf_type type;
/* Transmitted SKB */ /* Transmitted SKB */
union {
struct xdp_frame *xdpf;
struct sk_buff *skb; struct sk_buff *skb;
};
/* Physical address of transmitted buffer */ /* Physical address of transmitted buffer */
dma_addr_t dma; dma_addr_t dma;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment