From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>,
Kalle Valo <kvalo@codeaurora.org>,
linux-wireless@vger.kernel.org, nbd@nbd.name,
Daniel Borkmann <borkmann@iogearbox.net>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
"netdev\@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [RFC 0/5] add XDP support to mt76x2e/mt76x0e drivers
Date: Thu, 29 Nov 2018 17:06:54 +0100 [thread overview]
Message-ID: <8736rjrhpd.fsf@toke.dk> (raw)
In-Reply-To: <20181129154502.GA29066@localhost.localdomain>
Lorenzo Bianconi <lorenzo.bianconi@redhat.com> writes:
>> Lorenzo Bianconi <lorenzo.bianconi@redhat.com> writes:
>>
>> >> Lorenzo Bianconi <lorenzo.bianconi@redhat.com> writes:
>> >>
>> >> >> On Wed, 28 Nov 2018 13:36:26 +0100
>> >> >> Toke Høiland-Jørgensen <toke@toke.dk> wrote:
>> >> >>
>
> [...]
>
>> >> >
>> >> > I guess it will be enough to avoid loading a 'non-WiFi' bpf program on
>> >> > a 802.11 netdevice (and vice versa). We could add a flag (or something
>> >> > similar) in XDP_SETUP_PROG section of netdev_bpf data structure and
>> >> > use ieee80211_ptr netdevice pointer in order to guarantee that the bpf
>> >> > program will work on the expected 'frame-type'
>> >>
>> >> Yeah, a flag would be good; we've been discussing that for other XDP use
>> >> cases; it's not a done deal yet, but I think it would be useful.
>> >
>> > Do you think something wifi specific is ok (e.g bool wifi) or do you prefer
>> > something more general (e.g u32 frame_type)?
>>
>> My thought was a feature flag where the program can set a flag which
>> means "I expect 802.11 frames", and the driver can set a flag saying "I
>> emit 802.11 frames", and if those two flags don't match, the verifier
>> can refuse to load the program. This would not be fool-proof (an XDP
>> program can still corrupt things if written incorrectly), but it would
>> at least protect against the most obvious mistakes.
>
> I guess we can use iee80211_ptr in dev_xdp_install to double check if it is
> allowed to upload a 802.11 (or 802.3) bpf program
Yeah, I think it's more an issue of convincing the wider XDP community
that support for feature flags is in fact needed ;)
-Toke
prev parent reply other threads:[~2018-11-30 3:12 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
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 [this message]
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=8736rjrhpd.fsf@toke.dk \
--to=toke@toke.dk \
--cc=alexei.starovoitov@gmail.com \
--cc=borkmann@iogearbox.net \
--cc=brouer@redhat.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).