All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>,
	RDMA mailing list <linux-rdma@vger.kernel.org>,
	Daniel Jurgens <danielj@mellanox.com>,
	Parav Pandit <parav@mellanox.com>
Subject: [PATCH rdma-next 3/3] IB/core: Do not notify GID change event of an unregistered device
Date: Sun, 20 Oct 2019 09:54:27 +0300	[thread overview]
Message-ID: <20191020065427.8772-4-leon@kernel.org> (raw)
In-Reply-To: <20191020065427.8772-1-leon@kernel.org>

From: Parav Pandit <parav@mellanox.com>

When IB device is undergoing unregistration, GID cache is cleaned up
after all clients are unregistered in below flow.

__ib_unregister_device()
disable_device();
  ib_cache_cleanup_one()
    gid_table_cleanup_one()
      cleanup_gid_table_port()

There is no use of generating a GID change event at such stage, where
there is no active client of the device and device is unregistered
state.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/core/cache.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index b626ca682004..53d8313e8309 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -818,22 +818,16 @@ static void cleanup_gid_table_port(struct ib_device *ib_dev, u8 port,
 				   struct ib_gid_table *table)
 {
 	int i;
-	bool deleted = false;

 	if (!table)
 		return;

 	mutex_lock(&table->lock);
 	for (i = 0; i < table->sz; ++i) {
-		if (is_gid_entry_valid(table->data_vec[i])) {
+		if (is_gid_entry_valid(table->data_vec[i]))
 			del_gid(ib_dev, port, table, i);
-			deleted = true;
-		}
 	}
 	mutex_unlock(&table->lock);
-
-	if (deleted)
-		dispatch_gid_change_event(ib_dev, port);
 }

 void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port,
--
2.20.1


  parent reply	other threads:[~2019-10-20  6:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20  6:54 [PATCH rdma-next 0/3] Let IB core distribute cache update events Leon Romanovsky
2019-10-20  6:54 ` [PATCH rdma-next 1/3] IB/core: " Leon Romanovsky
2019-10-22 19:55   ` Jason Gunthorpe
2019-10-23  5:08     ` Parav Pandit
2019-10-23 17:40       ` Jason Gunthorpe
2019-10-24 19:58         ` Parav Pandit
2019-10-20  6:54 ` [PATCH rdma-next 2/3] IB/core: Cut down single member ib_cache structure Leon Romanovsky
2019-10-20  6:54 ` Leon Romanovsky [this message]
2019-10-22 20:00   ` [PATCH rdma-next 3/3] IB/core: Do not notify GID change event of an unregistered device Jason Gunthorpe

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=20191020065427.8772-4-leon@kernel.org \
    --to=leon@kernel.org \
    --cc=danielj@mellanox.com \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=parav@mellanox.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.