[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200408105344.11d1a33f@kicinski-fedora-PC1C0HJN>
Date: Wed, 8 Apr 2020 10:53:44 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Jesper Dangaard Brouer <brouer@...hat.com>
Cc: sameehj@...zon.com, netdev@...r.kernel.org, bpf@...r.kernel.org,
zorik@...zon.com, akiyano@...zon.com, gtzalik@...zon.com,
Toke Høiland-Jørgensen <toke@...hat.com>,
Daniel Borkmann <borkmann@...earbox.net>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
John Fastabend <john.fastabend@...il.com>,
Alexander Duyck <alexander.duyck@...il.com>,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
David Ahern <dsahern@...il.com>,
Willem de Bruijn <willemdebruijn.kernel@...il.com>,
Ilias Apalodimas <ilias.apalodimas@...aro.org>,
Lorenzo Bianconi <lorenzo@...nel.org>,
Saeed Mahameed <saeedm@...lanox.com>
Subject: Re: [PATCH RFC v2 19/33] nfp: add XDP frame size to netronome
driver
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@...nel.org>
> Signed-off-by: Jesper Dangaard Brouer <brouer@...hat.com>
> ---
> .../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;
Powered by blists - more mailing lists