From: Saeed Mahameed <saeedm@mellanox.com>
To: Saeed Mahameed <saeedm@mellanox.com>,
Leon Romanovsky <leonro@mellanox.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
Maor Gottlieb <maorg@mellanox.com>,
Mark Bloch <markb@mellanox.com>
Subject: [PATCH mlx5-next 3/5] net/mlx5: Avoid disabling RoCE when uninitialized
Date: Thu, 29 Aug 2019 23:42:34 +0000 [thread overview]
Message-ID: <20190829234151.9958-4-saeedm@mellanox.com> (raw)
In-Reply-To: <20190829234151.9958-1-saeedm@mellanox.com>
From: Maor Gottlieb <maorg@mellanox.com>
Move the check if RoCE steering is initialized to the
disable RoCE function, it will ensure that we disable
RoCE only if we succeeded in enabling it before.
Fixes: 80f09dfc237f ("net/mlx5: Eswitch, enable RoCE loopback traffic")
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/rdma.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c
index 18af6981e0be..0fc7de4aa572 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/rdma.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/rdma.c
@@ -14,9 +14,6 @@ static void mlx5_rdma_disable_roce_steering(struct mlx5_core_dev *dev)
{
struct mlx5_core_roce *roce = &dev->priv.roce;
- if (!roce->ft)
- return;
-
mlx5_del_flow_rules(roce->allow_rule);
mlx5_destroy_flow_group(roce->fg);
mlx5_destroy_flow_table(roce->ft);
@@ -145,6 +142,11 @@ static int mlx5_rdma_add_roce_addr(struct mlx5_core_dev *dev)
void mlx5_rdma_disable_roce(struct mlx5_core_dev *dev)
{
+ struct mlx5_core_roce *roce = &dev->priv.roce;
+
+ if (!roce->ft)
+ return;
+
mlx5_rdma_disable_roce_steering(dev);
mlx5_rdma_del_roce_addr(dev);
mlx5_nic_vport_disable_roce(dev);
--
2.21.0
next prev parent reply other threads:[~2019-08-29 23:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-29 23:42 [PATCH mlx5-next 0/5] Mellanox, mlx5 next updates 2019-09-29 Saeed Mahameed
2019-08-29 23:42 ` [PATCH mlx5-next 1/5] net/mlx5: Move device memory management to mlx5_core Saeed Mahameed
2019-08-29 23:42 ` [PATCH mlx5-next 2/5] net/mlx5: Add HW bits and definitions required for SW steering Saeed Mahameed
2019-08-29 23:42 ` Saeed Mahameed [this message]
2019-08-29 23:42 ` [PATCH mlx5-next 4/5] net/mlx5: Add stub for mlx5_eswitch_mode Saeed Mahameed
2019-08-29 23:42 ` [PATCH mlx5-next 5/5] net/mlx5: Set only stag for match untagged packets Saeed Mahameed
2019-09-02 6:45 ` [PATCH mlx5-next 0/5] Mellanox, mlx5 next updates 2019-09-29 Saeed Mahameed
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=20190829234151.9958-4-saeedm@mellanox.com \
--to=saeedm@mellanox.com \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=maorg@mellanox.com \
--cc=markb@mellanox.com \
--cc=netdev@vger.kernel.org \
/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