All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] Fixes for unlocked cls hardware offload API refactoring
@ 2019-08-29 16:15 Vlad Buslov
  2019-08-29 16:15 ` [PATCH net-next v2 1/2] net: sched: cls_matchall: cleanup flow_action before deallocating Vlad Buslov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vlad Buslov @ 2019-08-29 16:15 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, davem, saeedm, idosch,
	sergei.shtylyov, Vlad Buslov

Two fixes for my "Refactor cls hardware offload API to support
rtnl-independent drivers" series.

Vlad Buslov (2):
  net: sched: cls_matchall: cleanup flow_action before deallocating
  net/mlx5e: Move local var definition into ifdef block

 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 6 ++++--
 net/sched/cls_matchall.c                          | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

-- 
2.21.0


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

* [PATCH net-next v2 1/2] net: sched: cls_matchall: cleanup flow_action before deallocating
  2019-08-29 16:15 [PATCH net-next v2 0/2] Fixes for unlocked cls hardware offload API refactoring Vlad Buslov
@ 2019-08-29 16:15 ` Vlad Buslov
  2019-08-29 16:15 ` [PATCH net-next v2 2/2] net/mlx5e: Move local var definition into ifdef block Vlad Buslov
  2019-08-30 22:12 ` [PATCH net-next v2 0/2] Fixes for unlocked cls hardware offload API refactoring David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Vlad Buslov @ 2019-08-29 16:15 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, davem, saeedm, idosch,
	sergei.shtylyov, Vlad Buslov

Recent rtnl lock removal patch changed flow_action infra to require proper
cleanup besides simple memory deallocation. However, matchall classifier
was not updated to call tc_cleanup_flow_action(). Add proper cleanup to
mall_replace_hw_filter() and mall_reoffload().

Fixes: 5a6ff4b13d59 ("net: sched: take reference to action dev before calling offloads")
Reported-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
---
 net/sched/cls_matchall.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
index 3266f25011cc..7fc2eb62aa98 100644
--- a/net/sched/cls_matchall.c
+++ b/net/sched/cls_matchall.c
@@ -111,6 +111,7 @@ static int mall_replace_hw_filter(struct tcf_proto *tp,
 
 	err = tc_setup_cb_add(block, tp, TC_SETUP_CLSMATCHALL, &cls_mall,
 			      skip_sw, &head->flags, &head->in_hw_count, true);
+	tc_cleanup_flow_action(&cls_mall.rule->action);
 	kfree(cls_mall.rule);
 
 	if (err) {
@@ -313,6 +314,7 @@ static int mall_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
 	err = tc_setup_cb_reoffload(block, tp, add, cb, TC_SETUP_CLSMATCHALL,
 				    &cls_mall, cb_priv, &head->flags,
 				    &head->in_hw_count);
+	tc_cleanup_flow_action(&cls_mall.rule->action);
 	kfree(cls_mall.rule);
 
 	if (err)
-- 
2.21.0


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

* [PATCH net-next v2 2/2] net/mlx5e: Move local var definition into ifdef block
  2019-08-29 16:15 [PATCH net-next v2 0/2] Fixes for unlocked cls hardware offload API refactoring Vlad Buslov
  2019-08-29 16:15 ` [PATCH net-next v2 1/2] net: sched: cls_matchall: cleanup flow_action before deallocating Vlad Buslov
@ 2019-08-29 16:15 ` Vlad Buslov
  2019-08-30 22:12 ` [PATCH net-next v2 0/2] Fixes for unlocked cls hardware offload API refactoring David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Vlad Buslov @ 2019-08-29 16:15 UTC (permalink / raw)
  To: netdev
  Cc: jhs, xiyou.wangcong, jiri, davem, saeedm, idosch,
	sergei.shtylyov, Vlad Buslov, tanhuazhong

New local variable "struct flow_block_offload *f" was added to
mlx5e_setup_tc() in recent rtnl lock removal patches. The variable is used
in code that is only compiled when CONFIG_MLX5_ESWITCH is enabled. This
results compilation warning about unused variable when CONFIG_MLX5_ESWITCH
is not set. Move the variable definition into eswitch-specific code block
from the beginning of mlx5e_setup_tc() function.

Fixes: c9f14470d048 ("net: sched: add API for registering unlocked offload block callbacks")
Reported-by: tanhuazhong <tanhuazhong@huawei.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
---

Notes:
    Changes V1 -> V2:
    
    - Fixed error in commit message.

 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 8592b98d0e70..c10a1fc8e469 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3470,16 +3470,18 @@ static int mlx5e_setup_tc(struct net_device *dev, enum tc_setup_type type,
 			  void *type_data)
 {
 	struct mlx5e_priv *priv = netdev_priv(dev);
-	struct flow_block_offload *f = type_data;
 
 	switch (type) {
 #ifdef CONFIG_MLX5_ESWITCH
-	case TC_SETUP_BLOCK:
+	case TC_SETUP_BLOCK: {
+		struct flow_block_offload *f = type_data;
+
 		f->unlocked_driver_cb = true;
 		return flow_block_cb_setup_simple(type_data,
 						  &mlx5e_block_cb_list,
 						  mlx5e_setup_tc_block_cb,
 						  priv, priv, true);
+	}
 #endif
 	case TC_SETUP_QDISC_MQPRIO:
 		return mlx5e_setup_tc_mqprio(priv, type_data);
-- 
2.21.0


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

* Re: [PATCH net-next v2 0/2] Fixes for unlocked cls hardware offload API refactoring
  2019-08-29 16:15 [PATCH net-next v2 0/2] Fixes for unlocked cls hardware offload API refactoring Vlad Buslov
  2019-08-29 16:15 ` [PATCH net-next v2 1/2] net: sched: cls_matchall: cleanup flow_action before deallocating Vlad Buslov
  2019-08-29 16:15 ` [PATCH net-next v2 2/2] net/mlx5e: Move local var definition into ifdef block Vlad Buslov
@ 2019-08-30 22:12 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-08-30 22:12 UTC (permalink / raw)
  To: vladbu; +Cc: netdev, jhs, xiyou.wangcong, jiri, saeedm, idosch, sergei.shtylyov

From: Vlad Buslov <vladbu@mellanox.com>
Date: Thu, 29 Aug 2019 19:15:15 +0300

> Two fixes for my "Refactor cls hardware offload API to support
> rtnl-independent drivers" series.

Series applied, thanks Vlad.

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

end of thread, other threads:[~2019-08-30 22:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 16:15 [PATCH net-next v2 0/2] Fixes for unlocked cls hardware offload API refactoring Vlad Buslov
2019-08-29 16:15 ` [PATCH net-next v2 1/2] net: sched: cls_matchall: cleanup flow_action before deallocating Vlad Buslov
2019-08-29 16:15 ` [PATCH net-next v2 2/2] net/mlx5e: Move local var definition into ifdef block Vlad Buslov
2019-08-30 22:12 ` [PATCH net-next v2 0/2] Fixes for unlocked cls hardware offload API refactoring David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.