From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 13/28] netfilter: flowtable: Fix incorrect tc_setup_type type
Date: Mon, 30 Mar 2020 21:21:21 +0200 [thread overview]
Message-ID: <20200330192136.230459-14-pablo@netfilter.org> (raw)
In-Reply-To: <20200330192136.230459-1-pablo@netfilter.org>
From: wenxu <wenxu@ucloud.cn>
The indirect block setup should use TC_SETUP_FT as the type instead of
TC_SETUP_BLOCK. Adjust existing users of the indirect flow block
infrastructure.
Fixes: b5140a36da78 ("netfilter: flowtable: add indr block setup support")
Signed-off-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
include/net/flow_offload.h | 3 ++-
net/core/flow_offload.c | 6 +++---
net/netfilter/nf_flow_table_offload.c | 2 +-
net/netfilter/nf_tables_offload.c | 2 +-
net/sched/cls_api.c | 2 +-
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
index 1e30b0d44b61..1afb6bd4530d 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -520,6 +520,7 @@ void flow_indr_block_cb_unregister(struct net_device *dev,
void flow_indr_block_call(struct net_device *dev,
struct flow_block_offload *bo,
- enum flow_block_command command);
+ enum flow_block_command command,
+ enum tc_setup_type type);
#endif /* _NET_FLOW_OFFLOAD_H */
diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c
index 7440e6117c81..e951b743bed3 100644
--- a/net/core/flow_offload.c
+++ b/net/core/flow_offload.c
@@ -511,7 +511,8 @@ EXPORT_SYMBOL_GPL(flow_indr_block_cb_unregister);
void flow_indr_block_call(struct net_device *dev,
struct flow_block_offload *bo,
- enum flow_block_command command)
+ enum flow_block_command command,
+ enum tc_setup_type type)
{
struct flow_indr_block_cb *indr_block_cb;
struct flow_indr_block_dev *indr_dev;
@@ -521,8 +522,7 @@ void flow_indr_block_call(struct net_device *dev,
return;
list_for_each_entry(indr_block_cb, &indr_dev->cb_list, list)
- indr_block_cb->cb(dev, indr_block_cb->cb_priv, TC_SETUP_BLOCK,
- bo);
+ indr_block_cb->cb(dev, indr_block_cb->cb_priv, type, bo);
}
EXPORT_SYMBOL_GPL(flow_indr_block_call);
diff --git a/net/netfilter/nf_flow_table_offload.c b/net/netfilter/nf_flow_table_offload.c
index a68136a8d750..0c6437fab4fe 100644
--- a/net/netfilter/nf_flow_table_offload.c
+++ b/net/netfilter/nf_flow_table_offload.c
@@ -938,7 +938,7 @@ static int nf_flow_table_indr_offload_cmd(struct flow_block_offload *bo,
{
nf_flow_table_block_offload_init(bo, dev_net(dev), cmd, flowtable,
extack);
- flow_indr_block_call(dev, bo, cmd);
+ flow_indr_block_call(dev, bo, cmd, TC_SETUP_FT);
if (list_empty(&bo->cb_list))
return -EOPNOTSUPP;
diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c
index 2bb28483af22..954bccb7f32a 100644
--- a/net/netfilter/nf_tables_offload.c
+++ b/net/netfilter/nf_tables_offload.c
@@ -313,7 +313,7 @@ static int nft_indr_block_offload_cmd(struct nft_base_chain *chain,
nft_flow_block_offload_init(&bo, dev_net(dev), cmd, chain, &extack);
- flow_indr_block_call(dev, &bo, cmd);
+ flow_indr_block_call(dev, &bo, cmd, TC_SETUP_BLOCK);
if (list_empty(&bo.cb_list))
return -EOPNOTSUPP;
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index eefacb3176e3..84f8ee6f2009 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -708,7 +708,7 @@ static void tc_indr_block_call(struct tcf_block *block,
};
INIT_LIST_HEAD(&bo.cb_list);
- flow_indr_block_call(dev, &bo, command);
+ flow_indr_block_call(dev, &bo, command, TC_SETUP_BLOCK);
tcf_block_setup(block, &bo);
}
--
2.11.0
next prev parent reply other threads:[~2020-03-30 19:22 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-30 19:21 [PATCH 00/28] Netfilter/IPVS updates for net-next Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 01/28] netfilter: nf_tables: move nft_expr_clone() to nf_tables_api.c Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 02/28] netfilter: nf_tables: pass context to nft_set_destroy() Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 03/28] netfilter: nf_tables: allow to specify stateful expression in set definition Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 04/28] netfilter: nf_tables: fix double-free on set expression from the error path Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 05/28] netfilter: nf_tables: add nft_set_elem_expr_destroy() and use it Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 06/28] netfilter: flowtable: fix NULL pointer dereference in tunnel offload support Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 07/28] netfilter: ctnetlink: Add missing annotation for ctnetlink_parse_nat_setup() Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 08/28] netfilter: conntrack: Add missing annotations for nf_conntrack_all_lock() and nf_conntrack_all_unlock() Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 09/28] ipvs: optimize tunnel dumps for icmp errors Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 10/28] netfilter: conntrack: export nf_ct_acct_update() Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 11/28] netfilter: nf_tables: add enum nft_flowtable_flags to uapi Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 12/28] netfilter: flowtable: add counter support Pablo Neira Ayuso
2020-03-30 19:21 ` Pablo Neira Ayuso [this message]
2020-03-30 19:21 ` [PATCH 14/28] netfilter: nf_tables: silence a RCU-list warning in nft_table_lookup() Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 15/28] netfilter: flowtable: Use rw sem as flow block lock Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 16/28] netfilter: flowtable: Use work entry per offload command Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 17/28] netfilter: nf_queue: make nf_queue_entry_release_refs static Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 18/28] netfilter: nf_queue: place bridge physports into queue_entry struct Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 19/28] netfilter: nf_queue: do not release refcouts until nf_reinject is done Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 20/28] netfilter: nf_queue: prefer nf_queue_entry_free Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 21/28] netfilter: ctnetlink: be more strict when NF_CONNTRACK_MARK is not set Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 22/28] netfilter: nft_set_bitmap: initialize set element extension in lookups Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 23/28] netfilter: nft_dynset: validate set expression definition Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 24/28] netfilter: nf_tables: skip set types that do not support for expressions Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 25/28] netfilter: conntrack: add nf_ct_acct_add() Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 26/28] netfilter: flowtable: add counter support in HW offload Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 27/28] netfilter: nft_exthdr: fix endianness of tcp option cast Pablo Neira Ayuso
2020-03-30 19:21 ` [PATCH 28/28] ipvs: fix uninitialized variable warning Pablo Neira Ayuso
2020-03-31 3:11 ` [PATCH 00/28] Netfilter/IPVS updates for net-next 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=20200330192136.230459-14-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@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).