netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/2] flow_offload: fix incorrect cb_priv check for flow_block_cb
@ 2020-06-11  3:30 wenxu
  2020-06-11  3:30 ` [PATCH net 2/2] flow_offload: fix miss cleanup flow_block_cb of indr_setup_ft_cb type wenxu
  0 siblings, 1 reply; 4+ messages in thread
From: wenxu @ 2020-06-11  3:30 UTC (permalink / raw)
  To: netdev; +Cc: davem, pablo

From: wenxu <wenxu@ucloud.cn>

The cb_priv in the flow_indr_dev_unregister get from the driver
is the same as cb_priv of flow_indr_dev. But it  always isn't
the same as cb_priv of flow_block_cb which leads miss cleanup operation.

For mlx5e example the cb_priv of flow_indr_dev is the mlx5e_rep_priv
which related to real hw device and the cb_priv of flow_block_cb is
the indr_priv which related to indr tunnel device.

Fixes: 1fac52da5942 ("net: flow_offload: consolidate indirect flow_block infrastructure")
Signed-off-by: wenxu <wenxu@ucloud.cn>
---
 net/core/flow_offload.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c
index 0cfc35e..5ceb2d1 100644
--- a/net/core/flow_offload.c
+++ b/net/core/flow_offload.c
@@ -372,14 +372,13 @@ int flow_indr_dev_register(flow_indr_block_bind_cb_t *cb, void *cb_priv)
 }
 EXPORT_SYMBOL(flow_indr_dev_register);
 
-static void __flow_block_indr_cleanup(flow_setup_cb_t *setup_cb, void *cb_priv,
+static void __flow_block_indr_cleanup(flow_setup_cb_t *setup_cb,
 				      struct list_head *cleanup_list)
 {
 	struct flow_block_cb *this, *next;
 
 	list_for_each_entry_safe(this, next, &flow_block_indr_list, indr.list) {
-		if (this->cb == setup_cb &&
-		    this->cb_priv == cb_priv) {
+		if (this->cb == setup_cb) {
 			list_move(&this->indr.list, cleanup_list);
 			return;
 		}
@@ -418,7 +417,7 @@ void flow_indr_dev_unregister(flow_indr_block_bind_cb_t *cb, void *cb_priv,
 		return;
 	}
 
-	__flow_block_indr_cleanup(setup_cb, cb_priv, &cleanup_list);
+	__flow_block_indr_cleanup(setup_cb, &cleanup_list);
 	mutex_unlock(&flow_indr_block_lock);
 
 	flow_block_indr_notify(&cleanup_list);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-11 10:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-11  3:30 [PATCH net 1/2] flow_offload: fix incorrect cb_priv check for flow_block_cb wenxu
2020-06-11  3:30 ` [PATCH net 2/2] flow_offload: fix miss cleanup flow_block_cb of indr_setup_ft_cb type wenxu
2020-06-11  9:47   ` Pablo Neira Ayuso
2020-06-11 10:39   ` Vlad Buslov

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).