On Wed, 08 Apr 2020 13:52:10 +0200 Jesper Dangaard Brouer wrote: > The netronome nfp driver already had a true_bufsz variable > that contains what was needed for xdp.frame_sz. > > Cc: Jakub Kicinski <kuba@xxxxxxxxxx> > Signed-off-by: Jesper Dangaard Brouer <brouer@xxxxxxxxxx> > --- > .../net/ethernet/netronome/nfp/nfp_net_common.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c > index 9bfb3b077bc1..b9b8c30eab33 100644 > --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c > +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c > @@ -1817,6 +1817,7 @@ static int nfp_net_rx(struct nfp_net_rx_ring *rx_ring, int budget) > rcu_read_lock(); > xdp_prog = READ_ONCE(dp->xdp_prog); > true_bufsz = xdp_prog ? PAGE_SIZE : dp->fl_bufsz; > + xdp.frame_sz = true_bufsz; Since this matters only with XDP on - we can set to PAGE_SIZE directly? But more importantly the correct value is: PAGE_SIZE - NFP_NET_RX_BUF_HEADROOM as we set hard_start at an offset. xdp.data_hard_start = rxbuf->frag + NFP_NET_RX_BUF_HEADROOM; Cause NFP_NET_RX_BUF_HEADROOM is not DMA mapped. > xdp.rxq = &rx_ring->xdp_rxq; > tx_ring = r_vec->xdp_ring;