From: Jesper Dangaard Brouer Date: Thu, 14 May 2020 10:49:07 +0000 (+0200) Subject: bnxt: Add XDP frame size to driver X-Git-Tag: v5.15~3723^2~181^2~2^2~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63fe91ab3d1c5c0b4497b993b8eeaa54f6688d53;p=platform%2Fkernel%2Flinux-starfive.git bnxt: Add XDP frame size to driver This driver uses full PAGE_SIZE pages when XDP is enabled. In case of XDP uses driver uses __bnxt_alloc_rx_page which does full page DMA-map. Thus, xdp_adjust_tail grow is DMA compliant for XDP_TX action that does DMA-sync. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Reviewed-by: Andy Gospodarek Cc: Michael Chan Cc: Andy Gospodarek Link: https://lore.kernel.org/bpf/158945334769.97035.13437970179897613984.stgit@firesoul --- diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c index c6f6f20..5e3b4a3 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c @@ -138,6 +138,7 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons, xdp_set_data_meta_invalid(&xdp); xdp.data_end = *data_ptr + *len; xdp.rxq = &rxr->xdp_rxq; + xdp.frame_sz = PAGE_SIZE; /* BNXT_RX_PAGE_MODE(bp) when XDP enabled */ orig_data = xdp.data; rcu_read_lock();