forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel: allow adding devices without hw offload to a hw flowtable
This allows supporting a mix of devices with or without hw offloading support Signed-off-by: Felix Fietkau <[email protected]>
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...linux/generic/pending-5.15/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From: Felix Fietkau <[email protected]> | ||
Date: Thu, 31 Aug 2023 21:48:38 +0200 | ||
Subject: [PATCH] netfilter: nf_tables: ignore -EOPNOTSUPP on flowtable device | ||
offload setup | ||
|
||
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 <[email protected]> | ||
--- | ||
|
||
--- a/net/netfilter/nf_tables_api.c | ||
+++ b/net/netfilter/nf_tables_api.c | ||
@@ -7729,7 +7729,7 @@ static int nft_register_flowtable_net_ho | ||
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); |
29 changes: 29 additions & 0 deletions
29
.../linux/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From: Felix Fietkau <[email protected]> | ||
Date: Thu, 31 Aug 2023 21:48:38 +0200 | ||
Subject: [PATCH] netfilter: nf_tables: ignore -EOPNOTSUPP on flowtable device | ||
offload setup | ||
|
||
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 <[email protected]> | ||
--- | ||
|
||
--- a/net/netfilter/nf_tables_api.c | ||
+++ b/net/netfilter/nf_tables_api.c | ||
@@ -7886,7 +7886,7 @@ static int nft_register_flowtable_net_ho | ||
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); |