All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>, Jakub Kicinski <kuba@kernel.org>
Cc: Patrisious Haddad <phaddad@nvidia.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	linux-rdma@vger.kernel.org, Maor Gottlieb <maorg@nvidia.com>,
	Mark Zhang <markzhang@nvidia.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Raed Salem <raeds@nvidia.com>, Saeed Mahameed <saeedm@nvidia.com>
Subject: [PATCH mlx5-next 13/14] IB/core: Reorder GID delete code for RoCE
Date: Mon,  7 Aug 2023 13:44:22 +0300	[thread overview]
Message-ID: <fad6f58dfe3e9041cb522c8422a72ee8867def7a.1691403485.git.leon@kernel.org> (raw)
In-Reply-To: <cover.1691403485.git.leon@kernel.org>

From: Patrisious Haddad <phaddad@nvidia.com>

Reorder GID delete code so that the driver del_gid operation is executed
before nullifying the gid attribute ndev parameter, this allows drivers
to access the ndev during their gid delete operation, which makes more
sense since they had access to it during the gid addition operation.

Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/infiniband/core/cache.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index 2e91d8879326..73f913cbd146 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -400,6 +400,9 @@ static void del_gid(struct ib_device *ib_dev, u32 port,
 		table->data_vec[ix] = NULL;
 	write_unlock_irq(&table->rwlock);
 
+	if (rdma_cap_roce_gid_table(ib_dev, port))
+		ib_dev->ops.del_gid(&entry->attr, &entry->context);
+
 	ndev_storage = entry->ndev_storage;
 	if (ndev_storage) {
 		entry->ndev_storage = NULL;
@@ -407,9 +410,6 @@ static void del_gid(struct ib_device *ib_dev, u32 port,
 		call_rcu(&ndev_storage->rcu_head, put_gid_ndev);
 	}
 
-	if (rdma_cap_roce_gid_table(ib_dev, port))
-		ib_dev->ops.del_gid(&entry->attr, &entry->context);
-
 	put_gid_entry_locked(entry);
 }
 
-- 
2.41.0


  parent reply	other threads:[~2023-08-07 10:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 10:44 [PATCH mlx5-next 00/14] mlx5 MACsec RoCEv2 support Leon Romanovsky
2023-08-07 10:44 ` [PATCH mlx5-next 01/14] macsec: add functions to get MACsec real netdevice and check offload Leon Romanovsky
2023-08-07 10:44 ` [PATCH mlx5-next 02/14] net/mlx5e: Move MACsec flow steering operations to be used as core library Leon Romanovsky
2023-08-07 10:44 ` [PATCH mlx5-next 03/14] net/mlx5: Remove dependency of macsec flow steering on ethernet Leon Romanovsky
2023-08-07 10:44 ` [PATCH mlx5-next 04/14] net/mlx5e: Rename MACsec flow steering functions/parameters to suit core naming style Leon Romanovsky
2023-08-07 10:44 ` [PATCH mlx5-next 05/14] net/mlx5e: Move MACsec flow steering and statistics database from ethernet to core Leon Romanovsky
2023-08-07 10:44 ` [PATCH mlx5-next 06/14] net/mlx5: Remove netdevice from MACsec steering Leon Romanovsky
2023-08-07 10:44 ` [PATCH mlx5-next 07/14] net/mlx5: Maintain fs_id xarray per MACsec device inside macsec steering Leon Romanovsky
2023-08-07 10:44 ` [PATCH mlx5-next 08/14] net/mlx5: Add MACsec priorities in RDMA namespaces Leon Romanovsky
2023-08-07 10:44 ` [PATCH mlx5-next 09/14] net/mlx5: Configure MACsec steering for egress RoCEv2 traffic Leon Romanovsky
2023-08-08 15:18   ` Simon Horman
2023-08-08 17:41     ` Leon Romanovsky
2023-08-07 10:44 ` [PATCH mlx5-next 10/14] net/mlx5: Configure MACsec steering for ingress " Leon Romanovsky
2023-08-07 10:44 ` [PATCH mlx5-next 11/14] net/mlx5: Add RoCE MACsec steering infrastructure in core Leon Romanovsky
2023-08-07 10:44 ` [PATCH mlx5-next 12/14] RDMA/mlx5: Implement MACsec gid addition and deletion Leon Romanovsky
2023-08-07 10:44 ` Leon Romanovsky [this message]
2023-08-07 10:44 ` [PATCH mlx5-next 14/14] RDMA/mlx5: Handles RoCE MACsec steering rules " Leon Romanovsky

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=fad6f58dfe3e9041cb522c8422a72ee8867def7a.1691403485.git.leon@kernel.org \
    --to=leon@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jgg@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maorg@nvidia.com \
    --cc=markzhang@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=phaddad@nvidia.com \
    --cc=raeds@nvidia.com \
    --cc=saeedm@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 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.