From: wenxu <we...@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 <we...@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