Skip to contentSkip to conversation

Indirect dev ingress qdisc creation order

PATCH Applied Eli Cohen 2 participants 4 messages Aug 17, 2021 – Aug 19, 2021

Subsystems (4)
lore
Share & tools
lore

Eli Cohen

author
#0 lore raw

v2 cover Indirect dev ingress qdisc creation order

The first patch is just a cleanup of the code.
The second patch is fixing the dependency in ingress qdisc creation relative to offloading driver registration to filter configurations.

v1 -> v2:
Fix warning - variable set but not used

Eli Cohen (2):
net/core: Remove unused field from struct flow_indr_dev
net: Fix offloading indirect devices dependency on qdisc order
creation

 include/net/flow_offload.h            |  1 +
 net/core/flow_offload.c               | 90 ++++++++++++++++++++++++++-
 net/netfilter/nf_flow_table_offload.c |  1 +
 net/netfilter/nf_tables_offload.c     |  1 +
 net/sched/cls_api.c                   |  1 +
 5 files changed, 92 insertions(+), 2 deletions(-)
Signature · 1 line
2.32.0
author
#1 lore raw

PATCH v2 1/2 net/core: Remove unused field from struct flow_indr_dev

rcu field is not used. Remove it.

---
 net/core/flow_offload.c | 1 -
 1 file changed, 1 deletion(-)
net/core/flow_offload.c +0 -1
index 715b67f6c62f..1da83997e86a 100644
@@ -327,7 +327,6 @@ struct flow_indr_dev {
 	flow_indr_block_bind_cb_t	*cb;
 	void				*cb_priv;
 	refcount_t			refcnt;
-	struct rcu_head			rcu;
 };
 
 static struct flow_indr_dev *flow_indr_dev_alloc(flow_indr_block_bind_cb_t *cb,
Signature · 1 line
2.32.0
author
#2 lore raw

PATCH v2 2/2 net: Fix offloading indirect devices dependency on qdisc order creation

In reply to Eli Cohen

Currently, when creating an ingress qdisc on an indirect device before the driver registered for callbacks, the driver will not have a chance to register its filter configuration callbacks.

To fix that, modify the code such that it keeps track of all the ingress qdiscs that call flow_indr_dev_setup_offload(). When a driver calls flow_indr_dev_register(), go through the list of tracked ingress qdiscs and call the driver callback entry point so as to give it a chance to register its callback.

---
v1 -> v2:
Fix warning - variable set but not used

 include/net/flow_offload.h            |  1 +
 net/core/flow_offload.c               | 89 ++++++++++++++++++++++++++-
 net/netfilter/nf_flow_table_offload.c |  1 +
 net/netfilter/nf_tables_offload.c     |  1 +
 net/sched/cls_api.c                   |  1 +
 5 files changed, 92 insertions(+), 1 deletion(-)
include/net/flow_offload.h +1 -0
index f3c2841566a0..5aa27acdb0b3 100644
@@ -453,6 +453,7 @@ struct flow_block_offload {
 	struct list_head *driver_block_list;
 	struct netlink_ext_ack *extack;
 	struct Qdisc *sch;
+	struct list_head *cb_list_head;
 };
 
 enum tc_setup_type;
net/core/flow_offload.c +88 -1

119 lines not on this page · raw message

net/netfilter/nf_flow_table_offload.c +1 -0
index f92006cec94c..cbd9f59098b7 100644
@@ -1097,6 +1097,7 @@ static void nf_flow_table_block_offload_init(struct flow_block_offload *bo,
 	bo->command	= cmd;
 	bo->binder_type	= FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS;
 	bo->extack	= extack;
+	bo->cb_list_head = &flowtable->flow_block.cb_list;
 	INIT_LIST_HEAD(&bo->cb_list);
 }
 
net/netfilter/nf_tables_offload.c +1 -0
index b58d73a96523..9656c1646222 100644
@@ -353,6 +353,7 @@ static void nft_flow_block_offload_init(struct flow_block_offload *bo,
 	bo->command	= cmd;
 	bo->binder_type	= FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS;
 	bo->extack	= extack;
+	bo->cb_list_head = &basechain->flow_block.cb_list;
 	INIT_LIST_HEAD(&bo->cb_list);
 }
 
net/sched/cls_api.c +1 -0
index e3e79e9bd706..9b276d14be4c 100644
@@ -634,6 +634,7 @@ static void tcf_block_offload_init(struct flow_block_offload *bo,
 	bo->block_shared = shared;
 	bo->extack = extack;
 	bo->sch = sch;
+	bo->cb_list_head = &flow_block->cb_list;
 	INIT_LIST_HEAD(&bo->cb_list);
 }
 
Signature · 1 line
2.32.0
#3 lore raw
In reply to Eli Cohen
This series was applied to netdev/net-next.git (refs/heads/master):

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

Quoted 8 lines · On Tue, 17 Aug 2021 20:05:16 +0300 you wrote:

The first patch is just a cleanup of the code.
The second patch is fixing the dependency in ingress qdisc creation relative to offloading driver registration to filter configurations.

v1 -> v2:
Fix warning - variable set but not used

[...]

Here is the summary with links:
- [PATCHv2,net-next,1/2] net/core: Remove unused field from struct flow_indr_dev

    https://git.kernel.org/netdev/net-next/c/c1c5cb3aee05
  - [PATCHv2,net-next,2/2] net: Fix offloading indirect devices dependency on qdisc order creation
    https://git.kernel.org/netdev/net-next/c/74fc4f828769

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html