Skip to contentSkip to conversation

RDMA/nldev: Add parent bdf to device information dump

PATCH In review Gal Pressman 4 participants 25 messages Nov 3, 2020 – Nov 10, 2020 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/nldev: Add parent bdf to device information dump

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

---
 drivers/infiniband/core/nldev.c  | 10 +++++++++-
 include/uapi/rdma/rdma_netlink.h |  5 +++++
 2 files changed, 14 insertions(+), 1 deletion(-)
drivers/infiniband/core/nldev.c +9 -1
index 12d29d54a081..9704b1449c01 100644
@@ -291,7 +291,15 @@ static int fill_dev_info(struct sk_buff *msg, struct ib_device *device)
 	else if (rdma_protocol_usnic(device, port))
 		ret = nla_put_string(msg, RDMA_NLDEV_ATTR_DEV_PROTOCOL,
 				     "usnic");
-	return ret;
+	if (ret)
+		return ret;
+
+	if (device->dev.parent)
+		if (nla_put_string(msg, RDMA_NLDEV_PARENT_BDF,
+				   dev_name(device->dev.parent)))
+			return -EMSGSIZE;
+
+	return 0;
 }
 
 static int fill_port_info(struct sk_buff *msg,
include/uapi/rdma/rdma_netlink.h +5 -0
index d2f5b8396243..7495104668eb 100644
@@ -533,6 +533,11 @@ enum rdma_nldev_attr {
 
 	RDMA_NLDEV_ATTR_RES_RAW,	/* binary */
 
+	/*
+	 * Parent device BDF (bus, device, function).
+	 */
+	RDMA_NLDEV_PARENT_BDF,			/* string */
+
 	/*
 	 * Always the end
 	 */
Signature · 1 line
2.29.1
#1 lore raw
Quoted 8 lines

From: Gal Pressman <[email protected]>
Sent: Tuesday, November 3, 2020 6:56 PM

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

New netlink attribute addition needs to show an example in the commit message for

$ rdma dev show
or 
$rdma link show 
Whichever applicable.
Quoted 14 lines

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

---
 drivers/infiniband/core/nldev.c  | 10 +++++++++-
include/uapi/rdma/rdma_netlink.h |  5 +++++
 2 files changed, 14 insertions(+), 1 deletion(-)
drivers/infiniband/core/nldev.c +0 -0
index 12d29d54a081..9704b1449c01 100644
@@ -291,7 +291,15 @@ static int fill_dev_info(struct sk_buff *msg, struct
 ib_device *device)

drivers/infiniband/core/nldev.c static int fill_dev_info(struct sk_buff *msg, struct · line 300

Quoted 10 lines
drivers/infiniband/core/nldev.c +5 -1
 	else if (rdma_protocol_usnic(device, port))
 		ret = nla_put_string(msg,
 RDMA_NLDEV_ATTR_DEV_PROTOCOL,
 				     "usnic");
-	return ret;
+	if (ret)
+		return ret;
+
+	if (device->dev.parent)
+		if (nla_put_string(msg, RDMA_NLDEV_PARENT_BDF,

Not everything is PCI, BDF is too pci specific.

So name attribute name should be RDMA_NLDEV_PARENT_DEV and additional one as PARENT_BUS

Quoted 25 lines
drivers/infiniband/core/nldev.c +4 -0
+				   dev_name(device->dev.parent)))
+			return -EMSGSIZE;
+
+	return 0;
 }

static int fill_port_info(struct sk_buff *msg, diff --git
a/include/uapi/rdma/rdma_netlink.h b/include/uapi/rdma/rdma_netlink.h index d2f5b8396243..7495104668eb 100644

include/uapi/rdma/rdma_netlink.h +5 -1
@@ -533,6 +533,11 @@ enum rdma_nldev_attr {
 
 	RDMA_NLDEV_ATTR_RES_RAW,	/* binary */
 
+	/*
+	 * Parent device BDF (bus, device, function).
+	 */
+	RDMA_NLDEV_PARENT_BDF,			/* string */
+
 	/*
 	 * Always the end
 	 */
--

2.29.1

#2 lore raw
In reply to Gal Pressman
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Why? What is the use case?

Jason

maintainer
#3 lore raw
Quoted 7 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

Thanks

Quoted 2 lines

Jason

#4 lore raw
Quoted 10 lines · Leon Romanovsky
Quoted 7 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

Why rdma tool? Because it's more intuitive than sysfs.

#5 lore raw
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

Jason

#6 lore raw
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Similarly to how you can see netdevs bdf through 'ethtool -i' in addition to sysfs, I think it's useful.

#7 lore raw
Quoted 30 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

Quoted 5 lines

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Quoted 2 lines

Similarly to how you can see netdevs bdf through 'ethtool -i' in addition to sysfs, I think it's useful.

bus_info is incredibly old, it predates even the driver core to an time when there really was no other way to get the information.

Jason

#8 lore raw
Quoted 33 lines · Jason Gunthorpe
Quoted 32 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Quoted 7 lines
Quoted 3 lines

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?
I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

#9 lore raw
Quoted 43 lines

From: Gal Pressman <[email protected]>
Sent: Sunday, November 8, 2020 6:34 PM

Quoted 37 lines · Jason Gunthorpe
Quoted 35 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way. I'm not convinced that bdf should be treated differently.

Quoted 5 lines
Quoted 3 lines

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?

Yes. They are coming over auxiliary bus, waiting for the bus and Leon's patchset [2] to be merged.

Quoted 2 lines

I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

Yes. I guess you missed the suggestion given in [1].
Basically adding bus name and device name will generate unique bus+device information. This is generic, not specific to PCI.
RDMA_NLDEV_ATTR_PARENT_DEV_NAME, RDMA_NLDEV_ATTR_PARENT_DEV_BUS_NAME.

[1] https://lore.kernel.org/linux-rdma/[email protected]/T/#ma5f71e14abae23fb67a52ff06e74600ce1489e79
[2] https://lore.kernel.org/linux-rdma/DM6PR11MB28417902253469FC9ABB72F0DDEE0@DM6PR11MB2841.namprd11.prod.outlook.com/T/#m37d9d24903fff0e99e7fec59933d4fe6e6a5162b

#10 lore raw
In reply to Gal Pressman
Quoted 38 lines · Gal Pressman
Quoted 37 lines · Jason Gunthorpe
Quoted 35 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Quoted 5 lines
Quoted 3 lines

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?

Yes, HNS uses non-pci devices

Quoted 2 lines

I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

Jason

maintainer
#11 lore raw
Quoted 45 lines · Jason Gunthorpe
Quoted 38 lines · Gal Pressman
Quoted 37 lines · Jason Gunthorpe
Quoted 35 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Quoted 5 lines
Quoted 3 lines

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?

Quoted 8 lines

Yes, HNS uses non-pci devices

Quoted 2 lines

I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

Can anyone please remind me why are we doing it? What problem do you solve here by adding new nldev attributes?

Thanks

Quoted 2 lines

Jason

#12 lore raw
Quoted 51 lines · Leon Romanovsky
Quoted 50 lines · Jason Gunthorpe
Quoted 38 lines · Gal Pressman
Quoted 37 lines · Jason Gunthorpe
Quoted 35 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Quoted 5 lines
Quoted 3 lines

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?

Yes, HNS uses non-pci devices

Quoted 2 lines

I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

Quoted 6 lines
Quoted 3 lines

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

Can anyone please remind me why are we doing it? What problem do you solve here by adding new nldev attributes?

https://lore.kernel.org/linux-rdma/[email protected]/

maintainer
#13 lore raw
Quoted 53 lines · Gal Pressman
Quoted 51 lines · Leon Romanovsky
Quoted 50 lines · Jason Gunthorpe
Quoted 38 lines · Gal Pressman
Quoted 37 lines · Jason Gunthorpe
Quoted 35 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Quoted 5 lines
Quoted 3 lines

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?

Yes, HNS uses non-pci devices

Quoted 2 lines

I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

Can anyone please remind me why are we doing it? What problem do you solve here by adding new nldev attributes?

https://lore.kernel.org/linux-rdma/[email protected]/

Thanks, but IMHO it doesn't answer on the question about the problem.

#14 lore raw
Quoted 58 lines · Leon Romanovsky
Quoted 57 lines · Gal Pressman
Quoted 55 lines · Leon Romanovsky
Quoted 53 lines · Jason Gunthorpe
Quoted 38 lines · Gal Pressman
Quoted 37 lines · Jason Gunthorpe
Quoted 35 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Quoted 5 lines
Quoted 3 lines

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?

Yes, HNS uses non-pci devices

Quoted 2 lines

I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Can anyone please remind me why are we doing it? What problem do you solve here by adding new nldev attributes?

https://lore.kernel.org/linux-rdma/[email protected]/

Thanks, but IMHO it doesn't answer on the question about the problem.

For example, in an instance with multiple NICs and GPUs, it's common to examine the devices topology and distances, device bdfs are needed for that.

Also, when analyzing dmesg logs the prints contain the ibdev name, which is not always enough when trying to debug the corresponding physical device.

maintainer
#15 lore raw
Quoted 64 lines · Gal Pressman
Quoted 63 lines · Leon Romanovsky
Quoted 61 lines · Gal Pressman
Quoted 51 lines · Leon Romanovsky
Quoted 50 lines · Jason Gunthorpe
Quoted 38 lines · Gal Pressman
Quoted 37 lines · Jason Gunthorpe
Quoted 35 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink
command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Quoted 5 lines
Quoted 3 lines

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?

Yes, HNS uses non-pci devices

Quoted 2 lines

I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

Quoted 6 lines
Quoted 3 lines

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

Can anyone please remind me why are we doing it? What problem do you solve here by adding new nldev attributes?

https://lore.kernel.org/linux-rdma/[email protected]/

Quoted 7 lines
Quoted 1 line

Thanks, but IMHO it doesn't answer on the question about the problem.

For example, in an instance with multiple NICs and GPUs, it's common to examine the devices topology and distances, device bdfs are needed for that.

Also, when analyzing dmesg logs the prints contain the ibdev name, which is not always enough when trying to debug the corresponding physical device.

Gal,

I'm asking which problem will solve new nldev and not why BDF is important. :)

Thanks

#16 lore raw
Quoted 70 lines · Leon Romanovsky
Quoted 69 lines · Gal Pressman
Quoted 58 lines · Leon Romanovsky
Quoted 57 lines · Gal Pressman
Quoted 55 lines · Leon Romanovsky
Quoted 53 lines · Jason Gunthorpe
Quoted 38 lines · Gal Pressman
Quoted 37 lines · Jason Gunthorpe
Quoted 35 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe

On Tue, Nov 03, 2020 at 03:26:27PM +0200, Gal Pressman wrote:
Add the ability to query the device's bdf through rdma tool netlink
command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Quoted 5 lines
Quoted 3 lines

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?

Yes, HNS uses non-pci devices

Quoted 2 lines

I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Can anyone please remind me why are we doing it? What problem do you solve here by adding new nldev attributes?

https://lore.kernel.org/linux-rdma/[email protected]/

Thanks, but IMHO it doesn't answer on the question about the problem.

For example, in an instance with multiple NICs and GPUs, it's common to examine the devices topology and distances, device bdfs are needed for that.

Quoted 6 lines
Quoted 2 lines

Also, when analyzing dmesg logs the prints contain the ibdev name, which is not always enough when trying to debug the corresponding physical device.

Gal,

I'm asking which problem will solve new nldev and not why BDF is important. :)

This patch follows the implementation of other fields in fill_dev_info() such as port index, fw version, node guid, sys image guid, node type, dev protocol, etc, which also exist in sysfs.

You added most of these new nldevs not long ago, so I find your question a bit confusing.. Can you please explain your concerns and why you think bdf is different?

maintainer
#17 lore raw
Quoted 76 lines · Gal Pressman
Quoted 75 lines · Leon Romanovsky
Quoted 64 lines · Gal Pressman
Quoted 63 lines · Leon Romanovsky
Quoted 61 lines · Gal Pressman
Quoted 51 lines · Leon Romanovsky
Quoted 50 lines · Jason Gunthorpe
Quoted 38 lines · Gal Pressman
Quoted 37 lines · Jason Gunthorpe
Quoted 35 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky

On Tue, Nov 03, 2020 at 09:45:22AM -0400, Jason Gunthorpe wrote:
On Tue, Nov 03, 2020 at 03:26:27PM +0200, Gal Pressman wrote:
Add the ability to query the device's bdf through rdma tool netlink
command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Quoted 5 lines
Quoted 3 lines

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?

Yes, HNS uses non-pci devices

Quoted 2 lines

I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

Quoted 6 lines
Quoted 3 lines

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

Can anyone please remind me why are we doing it? What problem do you solve here by adding new nldev attributes?

https://lore.kernel.org/linux-rdma/[email protected]/

Quoted 7 lines
Quoted 1 line

Thanks, but IMHO it doesn't answer on the question about the problem.

For example, in an instance with multiple NICs and GPUs, it's common to examine the devices topology and distances, device bdfs are needed for that.

Also, when analyzing dmesg logs the prints contain the ibdev name, which is not always enough when trying to debug the corresponding physical device.

Gal,

Quoted 8 lines
Quoted 1 line

I'm asking which problem will solve new nldev and not why BDF is important. :)

This patch follows the implementation of other fields in fill_dev_info() such as port index, fw version, node guid, sys image guid, node type, dev protocol, etc, which also exist in sysfs.

You added most of these new nldevs not long ago, so I find your question a bit confusing.. Can you please explain your concerns and why you think bdf is different?

Almost all fields that you mentioned were needed to implement rdma_rename utility that followed systemd internal implementation and/or were used in the rdma-core.

The FW version is clearly an exemption to the above.

So I'm trying to understand the rationale behind BDF and how it will work with different bus variants that we will have. Like Parav said, the IB is connected to auxiliary bus (no BDF) and will have parent with BDF too at the same time.

Thanks

#18 lore raw
Quoted 90 lines · Leon Romanovsky
Quoted 76 lines · Gal Pressman
Quoted 75 lines · Leon Romanovsky
Quoted 64 lines · Gal Pressman
Quoted 63 lines · Leon Romanovsky
Quoted 61 lines · Gal Pressman
Quoted 51 lines · Leon Romanovsky
Quoted 50 lines · Jason Gunthorpe
Quoted 38 lines · Gal Pressman
Quoted 37 lines · Jason Gunthorpe
Quoted 35 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 15 lines · Gal Pressman

On 03/11/2020 15:57, Leon Romanovsky wrote:
On Tue, Nov 03, 2020 at 09:45:22AM -0400, Jason Gunthorpe wrote:
On Tue, Nov 03, 2020 at 03:26:27PM +0200, Gal Pressman wrote:
Add the ability to query the device's bdf through rdma tool netlink
command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the
ibdev and bdf, especially when working with multiple devices.
The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Quoted 5 lines
Quoted 3 lines

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?

Yes, HNS uses non-pci devices

Quoted 2 lines

I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

Quoted 6 lines
Quoted 3 lines

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

Can anyone please remind me why are we doing it? What problem do you solve here by adding new nldev attributes?

https://lore.kernel.org/linux-rdma/[email protected]/

Quoted 7 lines
Quoted 1 line

Thanks, but IMHO it doesn't answer on the question about the problem.

For example, in an instance with multiple NICs and GPUs, it's common to examine the devices topology and distances, device bdfs are needed for that.

Also, when analyzing dmesg logs the prints contain the ibdev name, which is not always enough when trying to debug the corresponding physical device.

Gal,

Quoted 8 lines
Quoted 1 line

I'm asking which problem will solve new nldev and not why BDF is important. :)

This patch follows the implementation of other fields in fill_dev_info() such as port index, fw version, node guid, sys image guid, node type, dev protocol, etc, which also exist in sysfs.

You added most of these new nldevs not long ago, so I find your question a bit confusing.. Can you please explain your concerns and why you think bdf is different?

Almost all fields that you mentioned were needed to implement rdma_rename utility that followed systemd internal implementation and/or were used in the rdma-core.

Quoted 6 lines

The FW version is clearly an exemption to the above.

So I'm trying to understand the rationale behind BDF and how it will work with different bus variants that we will have. Like Parav said, the IB is connected to auxiliary bus (no BDF) and will have parent with BDF too at the same time.

We can review the different cases and make sure it works as expected (and what's expected), but let's first reach an agreement if I should continue with this work or not.

maintainer
#19 lore raw
Quoted 93 lines · Gal Pressman
Quoted 92 lines · Leon Romanovsky
Quoted 76 lines · Gal Pressman
Quoted 75 lines · Leon Romanovsky
Quoted 64 lines · Gal Pressman
Quoted 63 lines · Leon Romanovsky
Quoted 61 lines · Gal Pressman
Quoted 51 lines · Leon Romanovsky
Quoted 50 lines · Jason Gunthorpe
Quoted 38 lines · Gal Pressman
Quoted 37 lines · Jason Gunthorpe
Quoted 35 lines · Gal Pressman
Quoted 28 lines · Jason Gunthorpe

On Tue, Nov 03, 2020 at 04:11:19PM +0200, Gal Pressman wrote:
On 03/11/2020 15:57, Leon Romanovsky wrote:
On Tue, Nov 03, 2020 at 09:45:22AM -0400, Jason Gunthorpe wrote:
On Tue, Nov 03, 2020 at 03:26:27PM +0200, Gal Pressman wrote:
Add the ability to query the device's bdf through rdma tool netlink
command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the
ibdev and bdf, especially when working with multiple devices.
The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Should always be the physical device

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just
the start, you need all the other topology information to make sense
of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Quoted 5 lines
Quoted 3 lines

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?

Yes, HNS uses non-pci devices

Quoted 2 lines

I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

Quoted 6 lines
Quoted 3 lines

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

Can anyone please remind me why are we doing it? What problem do you solve here by adding new nldev attributes?

https://lore.kernel.org/linux-rdma/[email protected]/

Quoted 7 lines
Quoted 1 line

Thanks, but IMHO it doesn't answer on the question about the problem.

For example, in an instance with multiple NICs and GPUs, it's common to examine the devices topology and distances, device bdfs are needed for that.

Also, when analyzing dmesg logs the prints contain the ibdev name, which is not always enough when trying to debug the corresponding physical device.

Gal,

Quoted 8 lines
Quoted 1 line

I'm asking which problem will solve new nldev and not why BDF is important. :)

This patch follows the implementation of other fields in fill_dev_info() such as port index, fw version, node guid, sys image guid, node type, dev protocol, etc, which also exist in sysfs.

You added most of these new nldevs not long ago, so I find your question a bit confusing.. Can you please explain your concerns and why you think bdf is different?

Almost all fields that you mentioned were needed to implement rdma_rename utility that followed systemd internal implementation and/or were used in the rdma-core.

The FW version is clearly an exemption to the above.

Quoted 8 lines
Quoted 4 lines

So I'm trying to understand the rationale behind BDF and how it will work with different bus variants that we will have. Like Parav said, the IB is connected to auxiliary bus (no BDF) and will have parent with BDF too at the same time.

We can review the different cases and make sure it works as expected (and what's expected), but let's first reach an agreement if I should continue with this work or not.

I don't know.

Thanks

#20 lore raw
In reply to Jason Gunthorpe
Quoted 45 lines · Jason Gunthorpe
Quoted 38 lines · Gal Pressman
Quoted 37 lines · Jason Gunthorpe
Quoted 35 lines · Gal Pressman
Quoted 21 lines · Jason Gunthorpe
Quoted 8 lines · Gal Pressman
Quoted 7 lines · Leon Romanovsky
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman

Add the ability to query the device's bdf through rdma tool netlink command (in addition to the sysfs infra).

In case of virtual devices (rxe/siw), the netdev bdf will be shown.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Why? What is the use case?

Right, and why isn't netdev (RDMA_NLDEV_ATTR_NDEV_NAME) enough?

When taking system topology into consideration you need some way to pair the ibdev and bdf, especially when working with multiple devices. The netdev name doesn't exist on devices with no netdevs (IB, EFA).

You are supposed to use sysfs

/sys/class/infiniband/ibp0s9/device

Quoted 7 lines

Should always be the physical device

Quoted 1 line

Why rdma tool? Because it's more intuitive than sysfs.

But we generally don't put this information into netlink BDF is just the start, you need all the other topology information to make sense of it, and all that is in sysfs only already

As the commit message says, it's in addition to the device sysfs.

Many (if not most) of the existing rdma netlink commands are duplicates of some sysfs entries, but show it in a more "modern" way.
I'm not convinced that bdf should be treated differently.

Quoted 5 lines
Quoted 3 lines

Why did you call it BDF anyhow? it has nothing to do with PCI BDF other than it happens to be the PDF for PCI devices. Netdev called this bus_info

Are there non pci devices in the subsystem?

Quoted 8 lines

Yes, HNS uses non-pci devices

Quoted 2 lines

I can rename to a more fitting name, will change to bus_info unless someone has a better idea.

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

This can be solved with Parav's suggestion.

#21 lore raw
Quoted 5 lines · Gal Pressman
Quoted 3 lines

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

This can be solved with Parav's suggestion.

Now you are adding more stuff.

What is wrong with reading sysfs? sysfs is where topology information lives, why do we need to denormalize things?

Jason

#22 lore raw
Quoted 6 lines · Jason Gunthorpe
Quoted 4 lines · Gal Pressman
Quoted 3 lines

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

Quoted 6 lines
Quoted 1 line

This can be solved with Parav's suggestion.

Now you are adding more stuff.

What is wrong with reading sysfs? sysfs is where topology information lives, why do we need to denormalize things?

And yet you have lspci so you don't have to dig through the sysfs files by hand for that topology.
Please drop this patch.

#23 lore raw
Quoted 9 lines · Gal Pressman
Quoted 8 lines · Jason Gunthorpe
Quoted 5 lines · Gal Pressman
Quoted 3 lines

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

This can be solved with Parav's suggestion.

Quoted 8 lines
Quoted 4 lines

Now you are adding more stuff.

What is wrong with reading sysfs? sysfs is where topology information lives, why do we need to denormalize things?

And yet you have lspci so you don't have to dig through the sysfs files by hand for that topology.
Please drop this patch.

If you want to add something to rdma tool it can read sysfs and disply it

Jason

maintainer
#24 lore raw
Quoted 12 lines · Jason Gunthorpe
Quoted 11 lines · Gal Pressman
Quoted 10 lines · Jason Gunthorpe
Quoted 5 lines · Gal Pressman
Quoted 3 lines

The thing is, is is still useless. You have to consult sysfs to understand what bus it is scoped on to do anything further with it. Can't just assume it is PCI.

This can be solved with Parav's suggestion.

Now you are adding more stuff.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

What is wrong with reading sysfs? sysfs is where topology information lives, why do we need to denormalize things?

And yet you have lspci so you don't have to dig through the sysfs files by hand for that topology.
Please drop this patch.

If you want to add something to rdma tool it can read sysfs and disply it

I tried it and it wasn't accepted well in netdev community.

Thanks

Quoted 2 lines

Jason