Linux PCI Non-Transparent Bridge framework and drivers
 help / color / mirror / Atom feed
* [PATCH] ntb_netdev: set the net_device's parent
@ 2017-06-05 20:00 Logan Gunthorpe
  2017-06-05 20:00 ` [PATCH] ntb_transport: fix qp count bug Logan Gunthorpe
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Logan Gunthorpe @ 2017-06-05 20:00 UTC (permalink / raw)
  To: linux-ntb; +Cc: Logan Gunthorpe, Jon Mason, Dave Jiang, Allen Hubbe

At present, ntb_netdev devices end up under /sys/devices/virtual/net
completely unconnected to the ntb trees below them. This patch sets the
parent of the net_device (using SET_NETDEV_DEV) to the client_dev
device. This results in a better connected sysfs path for the network
device:

/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.1/0000:03:00.1/ntb_netdev0/net/eth2

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Cc: Jon Mason <jdmason@kudzu.us>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Allen Hubbe <Allen.Hubbe@emc.com>
---
 drivers/net/ntb_netdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c
index 4daf3d0926a8..0250aa9ae2cb 100644
--- a/drivers/net/ntb_netdev.c
+++ b/drivers/net/ntb_netdev.c
@@ -418,6 +418,8 @@ static int ntb_netdev_probe(struct device *client_dev)
 	if (!ndev)
 		return -ENOMEM;
 
+	SET_NETDEV_DEV(ndev, client_dev);
+
 	dev = netdev_priv(ndev);
 	dev->ndev = ndev;
 	dev->pdev = pdev;
-- 
2.11.0


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

end of thread, other threads:[~2017-06-09 22:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-05 20:00 [PATCH] ntb_netdev: set the net_device's parent Logan Gunthorpe
2017-06-05 20:00 ` [PATCH] ntb_transport: fix qp count bug Logan Gunthorpe
2017-06-06 13:08   ` Allen Hubbe
2017-06-09 21:09     ` Jon Mason
2017-06-05 20:00 ` [PATCH] ntb_transport: fix bug calculating num_qps_mw Logan Gunthorpe
2017-06-06 13:08   ` Allen Hubbe
2017-06-09 21:09     ` Jon Mason
2017-06-06 13:08 ` [PATCH] ntb_netdev: set the net_device's parent Allen Hubbe
2017-06-09 21:12   ` Jon Mason
2017-06-09 21:51     ` Logan Gunthorpe
2017-06-09 21:56       ` Jon Mason
2017-06-09 22:51         ` Logan Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox