Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: John Fastabend <john.fastabend@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Lorenzo Bianconi <lorenzo.bianconi@redhat.com>,
	netdev@vger.kernel.org, bpf@vger.kernel.org, davem@davemloft.net,
	brouer@redhat.com, echaudro@redhat.com, sameehj@amazon.com
Subject: Re: [PATCH net-next 6/6] net: mvneta: enable jumbo frames for XDP
Date: Thu, 20 Aug 2020 09:54:03 +0200	[thread overview]
Message-ID: <20200820075403.GB2282@lore-desk> (raw)
In-Reply-To: <5f3da06d5de6c_1b0e2ab87245e5c01b@john-XPS-13-9370.notmuch>

[-- Attachment #1: Type: text/plain, Size: 3002 bytes --]

> Jakub Kicinski wrote:
> > On Wed, 19 Aug 2020 22:22:23 +0200 Lorenzo Bianconi wrote:
> > > > On Wed, 19 Aug 2020 15:13:51 +0200 Lorenzo Bianconi wrote:  
> > > > > Enable the capability to receive jumbo frames even if the interface is
> > > > > running in XDP mode
> > > > > 
> > > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>  
> > > > 
> > > > Hm, already? Is all the infra in place? Or does it not imply
> > > > multi-buffer.
> > > 
> > > with this series mvneta supports xdp multi-buff on both rx and tx sides (XDP_TX
> > > and ndo_xpd_xmit()) so we can remove MTU limitation.
> > 
> > Is there an API for programs to access the multi-buf frames?
> 
> Hi Lorenzo,

Hi Jakub and John,

> 
> This is not enough to support multi-buffer in my opinion. I have the
> same comment as Jakub. We need an API to pull in the multiple
> buffers otherwise we break the ability to parse the packets and that
> is a hard requirement to me. I don't want to lose visibility to get
> jumbo frames.

I have not been so clear in the commit message, sorry for that.
This series aims to finalize xdp multi-buff support for mvneta driver only.
Our plan is to work on the helpers/metadata in subsequent series since
driver support is quite orthogonal. If you think we need the helpers
in place before removing the mtu constraint, we could just drop last
patch (6/6) and apply patches from 1/6 to 5/6 since they are preliminary
to remove the mtu constraint. Do you agree?

> 
> At minimum we need a bpf_xdp_pull_data() to adjust pointer. In the
> skmsg case we use this,
> 
>   bpf_msg_pull_data(u32 start, u32 end, u64 flags)
> 
> Where start is the offset into the packet and end is the last byte we
> want to adjust start/end pointers to. This way we can walk pages if
> we want and avoid having to linearize the data unless the user actual
> asks us for a block that crosses a page range. Smart users then never
> do a start/end that crosses a page boundary if possible. I think the
> same would apply here.
> 
> XDP by default gives you the first page start/end to use freely. If
> you need to parse deeper into the payload then you call bpf_msg_pull_data
> with the byte offsets needed.

Our first proposal is described here [0][1]. In particular, we are assuming the
eBPF layer can access just the first fragment in the non-linear XDP buff and
we will provide some non-linear xdp metadata (e.g. # of segments in the xdp_buffer
or buffer total length) to the eBPF program attached to the interface.
Anyway IMHO this mvneta series is not strictly related to this approach.

Regards,
Lorenzo

[0] https://github.com/xdp-project/xdp-project/blob/master/areas/core/xdp-multi-buffer01-design.org
[1] http://people.redhat.com/lbiancon/conference/NetDevConf2020-0x14/add-xdp-on-driver.html (XDP multi-buffers section)

> 
> Also we would want performance numbers to see how good/bad this is
> compared to the base case.
> 
> Thanks,
> John

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  parent reply	other threads:[~2020-08-20  7:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19 13:13 [PATCH net-next 0/6] mvneta: introduce XDP multi-buffer support Lorenzo Bianconi
2020-08-19 13:13 ` [PATCH net-next 1/6] xdp: introduce mb in xdp_buff/xdp_frame Lorenzo Bianconi
2020-08-23 14:08   ` Shay Agroskin
2020-08-24  8:44     ` Jesper Dangaard Brouer
2020-08-26  9:47       ` Shay Agroskin
2020-08-19 13:13 ` [PATCH net-next 2/6] xdp: initialize xdp_buff mb bit to 0 in all XDP drivers Lorenzo Bianconi
2020-08-19 13:13 ` [PATCH net-next 3/6] net: mvneta: update mb bit before passing the xdp buffer to eBPF layer Lorenzo Bianconi
2020-08-20  8:02   ` Jesper Dangaard Brouer
2020-08-20  8:11     ` Lorenzo Bianconi
2020-08-20 19:38   ` Maciej Fijalkowski
2020-08-21  7:43     ` Lorenzo Bianconi
2020-08-19 13:13 ` [PATCH net-next 4/6] xdp: add multi-buff support to xdp_return_{buff/frame} Lorenzo Bianconi
2020-08-20  7:52   ` Jesper Dangaard Brouer
2020-08-20  7:56     ` Lorenzo Bianconi
2020-08-19 13:13 ` [PATCH net-next 5/6] net: mvneta: add multi buffer support to XDP_TX Lorenzo Bianconi
2020-08-19 13:13 ` [PATCH net-next 6/6] net: mvneta: enable jumbo frames for XDP Lorenzo Bianconi
2020-08-19 19:23   ` Jakub Kicinski
2020-08-19 20:22     ` Lorenzo Bianconi
2020-08-19 21:14       ` Jakub Kicinski
2020-08-19 21:58         ` John Fastabend
2020-08-20  7:47           ` Jesper Dangaard Brouer
2020-08-20  7:54           ` Lorenzo Bianconi [this message]
2020-08-20 13:16 ` [PATCH net-next 0/6] mvneta: introduce XDP multi-buffer support Jesper Dangaard Brouer
2020-08-20 13:36   ` Lorenzo Bianconi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200820075403.GB2282@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=echaudro@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sameehj@amazon.com \
    --subject='Re: [PATCH net-next 6/6] net: mvneta: enable jumbo frames for XDP' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).