bus/pci: fix probing for non-netuio bound devices
PATCH 1/1 bus/pci: fix probing for non-netuio bound devices
Implement rte_pci_map_device() to distinguish between the devices bound to netuio and NDIS devices.
Only return success for the netuio devices.
--- drivers/bus/pci/windows/pci.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/bus/pci/windows/pci.c +7 -8
@@ -23,20 +23,19 @@ DEFINE_DEVPROPKEY(DEVPKEY_Device_Numa_Node, 0x540b947e, 0x8b40, 0x45bc,* the registry hive for PCI devices. */ -/* The functions below are not implemented on Windows, +/* Some of the functions below are not implemented on Windows, * but need to be defined for compilation purposes */ /* Map pci device */ int -rte_pci_map_device(struct rte_pci_device *dev __rte_unused) +rte_pci_map_device (struct rte_pci_device *dev) { -/* This function is not implemented on Windows. -* We really should short-circuit the call to these functions by -* clearing the RTE_PCI_DRV_NEED_MAPPING flag -* in the rte_pci_driver flags. -*/ -return 0 ; +/* Only return success for devices bound to netuio */ +if (dev->kdrv ==RTE_PCI_KDRV_NIC_UIO ) +return 0 ; +else +return -EINVAL ; }/* Unmap pci device */
Signature · 1 line
2.18.0.windows.1
Quoted 33 lines
Subject: [PATCH] bus/pci: fix probing for non-netuio bound devices
External email: Use caution opening links or attachments
Implement
rte_pci_map_device()to distinguish between the devices bound to netuio and NDIS devices.
Only return success for the netuio devices.Suggested-by Dmitry Kozlyuk <[email protected]>Signed-off-by Pallavi Kadam <[email protected]>Reviewed-by Ranjit Menon <[email protected]>--- drivers/bus/pci/windows/pci.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)drivers/bus/pci/windows/pci.c +1
-1@@ -23,20 +23,19 @@DEFINE_DEVPROPKEY(DEVPKEY_Device_Numa_Node, 0x540b947e, 0x8b40, 0x45bc, * the registry hive for PCI devices. */ -/* The functions below are not implemented on Windows, +/* Some of the functions below are not implemented on Windows, * but need to be defined for compilation purposes */ /* Map pci device */ int
drivers/bus/pci/windows/pci.c line 36
Quoted 10 lines
drivers/bus/pci/windows/pci.c +2
-7-rte_pci_map_device(struct rte_pci_device *dev __rte_unused) +rte_pci_map_device(struct rte_pci_device *dev) { -/* This function is not implemented on Windows. -* We really should short-circuit the call to these functions by -* clearing the RTE_PCI_DRV_NEED_MAPPING flag -* in the rte_pci_driver flags. -*/ -return 0 ; +/* Only return success for devices bound to netuio */
Maybe extend this comment to mention where the mapping is actually done?
drivers/bus/pci/windows/pci.c DEFINE_DEVPROPKEY(DEVPKEY_Device_Numa_Node, 0x540b947e, 0x8b40, 0x45bc, · line 38
Quoted 4 lines
drivers/bus/pci/windows/pci.c +4
-0+if (dev->kdrv ==RTE_PCI_KDRV_NIC_UIO ) +return 0 ; +else +return -EINVAL ;
The function should return -1 here to match the behavior with other OS implementations.
Quoted 5 lines
drivers/bus/pci/windows/pci.c +0
-0}/* Unmap pci device */
--
2.18.0.windows.1
Quoted 31 lines · Tal Shnaiderman
Quoted 31 lines
Subject: [PATCH] bus/pci: fix probing for non-netuio bound devices
External email: Use caution opening links or attachments
Implement
rte_pci_map_device()to distinguish between the devices bound to netuio and NDIS devices.
Only return success for the netuio devices.Suggested-by Dmitry Kozlyuk <[email protected]>Signed-off-by Pallavi Kadam <[email protected]>Reviewed-by Ranjit Menon <[email protected]>--- drivers/bus/pci/windows/pci.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)drivers/bus/pci/windows/pci.c +1
-1@@ -23,20 +23,19 @@DEFINE_DEVPROPKEY(DEVPKEY_Device_Numa_Node, 0x540b947e, 0x8b40, 0x45bc, * the registry hive for PCI devices. */ -/* The functions below are not implemented on Windows, +/* Some of the functions below are not implemented on Windows, * but need to be defined for compilation purposes */
Quoted 13 lines
drivers/bus/pci/windows/pci.c DEFINE_DEVPROPKEY(DEVPKEY_Device_Numa_Node, 0x540b947e, 0x8b40, 0x45bc, · line 34
Quoted 12 lines
drivers/bus/pci/windows/pci.c +2
-7/* Map pci device */ int -rte_pci_map_device(struct rte_pci_device *dev __rte_unused) +rte_pci_map_device (struct rte_pci_device *dev) { -/* This function is not implemented on Windows. -* We really should short-circuit the call to these functions by -* clearing the RTE_PCI_DRV_NEED_MAPPING flag -* in the rte_pci_driver flags. -*/ -return 0 ; +/* Only return success for devices bound to netuio */ Maybe extend this comment to mention where the mapping is actually done?
Modified the comment in v2.
Quoted 6 lines
drivers/bus/pci/windows/pci.c DEFINE_DEVPROPKEY(DEVPKEY_Device_Numa_Node, 0x540b947e, 0x8b40, 0x45bc, · line 38
Quoted 5 lines
drivers/bus/pci/windows/pci.c +4
-0+if (dev->kdrv ==RTE_PCI_KDRV_NIC_UIO ) +return 0 ; +else +return -EINVAL ;The function should return -1 here to match the behavior with other OS implementations.
Replaced the return value in v2.
Thanks.
Quoted 6 lines
Quoted 6 lines
drivers/bus/pci/windows/pci.c +0
-0}/* Unmap pci device */
--
2.18.0.windows.1
PATCH v2 1/1 bus/pci: fix probing for non-netuio bound devices
In reply to Pallavi KadamImplement rte_pci_map_device() to distinguish between the devices bound to netuio and NDIS devices.
Only return success for the netuio devices.
v2 changes:
- Extended the comment to mention about mapping
- replaced the return errno value with -1
--- drivers/bus/pci/windows/pci.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/bus/pci/windows/pci.c +9 -7
@@ -23,20 +23,22 @@ DEFINE_DEVPROPKEY(DEVPKEY_Device_Numa_Node, 0x540b947e, 0x8b40, 0x45bc,* the registry hive for PCI devices. */ -/* The functions below are not implemented on Windows, +/* Some of the functions below are not implemented on Windows, * but need to be defined for compilation purposes */ /* Map pci device */ int -rte_pci_map_device(struct rte_pci_device *dev __rte_unused) +rte_pci_map_device (struct rte_pci_device *dev) { -/* This function is not implemented on Windows. -* We really should short-circuit the call to these functions by -* clearing the RTE_PCI_DRV_NEED_MAPPING flag -* in the rte_pci_driver flags. +/* Only return success for devices bound to netuio. +* Devices that are bound to netuio are mapped at +* the bus probing stage. */ -return 0 ; +if (dev->kdrv ==RTE_PCI_KDRV_NIC_UIO ) +return 0 ; +else +return -1 ; }/* Unmap pci device */
Signature · 1 line
2.18.0.windows.1
Quoted 55 lines
Subject: [PATCH v2] bus/pci: fix probing for non-netuio bound devices
External email: Use caution opening links or attachments
Implement
rte_pci_map_device()to distinguish between the devices bound to netuio and NDIS devices.
Only return success for the netuio devices.v2 changes:
- Extended the comment to mention about mapping
- replaced the return errno value with -1Suggested-by Dmitry Kozlyuk <[email protected]>Signed-off-by Pallavi Kadam <[email protected]>Reviewed-by Ranjit Menon <[email protected]>--- drivers/bus/pci/windows/pci.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)drivers/bus/pci/windows/pci.c +9
-7@@ -23,20 +23,22 @@DEFINE_DEVPROPKEY(DEVPKEY_Device_Numa_Node, 0x540b947e, 0x8b40, 0x45bc, * the registry hive for PCI devices. */ -/* The functions below are not implemented on Windows, +/* Some of the functions below are not implemented on Windows, * but need to be defined for compilation purposes */ /* Map pci device */ int -rte_pci_map_device(struct rte_pci_device *dev __rte_unused) +rte_pci_map_device (struct rte_pci_device *dev) { -/* This function is not implemented on Windows. -* We really should short-circuit the call to these functions by -* clearing the RTE_PCI_DRV_NEED_MAPPING flag -* in the rte_pci_driver flags. +/* Only return success for devices bound to netuio. +* Devices that are bound to netuio are mapped at +* the bus probing stage. */ -return 0 ; +if (dev->kdrv ==RTE_PCI_KDRV_NIC_UIO ) +return 0 ; +else +return -1 ; }
Quoted 3 lines
/* Unmap pci device */
--
2.18.0.windows.1
Thomas Monjalon
AppliedQuoted 7 lines
Quoted 7 lines
Implement
rte_pci_map_device()to distinguish between the devices bound to netuio and NDIS devices.
Only return success for the netuio devices.v2 changes:
- Extended the comment to mention about mapping
- replaced the return errno value with -1
The changelog should be below the line "---"
so it is skipped when applying the patch.
Missing 'Fixes' tag:
Quoted 5 lines
Quoted 3 lines
Suggested-by Dmitry Kozlyuk <[email protected]>Signed-off-by Pallavi Kadam <[email protected]>Reviewed-by Ranjit Menon <[email protected]>Acked-by Tal Shnaiderman <[email protected]>
Applied, thanks
Quoted 9 lines · Thomas Monjalon
Quoted 7 lines
Quoted 7 lines
Implement
rte_pci_map_device()to distinguish between the devices bound to netuio and NDIS devices.
Only return success for the netuio devices.v2 changes:
- Extended the comment to mention about mapping
- replaced the return errno value with -1The changelog should be below the line "---"
so it is skipped when applying the patch.
Thanks, Thomas. Will keep this in mind.
Quoted 12 lines
Missing 'Fixes' tag:
Fixes c76ec01b4591 ("bus/pci: support netuio on Windows")Quoted 4 lines
Quoted 3 lines
Suggested-by Dmitry Kozlyuk <[email protected]>Signed-off-by Pallavi Kadam <[email protected]>Reviewed-by Ranjit Menon <[email protected]>Acked-by Tal Shnaiderman <[email protected]>Applied, thanks
Quoted 4 lines · Pallavi Kadam
Implement
rte_pci_map_device()to distinguish between the devices bound to netuio and NDIS devices.
Only return success for the netuio devices.
Quoted 8 lines
v2 changes:
- Extended the comment to mention about mapping
- replaced the return errno value with -1Suggested-by Dmitry Kozlyuk <[email protected]>Signed-off-by Pallavi Kadam <[email protected]>Reviewed-by Ranjit Menon <[email protected]>---
drivers/bus/pci/windows/pci.c
Quoted 12 lines · Pallavi Kadam
Implement
rte_pci_map_device()to distinguish between the devices bound to netuio and NDIS devices.
Only return success for the netuio devices.Suggested-by Dmitry Kozlyuk <[email protected]>Signed-off-by Pallavi Kadam <[email protected]>Reviewed-by Ranjit Menon <[email protected]>--- drivers/bus/pci/windows/pci.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)drivers/bus/pci/windows/pci.c +0
-0