From: Felix Fietkau <nbd@nbd.name>
To: netfilter-devel@vger.kernel.org
Cc: netdev@vger.kernel.org, Pablo Neira Ayuso <pablo@netfilter.org>
Subject: [RFC] netfilter: nf_tables: ignore -EOPNOTSUPP on flowtable device offload setup
Date: Thu, 31 Aug 2023 22:14:20 +0200 [thread overview]
Message-ID: <20230831201420.63178-1-nbd@nbd.name> (raw)
On many embedded devices, it is common to configure flowtable offloading for
a mix of different devices, some of which have hardware offload support and
some of which don't.
The current code limits the ability of user space to properly set up such a
configuration by only allowing adding devices with hardware offload support to
a offload-enabled flowtable.
Given that offload-enabled flowtables also imply fallback to pure software
offloading, this limitation makes little sense.
Fix it by not bailing out when the offload setup returns -EOPNOTSUPP
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
net/netfilter/nf_tables_api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 41b826dff6f5..dfa2ea98088b 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -8103,7 +8103,7 @@ static int nft_register_flowtable_net_hooks(struct net *net,
err = flowtable->data.type->setup(&flowtable->data,
hook->ops.dev,
FLOW_BLOCK_BIND);
- if (err < 0)
+ if (err < 0 && err != -EOPNOTSUPP)
goto err_unregister_net_hooks;
err = nf_register_net_hook(net, &hook->ops);
--
2.41.0
next reply other threads:[~2023-08-31 20:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-31 20:14 Felix Fietkau [this message]
2023-09-01 8:39 ` [RFC] netfilter: nf_tables: ignore -EOPNOTSUPP on flowtable device offload setup Pablo Neira Ayuso
2023-09-01 10:30 ` Felix Fietkau
2023-09-01 12:29 ` Pablo Neira Ayuso
2023-09-01 12:47 ` Felix Fietkau
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=20230831201420.63178-1-nbd@nbd.name \
--to=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).