kernel: bump 6.1 to 6.1.68
[openwrt/staging/stintel.git] / target / linux / generic / pending-6.1 / 701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Thu, 31 Aug 2023 21:48:38 +0200
3 Subject: [PATCH] netfilter: nf_tables: ignore -EOPNOTSUPP on flowtable device
4 offload setup
5
6 On many embedded devices, it is common to configure flowtable offloading for
7 a mix of different devices, some of which have hardware offload support and
8 some of which don't.
9 The current code limits the ability of user space to properly set up such a
10 configuration by only allowing adding devices with hardware offload support to
11 a offload-enabled flowtable.
12 Given that offload-enabled flowtables also imply fallback to pure software
13 offloading, this limitation makes little sense.
14 Fix it by not bailing out when the offload setup returns -EOPNOTSUPP
15
16 Signed-off-by: Felix Fietkau <nbd@nbd.name>
17 ---
18
19 --- a/net/netfilter/nf_tables_api.c
20 +++ b/net/netfilter/nf_tables_api.c
21 @@ -7884,7 +7884,7 @@ static int nft_register_flowtable_net_ho
22 err = flowtable->data.type->setup(&flowtable->data,
23 hook->ops.dev,
24 FLOW_BLOCK_BIND);
25 - if (err < 0)
26 + if (err < 0 && err != -EOPNOTSUPP)
27 goto err_unregister_net_hooks;
28
29 err = nf_register_net_hook(net, &hook->ops);