OSDN Git Service

nfp: nfdk: implement xdp tx path for NFDK
authorYinjun Zhang <yinjun.zhang@corigine.com>
Mon, 21 Mar 2022 10:42:09 +0000 (11:42 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Mar 2022 13:21:17 +0000 (13:21 +0000)
commitd9d950490a0a5822ffeda291a588eb85d4f7b96f
treed5311239ec1500133770bb05218f0233a1495303
parentc10d12e3dce8efc24af2478d45b0313796b20387
nfp: nfdk: implement xdp tx path for NFDK

Due to the different definition of txbuf in NFDK comparing to NFD3,
there're no pre-allocated txbufs for xdp use in NFDK's implementation,
we just use the existed rxbuf and recycle it when xdp tx is completed.

For each packet to transmit in xdp path, we cannot use more than
`NFDK_TX_DESC_PER_SIMPLE_PKT` txbufs, one is to stash virtual address,
and another is for dma address, so currently the amount of transmitted
bytes is not accumulated. Also we borrow the last bit of virtual addr
to indicate a new transmitted packet due to address's alignment
attribution.

Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Signed-off-by: Fei Qin <fei.qin@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfdk/dp.c
drivers/net/ethernet/netronome/nfp/nfdk/nfdk.h