[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200414160220.7d0f94c8@carbon>
Date: Tue, 14 Apr 2020 16:02:20 +0200
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: Jakub Kicinski <kuba@...nel.org>
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>, brouer@...hat.com
Subject: Re: [PATCH RFC v2 19/33] nfp: add XDP frame size to netronome
driver
On Wed, 8 Apr 2020 10:53:44 -0700
Jakub Kicinski <kuba@...nel.org> wrote:
> 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?
Well the value was already calculate for us in true_bufsz, but I can
change that.
> But more importantly the correct value is:
>
> PAGE_SIZE - NFP_NET_RX_BUF_HEADROOM
Thanks for catching that. I will fix.
> 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;
>
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
Powered by blists - more mailing lists