All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Waskiewicz Jr, Peter" <peter.waskiewicz.jr@intel.com>
To: "alexei.starovoitov@gmail.com" <alexei.starovoitov@gmail.com>,
	"jakub.kicinski@netronome.com" <jakub.kicinski@netronome.com>
Cc: "Duyck, Alexander H" <alexander.h.duyck@intel.com>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"saeedm@mellanox.com" <saeedm@mellanox.com>,
	"brouer@redhat.com" <brouer@redhat.com>,
	"borkmann@iogearbox.net" <borkmann@iogearbox.net>,
	"tariqt@mellanox.com" <tariqt@mellanox.com>,
	"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"saeedm@dev.mellanox.co.il" <saeedm@dev.mellanox.co.il>
Subject: Re: [RFC bpf-next 2/6] net: xdp: RX meta data infrastructure
Date: Fri, 6 Jul 2018 20:44:24 +0000	[thread overview]
Message-ID: <1530909863.4291.12.camel@intel.com> (raw)
In-Reply-To: <20180706163041.xstyfednmgho23m3@ast-mbp.dhcp.thefacebook.com>

On Fri, 2018-07-06 at 09:30 -0700, Alexei Starovoitov wrote:
> On Thu, Jul 05, 2018 at 10:18:23AM -0700, Jakub Kicinski wrote:
> > 
> > I'm also not 100% on board with the argument that "future" FW can
> > reshuffle things whatever way it wants to.  Is the assumption that
> > future ASICs/FW will be designed to always use the "blessed" BTF
> > format?  Or will it be reconfigurable at runtime?
> 
> let's table configuration of metadata aside for a second.

I agree that this should/could be NIC-specific and shouldn't weigh on
the metadata interface between the drivers and XDP layer.

> Describing metedata layout in BTF allows NICs to disclose everything
> NIC has to users in a standard and generic way.
> Whether firmware is reconfigurable on the fly or has to reflashed
> and hw powercycled to have new md layout (and corresponding BTF
> description)
> is a separate discussion.
> Saeed's proposal introduces the concept of 'offset' inside 'struct
> xdp_md_info'
> to reach 'hash' value in metadata.
> Essentially it's a run-time way to access 'hash' instead of build-
> time.
> So bpf program would need two loads to read csum or hash field
> instead of one.
> With BTF the layout of metadata is known to the program at build-
> time.
> 
> To reiterate the proposal:
> - driver+firmware keep layout of the metadata in BTF format (either
> in the driver
>   or driver can read it from firmware)
> - 'bpftool read-metadata-desc eth0 > md_desc.h' command will query
> the driver and
>   generate normal C header file based on BTF in the given NIC
> - user does #include "md_desc.h" and bpf program can access md->csum
> or md->hash
>   with direct single load out of metadata area in front of the packet

This piece is where I'd like to discuss more.  When we discussed this
in Seoul, the initial proposal was a static struct that we'd try to
hammer out a common layout between the interested parties.  That
obviously wasn't going to scale, and we wanted to pursue something more
dynamic.  But I thought the goal was the XDP/eBPF program wouldn't want
to care what the underlying device is, and could just ask for metadata
that it's interested in.  With this approach, your eBPF program is now
bound/tied to the NIC/driver, and if you switched to a differen
NIC/driver combo, then you'd have to rewrite part of your eBPF program
to comprehend that.  I thought we were trying to avoid that.

Our proposed approach (still working on something ready to RFC) is to
provide a method for the eBPF program to send a struct of requested
hints down to the driver on load.  If the driver can provide the hints,
then that'd be how they'd be laid out in the metadata.  If it can't
provide them, we'd probably reject the program loading, or discuss
providing a software fallback (I know this is an area of contention).

I suppose we could get there with the rewriting mechanism described
below, but that'd be a tough sell to set a bit of ABI for metadata,
then change it to be potentially dynamic at runtime in the future.

-PJ

  reply	other threads:[~2018-07-06 20:44 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-27  2:46 [RFC bpf-next 0/6] XDP RX device meta data acceleration (WIP) Saeed Mahameed
2018-06-27  2:46 ` [RFC bpf-next 1/6] net: xdp: Add support for meta data flags requests Saeed Mahameed
2018-06-27  2:46 ` [RFC bpf-next 2/6] net: xdp: RX meta data infrastructure Saeed Mahameed
2018-06-27 14:15   ` Jesper Dangaard Brouer
2018-06-27 17:55     ` Saeed Mahameed
2018-07-02  8:01       ` Daniel Borkmann
2018-07-03 23:52         ` Saeed Mahameed
2018-07-03 23:01   ` Alexei Starovoitov
2018-07-04  0:57     ` Saeed Mahameed
2018-07-04  7:51       ` Daniel Borkmann
2018-07-05 17:18         ` Jakub Kicinski
2018-07-06 16:30           ` Alexei Starovoitov
2018-07-06 20:44             ` Waskiewicz Jr, Peter [this message]
2018-07-06 23:38               ` Alexei Starovoitov
2018-07-06 23:49                 ` Waskiewicz Jr, Peter
2018-07-07  0:40                   ` Jakub Kicinski
2018-07-07  1:00                     ` Alexei Starovoitov
2018-07-07  1:20                       ` Jakub Kicinski
2018-07-07  2:38                         ` Alexei Starovoitov
2018-07-07  0:45                   ` Alexei Starovoitov
2018-07-06 21:33             ` Jakub Kicinski
2018-07-06 23:42               ` Alexei Starovoitov
2018-07-07  0:08                 ` Jakub Kicinski
2018-07-07  0:53                   ` Alexei Starovoitov
2018-07-07  1:37                     ` David Miller
2018-07-07  1:44                     ` Jakub Kicinski
2018-07-07  2:51                       ` Alexei Starovoitov
2018-07-07  1:27             ` David Miller
2018-06-27  2:46 ` [RFC bpf-next 3/6] net/mlx5e: Store xdp flags and meta data info Saeed Mahameed
2018-06-27  2:46 ` [RFC bpf-next 4/6] net/mlx5e: Pass CQE to RX handlers Saeed Mahameed
2018-06-27  2:46 ` [RFC bpf-next 5/6] net/mlx5e: Add XDP RX meta data support Saeed Mahameed
2018-07-04  8:28   ` Daniel Borkmann
2018-06-27  2:46 ` [RFC bpf-next 6/6] samples/bpf: Add meta data hash example to xdp_redirect_cpu Saeed Mahameed
2018-06-27 10:59   ` Jesper Dangaard Brouer
2018-06-27 18:04     ` Saeed Mahameed
2018-06-27 16:42 ` [RFC bpf-next 0/6] XDP RX device meta data acceleration (WIP) Parikh, Neerav

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=1530909863.4291.12.camel@intel.com \
    --to=peter.waskiewicz.jr@intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=borkmann@iogearbox.net \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@dev.mellanox.co.il \
    --cc=saeedm@mellanox.com \
    --cc=tariqt@mellanox.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.