Skip to contentSkip to conversation

flow_offload: add TC_SETP_FT type in flow_indr_block_call

PATCH In review [email protected] 2 participants 2 messages Mar 18, 2020 – Mar 23, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 flow_offload: add TC_SETP_FT type in flow_indr_block_call

From: wenxu <[email protected]>

Add TC_SETP_FT type in flow_indr_block_call for supporting indr block call in nf_flow_table_offload

Fixes b5140a36da78 ("netfilter: flowtable: add indr block setup support")
---
 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(-)
include/net/flow_offload.h +2 -1
index efd8d47..80b6555 100644
@@ -523,6 +523,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 */
net/core/flow_offload.c +3 -3
index 7440e61..e951b74 100644
@@ -511,7 +511,8 @@ 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)
 {
 	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);
 
net/netfilter/nf_flow_table_offload.c +1 -1
index ad54931..cd5bd23 100644
@@ -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;
net/netfilter/nf_tables_offload.c +1 -1
index 2bb2848..954bccb 100644
@@ -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;
net/sched/cls_api.c +1 -1
index 2046102..0db43d7 100644
@@ -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);
 }
 
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw

From: [email protected]
Date: Wed, 18 Mar 2020 17:00:12 +0800

Quoted 7 lines

From: wenxu <[email protected]>

Add TC_SETP_FT type in flow_indr_block_call for supporting indr block call in nf_flow_table_offload

Fixes b5140a36da78 ("netfilter: flowtable: add indr block setup support")

I don't understand what this patch is doing, why it is necessary, and why it was implemented the way that it was.

You must write proper, full, commit log messages for your changes.