netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: daniel@iogearbox.net, ast@kernel.org,
	David Miller <davem@davemloft.net>,
	Maciej Fijalkowski <maciejromanfijalkowski@gmail.com>,
	netdev@vger.kernel.org, john.fastabend@gmail.com,
	David Ahern <dsahern@gmail.com>,
	brouer@redhat.com, Saeed Mahameed <saeedm@mellanox.com>
Subject: Co-existing XDP generic and native mode? (Re: [PATCH bpf-next v5 5/8] xdp: Provide extack messages when prog attachment failed)
Date: Fri, 1 Feb 2019 08:02:36 +0100	[thread overview]
Message-ID: <20190201080236.446d84d4@redhat.com> (raw)
In-Reply-To: <20190131191101.2e9dc9f6@cakuba.hsd1.ca.comcast.net>

On Thu, 31 Jan 2019 19:11:01 -0800
Jakub Kicinski <jakub.kicinski@netronome.com> wrote:

> On Fri,  1 Feb 2019 01:19:51 +0100, Maciej Fijalkowski wrote:
> >  		if (__dev_xdp_query(dev, bpf_chk, XDP_QUERY_PROG) ||
> > -		    __dev_xdp_query(dev, bpf_chk, XDP_QUERY_PROG_HW))
> > +		    __dev_xdp_query(dev, bpf_chk, XDP_QUERY_PROG_HW)) {
> > +			NL_SET_ERR_MSG(extack, "native and generic XDP can't be active at the same time");
> >  			return -EEXIST;
> > +		}  
> 
> This reminds me, since we allowed native/driver and offloaded XDP
> programs to coexist in a25717d2b604 ("xdp: support simultaneous 
> driver and hw XDP attachment") I got an internal feature request 
> to also allow generic and native mode.  Would anyone object to that?

Well, I will object ;-)

I have two refactor ideas [1] and [2], that depend on not allowing
XDP-native and XDP-generic to co-exist.   The general idea is to let
XDP-native use the same fields in net_device->rx[] as XDP-generic given
they (currently) cannot co-exist. 
 The goal is (1) to move stuff out of driver code, and (2) hopefully
make it easier to implement per RXq XDP progs.

These are only refactor ideas, so if you can argue why your internal
feature request for simultaneous generic and native make more sense,
then I'm open for allowing this ?

[1] https://github.com/xdp-project/xdp-project/blob/master/areas/core/xdp_per_rxq01.org#refactor-idea-move-xdp_rxq_info-to-net_devicenetdev_rx_queue

[2] https://github.com/xdp-project/xdp-project/blob/master/areas/core/xdp_per_rxq01.org#refactor-idea-xdpbpf_prog-into-netdev_rx_queuenet_device

> Apart from a touch up to test_offload.py I don't think anything 
> would care.  netlink can already carry multiple IDs, iproute2
> understands it, too..

And we did notice you added support for HW+native:
 [3] https://github.com/xdp-project/xdp-project/blob/master/areas/core/xdp_per_rxq01.org
-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

  reply	other threads:[~2019-02-01  7:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-01  0:19 [PATCH bpf-next v5 0/8] xdp: Avoid unloading xdp prog not attached by sample Maciej Fijalkowski
2019-02-01  0:19 ` [PATCH bpf-next v5 1/8] libbpf: Add a helper for retrieving a map fd for a given name Maciej Fijalkowski
2019-02-01  0:19 ` [PATCH bpf-next v5 2/8] samples/bpf: xdp_redirect_cpu have not need for read_trace_pipe Maciej Fijalkowski
2019-02-01  0:19 ` [PATCH bpf-next v5 3/8] samples/bpf: Convert XDP samples to libbpf usage Maciej Fijalkowski
2019-02-01  0:19 ` [PATCH bpf-next v5 4/8] samples/bpf: Extend RLIMIT_MEMLOCK for xdp_{sample_pkts, router_ipv4} Maciej Fijalkowski
2019-02-01  0:19 ` [PATCH bpf-next v5 5/8] xdp: Provide extack messages when prog attachment failed Maciej Fijalkowski
2019-02-01  0:32   ` Jakub Kicinski
2019-02-01  3:11   ` Jakub Kicinski
2019-02-01  7:02     ` Jesper Dangaard Brouer [this message]
2019-02-01 18:47       ` Co-existing XDP generic and native mode? (Re: [PATCH bpf-next v5 5/8] xdp: Provide extack messages when prog attachment failed) Jakub Kicinski
2019-02-01 21:33         ` Daniel Borkmann
2019-02-01 21:44           ` Jakub Kicinski
2019-02-01 23:14             ` Daniel Borkmann
2019-02-01  7:04   ` [PATCH bpf-next v5 5/8] xdp: Provide extack messages when prog attachment failed Jesper Dangaard Brouer
2019-02-01  0:19 ` [PATCH bpf-next v5 6/8] samples/bpf: Add a "force" flag to XDP samples Maciej Fijalkowski
2019-02-01  0:19 ` [PATCH bpf-next v5 7/8] libbpf: Add a support for getting xdp prog id on ifindex Maciej Fijalkowski
2019-02-01 21:43   ` Daniel Borkmann
2019-02-01 21:47     ` Jakub Kicinski
2019-02-01 23:00       ` Daniel Borkmann
2019-02-01  0:19 ` [PATCH bpf-next v5 8/8] samples/bpf: Check the prog id before exiting Maciej Fijalkowski
2019-02-01 21:23 ` [PATCH bpf-next v5 0/8] xdp: Avoid unloading xdp prog not attached by sample Daniel Borkmann
2019-02-01 21:47   ` Maciej Fijałkowski

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=20190201080236.446d84d4@redhat.com \
    --to=brouer@redhat.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=john.fastabend@gmail.com \
    --cc=maciejromanfijalkowski@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@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 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).