netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: "Michał Kazior" <kazikcz@gmail.com>
Cc: lorenzo.bianconi@redhat.com, brouer@redhat.com,
	kvalo@codeaurora.org,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Felix Fietkau <nbd@nbd.name>,
	borkmann@iogearbox.net, alexei.starovoitov@gmail.com,
	Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [RFC 0/5] add XDP support to mt76x2e/mt76x0e drivers
Date: Thu, 29 Nov 2018 14:48:42 +0100	[thread overview]
Message-ID: <87mupsq9j9.fsf@toke.dk> (raw)
In-Reply-To: <CABvG-CVFYNaytwaUj9YGVUp38DBP9CVYkoU6EKvbJBPNmtK0Ag@mail.gmail.com>

Michał Kazior <kazikcz@gmail.com> writes:

> On Thu, 29 Nov 2018 at 14:31, Toke Høiland-Jørgensen <toke@toke.dk> wrote:
> [...]
>> >> Option#3 is to say, Wifi XDP is so different that we should create a
>> >> new (enum) bpf_prog_type.  And then still see if we can leverage some
>> >> of the same core-code (as long as it doesn't slowdown performance).
>> >>
>> >
>> > Do you think that Option#3 will be more 'future-proof' respect to
>> > Option#1?
>>
>> My feeling is that WiFi devices are not sufficiently different to
>> warrant a whole new program type. We risk combinatorial explosion for
>> all the stuff that is the same, but now need to be tested for two (or N)
>> types...
>
> I'm not sure if my understanding is correct, but XDP seems like it can
> (and intends to be able to?) act as a general purpose packet
> accelerator (REDIRECT action was mentioned so I'm inferring..). In
> such case you'll need to be able to perform transformations on packets
> too, e.g. strip/prepend vlan tags, gre headers and what have you. The
> 802.3 <-> 802.11 conversion could be treated on equal terms.

Sure, that is perfectly possible. It just needs to be implemented by the
eBPF program being loaded; and there is a facility to shrink/expand the
packet size for encapsulation processing. It's just that since currently
all interfaces process Ethernet frames, this frame type assumption has
kinda been built in. So something needs to be done to handle that.

The minimum is just to ignore the issue and make it up to the program
writer to handle this or risk breaking things, but something a bit
friendlier (such as an ability for the loaded program to indicate which
frame type it is prepared to handle, which can be sanity-checked by the
loader) might be a good idea... Especially if different WiFi devices
will emit different frame types (so we can't just go "it's a WiFi
device, you should know this").

Then there's the additional issue that since mac80211 and/or the driver
may have internal state, we need to expose appropriate helpers for an
XDP program to be able to update this as it's processing packets (before
bypassing the stack, for instance).

-Toke

  reply	other threads:[~2018-11-30  0:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1543343124.git.lorenzo.bianconi@redhat.com>
     [not found] ` <8736rla4ow.fsf@purkki.adurom.net>
     [not found]   ` <20181128104436.GA2298@localhost.localdomain>
     [not found]     ` <87bm69v0ol.fsf@toke.dk>
     [not found]       ` <87bm69v0ol.fsf-LJ9M9ZcSy1A@public.gmane.org>
2018-11-28 15:43         ` [RFC 0/5] add XDP support to mt76x2e/mt76x0e drivers Jesper Dangaard Brouer
2018-11-29 10:30           ` Lorenzo Bianconi
     [not found]             ` <20181129103054.GA6365-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2018-11-29 13:27               ` Toke Høiland-Jørgensen
2018-11-29 13:41                 ` Michał Kazior
2018-11-29 13:48                   ` Toke Høiland-Jørgensen [this message]
2018-11-29 13:58                 ` Lorenzo Bianconi
     [not found]                   ` <20181129135825.GD6365-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2018-11-29 14:06                     ` Toke Høiland-Jørgensen
2018-11-29 15:45                       ` Lorenzo Bianconi
2018-11-29 16:06                         ` Toke Høiland-Jørgensen

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=87mupsq9j9.fsf@toke.dk \
    --to=toke@toke.dk \
    --cc=alexei.starovoitov@gmail.com \
    --cc=borkmann@iogearbox.net \
    --cc=brouer@redhat.com \
    --cc=kazikcz@gmail.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    /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).