From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Roi Dayan <roid@nvidia.com>,
Vlad Buslov <vladbu@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>
Subject: [net-next 3/7] net/mlx5e: TC, Destroy nic flow counter if exists
Date: Mon, 1 Nov 2021 17:29:10 -0700 [thread overview]
Message-ID: <20211102002914.1052888-4-saeed@kernel.org> (raw)
In-Reply-To: <20211102002914.1052888-1-saeed@kernel.org>
From: Roi Dayan <roid@nvidia.com>
Counter is only added if counter flag exists.
So check the counter fag exists for deleting the counter.
This is the same as in add/del fdb flow.
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 835caa1c7b74..50424998b5c8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -1137,7 +1137,8 @@ static void mlx5e_tc_del_nic_flow(struct mlx5e_priv *priv,
if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR)
mlx5e_detach_mod_hdr(priv, flow);
- mlx5_fc_destroy(priv->mdev, attr->counter);
+ if (attr->action & MLX5_FLOW_CONTEXT_ACTION_COUNT)
+ mlx5_fc_destroy(priv->mdev, attr->counter);
if (flow_flag_test(flow, HAIRPIN))
mlx5e_hairpin_flow_del(priv, flow);
--
2.31.1
next prev parent reply other threads:[~2021-11-02 0:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-02 0:29 [pull request][net-next 0/7] mlx5 updates 2021-11-01 Saeed Mahameed
2021-11-02 0:29 ` [net-next 1/7] net/mlx5e: Support ethtool cq mode Saeed Mahameed
2021-11-02 0:29 ` [net-next 2/7] net/mlx5: Print more info on pci error handlers Saeed Mahameed
2021-11-02 0:29 ` Saeed Mahameed [this message]
2021-11-02 0:29 ` [net-next 4/7] net/mlx5e: TC, Move kfree() calls after destroying all resources Saeed Mahameed
2021-11-02 0:29 ` [net-next 5/7] net/mlx5e: Refactor mod header management API Saeed Mahameed
2021-11-02 0:29 ` [net-next 6/7] net/mlx5: CT: Allow static allocation of mod headers Saeed Mahameed
2021-11-02 0:29 ` [net-next 7/7] net/mlx5e: TC, Remove redundant action stack var Saeed Mahameed
2021-11-02 12:38 ` [pull request][net-next 0/7] mlx5 updates 2021-11-01 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211102002914.1052888-4-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=roid@nvidia.com \
--cc=saeedm@nvidia.com \
--cc=vladbu@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).