All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-tcp: Use __dev_get_by_name instead dev_get_by_name for OPT_HOST_IFACE
@ 2021-06-18 13:39 Prabhakar Kushwaha
  2021-06-18 13:42 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Prabhakar Kushwaha @ 2021-06-18 13:39 UTC (permalink / raw)
  To: linux-nvme, sagi, hch, kbusch, axboe, martin.belanger
  Cc: aelior, okulkarni, pkushwaha, smalin, prabhakar.pkin, malin1024

dev_get_by_name() finds network device by name but it also increases
reference count.
Increasing the ref count,
If nvme-tcp queue is present and the network device driver is removed
before nvme_tcp, we will face the following continuous log:
  "kernel:unregister_netdevice: waiting for <eth> to become
  free. Usage count = 2"
And rmmod further halts. Similar case arises during reboot/shutdown
with nvme-tcp queue present and both never completes.

As a fix we will use __dev_get_by_name() which find network device by
name without increasing any reference counter.

Signed-off-by: Omkar Kulkarni <okulkarni@marvell.com>
Signed-off-by: Shai Malin <smalin@marvell.com>
Signed-off-by: Prabhakar Kushwaha <pkushwaha@marvell.com>
---
 drivers/nvme/host/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index c7bd37103cf4..f9b527e71c13 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2533,7 +2533,7 @@ static struct nvme_ctrl *nvme_tcp_create_ctrl(struct device *dev,
 	}
 
 	if (opts->mask & NVMF_OPT_HOST_IFACE) {
-		ctrl->ndev = dev_get_by_name(&init_net, opts->host_iface);
+		ctrl->ndev = __dev_get_by_name(&init_net, opts->host_iface);
 		if (!ctrl->ndev) {
 			pr_err("invalid interface passed: %s\n",
 			       opts->host_iface);
-- 
2.30.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

end of thread, other threads:[~2021-07-12  5:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 13:39 [PATCH] nvme-tcp: Use __dev_get_by_name instead dev_get_by_name for OPT_HOST_IFACE Prabhakar Kushwaha
2021-06-18 13:42 ` Christoph Hellwig
2021-06-18 19:14   ` Sagi Grimberg
2021-06-21  1:43     ` Prabhakar Kushwaha
2021-06-23 17:19       ` Belanger, Martin
2021-06-23 21:34 ` Sagi Grimberg
2021-06-24  6:35 ` Christoph Hellwig
2021-07-11 13:17   ` Prabhakar Kushwaha
2021-07-12  5:30     ` Christoph Hellwig

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.