From: Jakub Kicinski <kuba@kernel.org>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: netdev@vger.kernel.org, "Thomas Ptacek" <thomas@sockpuppet.org>,
"Adhipati Blambangan" <adhipati@tuta.io>,
"David Ahern" <dsahern@gmail.com>,
"Toke Høiland-Jørgensen" <toke@redhat.com>,
"Alexei Starovoitov" <alexei.starovoitov@gmail.com>
Subject: Re: [PATCH net v4] net: xdp: account for layer 3 packets in generic skb handler
Date: Thu, 13 Aug 2020 14:01:52 -0700 [thread overview]
Message-ID: <20200813140152.1aab6068@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20200813195816.67222-1-Jason@zx2c4.com>
On Thu, 13 Aug 2020 21:58:16 +0200 Jason A. Donenfeld wrote:
> - cls_bpf does not support the same feature set as XDP, and operates at
> a slightly different stage in the networking stack.
Please elaborate.
> I had originally dropped this patch, but the issue kept coming up in
> user reports, so here's a v4 of it. Testing of it is still rather slim,
> but hopefully that will change in the coming days.
Here an alternative patch, untested:
diff --git a/net/core/dev.c b/net/core/dev.c
index d3d53dc601f9..7f68831bdd4f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5434,6 +5434,11 @@ static int generic_xdp_install(struct net_device *dev, struct netdev_bpf *xdp)
struct bpf_prog *new = xdp->prog;
int ret = 0;
+ if (!dev->hard_header_len) {
+ NL_SET_ERR_MSG(xdp->extack, "generic XDP not supported on L3 devices, please use cls_bpf");
+ return -EINVAL;
+ }
+
if (new) {
u32 i;
next prev parent reply other threads:[~2020-08-13 21:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-13 19:58 [PATCH net v4] net: xdp: account for layer 3 packets in generic skb handler Jason A. Donenfeld
2020-08-13 21:01 ` Jakub Kicinski [this message]
2020-08-14 6:56 ` Jason A. Donenfeld
2020-08-14 7:30 ` [PATCH net v5] " Jason A. Donenfeld
2020-08-14 20:55 ` David Miller
2020-08-14 20:57 ` Jason A. Donenfeld
2020-08-15 7:41 ` [PATCH net v6] " Jason A. Donenfeld
2020-08-19 7:07 ` Jesper Dangaard Brouer
2020-08-19 23:22 ` David Miller
2020-08-20 9:13 ` Jason A. Donenfeld
2020-08-20 18:55 ` David Miller
2020-08-20 20:29 ` Jason A. Donenfeld
2020-08-14 15:31 ` [PATCH net v4] " Jakub Kicinski
2020-08-14 21:04 ` Jason A. Donenfeld
2020-08-14 21:26 ` David Miller
2020-08-15 7:54 ` Jason A. Donenfeld
2020-08-14 21:14 ` David Miller
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=20200813140152.1aab6068@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
--to=kuba@kernel.org \
--cc=Jason@zx2c4.com \
--cc=adhipati@tuta.io \
--cc=alexei.starovoitov@gmail.com \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=thomas@sockpuppet.org \
--cc=toke@redhat.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).