Skip to contentSkip to conversation

nfp: copy pci info from pci to ethdev

PATCH Applied Stephen Hemminger 4 participants 4 messages Mar 23, 2016 – Mar 31, 2016 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfp: copy pci info from pci to ethdev

The NFP driver (unlike other PCI devices) was not copying the pci info from the pci_dev to the eth_dev. This would make the driver_name be null (and other unset fields) when application uses dev_info_get.

This was found by code review; do not have the hardware.

---
 drivers/net/nfp/nfp_net.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/nfp/nfp_net.c +2 -0
index 8810704..10ba0ec 100644
@@ -2319,6 +2319,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 		return 0;
 
 	pci_dev = eth_dev->pci_dev;
+	rte_eth_copy_pci_info(eth_dev, pci_dev);
+
 	hw->device_id = pci_dev->id.device_id;
 	hw->vendor_id = pci_dev->id.vendor_id;
 	hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
Signature · 1 line
2.1.4
#1 lore raw
Quoted 8 lines · Stephen Hemminger

The NFP driver (unlike other PCI devices) was not copying the pci info from the pci_dev to the eth_dev. This would make the driver_name be null (and other unset fields) when application uses dev_info_get.

This was found by code review; do not have the hardware.

---

Alejandro,

any review or ack on this patch for nfp driver?

Regards,
/Bruce

#2 lore raw

Hi guys,

Sorry for the delay but I was on a Easter break.

That patch is OK for me. In fact, I had one patch ready for upstreaming with this change needed for supporting hotplug. I was waiting for some feedback from one internal project needing this hotplug functionality before submitting.

Regards

Quoted 16 lines · Bruce Richardson
Quoted 8 lines · Stephen Hemminger

The NFP driver (unlike other PCI devices) was not copying the pci info from the pci_dev to the eth_dev. This would make the driver_name be null (and other unset fields) when application uses dev_info_get.

This was found by code review; do not have the hardware.

---

Alejandro,

any review or ack on this patch for nfp driver?

Regards,
/Bruce

#3 lore raw

2016-03-29 08:16, Alejandro Lucero:

Quoted 8 lines

Hi guys,

Sorry for the delay but I was on a Easter break.

That patch is OK for me. In fact, I had one patch ready for upstreaming with this change needed for supporting hotplug. I was waiting for some feedback from one internal project needing this hotplug functionality before submitting.

[...]

Quoted 8 lines
Quoted 8 lines · Stephen Hemminger
Quoted 7 lines

The NFP driver (unlike other PCI devices) was not copying the pci info from the pci_dev to the eth_dev. This would make the driver_name be null (and other unset fields) when application uses dev_info_get.

This was found by code review; do not have the hardware.

Applied, thanks