DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] bus/pci: fix probing for non-netuio bound devices
@ 2021-02-10  1:40 Pallavi Kadam
  2021-02-10  6:00 ` Tal Shnaiderman
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Pallavi Kadam @ 2021-02-10  1:40 UTC (permalink / raw)
  To: dev, thomas
  Cc: ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, talshn, 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 <dmitry.kozliuk@gmail.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 drivers/bus/pci/windows/pci.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
index f66258452..16edaa769 100644
--- a/drivers/bus/pci/windows/pci.c
+++ b/drivers/bus/pci/windows/pci.c
@@ -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 */
-- 
2.18.0.windows.1


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

* Re: [dpdk-dev] [PATCH] bus/pci: fix probing for non-netuio bound devices
  2021-02-10  1:40 [dpdk-dev] [PATCH] bus/pci: fix probing for non-netuio bound devices Pallavi Kadam
@ 2021-02-10  6:00 ` Tal Shnaiderman
  2021-02-10 20:47   ` Kadam, Pallavi
  2021-02-10 20:36 ` [dpdk-dev] [PATCH v2] " Pallavi Kadam
  2021-03-05  2:02 ` [dpdk-dev] [PATCH] " Narcisa Ana Maria Vasile
  2 siblings, 1 reply; 9+ messages in thread
From: Tal Shnaiderman @ 2021-02-10  6:00 UTC (permalink / raw)
  To: Pallavi Kadam, dev, NBU-Contact-Thomas Monjalon
  Cc: ranjit.menon, dmitry.kozliuk, Narcisa.Vasile

> 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 <dmitry.kozliuk@gmail.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> ---
>  drivers/bus/pci/windows/pci.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
> index f66258452..16edaa769 100644
> --- a/drivers/bus/pci/windows/pci.c
> +++ b/drivers/bus/pci/windows/pci.c
> @@ -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 */

Maybe extend this comment to mention where the mapping is actually done?

> +       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.

>  }
> 
>  /* Unmap pci device */
> --
> 2.18.0.windows.1


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

* [dpdk-dev] [PATCH v2] bus/pci: fix probing for non-netuio bound devices
  2021-02-10  1:40 [dpdk-dev] [PATCH] bus/pci: fix probing for non-netuio bound devices Pallavi Kadam
  2021-02-10  6:00 ` Tal Shnaiderman
@ 2021-02-10 20:36 ` Pallavi Kadam
  2021-02-11 19:30   ` Tal Shnaiderman
  2021-03-05  2:04   ` Narcisa Ana Maria Vasile
  2021-03-05  2:02 ` [dpdk-dev] [PATCH] " Narcisa Ana Maria Vasile
  2 siblings, 2 replies; 9+ messages in thread
From: Pallavi Kadam @ 2021-02-10 20:36 UTC (permalink / raw)
  To: dev, thomas
  Cc: ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, talshn, 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.

v2 changes:
	- Extended the comment to mention about mapping
	- replaced the return errno value with -1

Suggested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 drivers/bus/pci/windows/pci.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
index f66258452..00e7849b0 100644
--- a/drivers/bus/pci/windows/pci.c
+++ b/drivers/bus/pci/windows/pci.c
@@ -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 */
-- 
2.18.0.windows.1


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

* Re: [dpdk-dev] [PATCH] bus/pci: fix probing for non-netuio bound devices
  2021-02-10  6:00 ` Tal Shnaiderman
@ 2021-02-10 20:47   ` Kadam, Pallavi
  0 siblings, 0 replies; 9+ messages in thread
From: Kadam, Pallavi @ 2021-02-10 20:47 UTC (permalink / raw)
  To: Tal Shnaiderman, dev, NBU-Contact-Thomas Monjalon
  Cc: ranjit.menon, dmitry.kozliuk, Narcisa.Vasile


On 2/9/2021 10:00 PM, Tal Shnaiderman wrote:
>> 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 <dmitry.kozliuk@gmail.com>
>> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
>> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
>> ---
>>   drivers/bus/pci/windows/pci.c | 15 +++++++--------
>>   1 file changed, 7 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
>> index f66258452..16edaa769 100644
>> --- a/drivers/bus/pci/windows/pci.c
>> +++ b/drivers/bus/pci/windows/pci.c
>> @@ -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 */
> Maybe extend this comment to mention where the mapping is actually done?

Modified the comment in v2.

>
>> +       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.

>
>>   }
>>
>>   /* Unmap pci device */
>> --
>> 2.18.0.windows.1

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

* Re: [dpdk-dev] [PATCH v2] bus/pci: fix probing for non-netuio bound devices
  2021-02-10 20:36 ` [dpdk-dev] [PATCH v2] " Pallavi Kadam
@ 2021-02-11 19:30   ` Tal Shnaiderman
  2021-03-16 11:20     ` Thomas Monjalon
  2021-03-05  2:04   ` Narcisa Ana Maria Vasile
  1 sibling, 1 reply; 9+ messages in thread
From: Tal Shnaiderman @ 2021-02-11 19:30 UTC (permalink / raw)
  To: Pallavi Kadam, dev, NBU-Contact-Thomas Monjalon
  Cc: ranjit.menon, dmitry.kozliuk, Narcisa.Vasile

> 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 -1
> 
> Suggested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> ---
>  drivers/bus/pci/windows/pci.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
> index f66258452..00e7849b0 100644
> --- a/drivers/bus/pci/windows/pci.c
> +++ b/drivers/bus/pci/windows/pci.c
> @@ -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 */
> --
> 2.18.0.windows.1

Acked-by: Tal Shnaiderman <talshn@nvidia.com>

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

* Re: [dpdk-dev] [PATCH] bus/pci: fix probing for non-netuio bound devices
  2021-02-10  1:40 [dpdk-dev] [PATCH] bus/pci: fix probing for non-netuio bound devices Pallavi Kadam
  2021-02-10  6:00 ` Tal Shnaiderman
  2021-02-10 20:36 ` [dpdk-dev] [PATCH v2] " Pallavi Kadam
@ 2021-03-05  2:02 ` Narcisa Ana Maria Vasile
  2 siblings, 0 replies; 9+ messages in thread
From: Narcisa Ana Maria Vasile @ 2021-03-05  2:02 UTC (permalink / raw)
  To: Pallavi Kadam
  Cc: dev, thomas, ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, talshn

On Tue, Feb 09, 2021 at 05:40:08PM -0800, Pallavi Kadam wrote:
> 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 <dmitry.kozliuk@gmail.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> ---
>  drivers/bus/pci/windows/pci.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c

Tested-by: Narcisa Vasile <navasile@linux.microsoft.com>
Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>

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

* Re: [dpdk-dev] [PATCH v2] bus/pci: fix probing for non-netuio bound devices
  2021-02-10 20:36 ` [dpdk-dev] [PATCH v2] " Pallavi Kadam
  2021-02-11 19:30   ` Tal Shnaiderman
@ 2021-03-05  2:04   ` Narcisa Ana Maria Vasile
  1 sibling, 0 replies; 9+ messages in thread
From: Narcisa Ana Maria Vasile @ 2021-03-05  2:04 UTC (permalink / raw)
  To: Pallavi Kadam
  Cc: dev, thomas, ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, talshn

On Wed, Feb 10, 2021 at 12:36:54PM -0800, Pallavi Kadam wrote:
> 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
> 
> Suggested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> ---

Tested-by: Narcisa Vasile <navsile@linux.microsoft.com>
Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>

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

* Re: [dpdk-dev] [PATCH v2] bus/pci: fix probing for non-netuio bound devices
  2021-02-11 19:30   ` Tal Shnaiderman
@ 2021-03-16 11:20     ` Thomas Monjalon
  2021-03-17 16:41       ` Kadam, Pallavi
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2021-03-16 11:20 UTC (permalink / raw)
  To: Pallavi Kadam
  Cc: dev, ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, Tal Shnaiderman

> > 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:
Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
Cc: stable@dpdk.org

> > Suggested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
> > Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
> > Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
> 
> Acked-by: Tal Shnaiderman <talshn@nvidia.com>

Applied, thanks



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

* Re: [dpdk-dev] [PATCH v2] bus/pci: fix probing for non-netuio bound devices
  2021-03-16 11:20     ` Thomas Monjalon
@ 2021-03-17 16:41       ` Kadam, Pallavi
  0 siblings, 0 replies; 9+ messages in thread
From: Kadam, Pallavi @ 2021-03-17 16:41 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, Tal Shnaiderman


On 3/16/2021 4:20 AM, Thomas Monjalon wrote:
>>> 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.
Thanks, Thomas. Will keep this in mind.
>
> Missing 'Fixes' tag:
> Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
> Cc: stable@dpdk.org
>
>>> Suggested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
>>> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
>>> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
>> Acked-by: Tal Shnaiderman <talshn@nvidia.com>
> Applied, thanks
>
>

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

end of thread, other threads:[~2021-03-17 16:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10  1:40 [dpdk-dev] [PATCH] bus/pci: fix probing for non-netuio bound devices Pallavi Kadam
2021-02-10  6:00 ` Tal Shnaiderman
2021-02-10 20:47   ` Kadam, Pallavi
2021-02-10 20:36 ` [dpdk-dev] [PATCH v2] " Pallavi Kadam
2021-02-11 19:30   ` Tal Shnaiderman
2021-03-16 11:20     ` Thomas Monjalon
2021-03-17 16:41       ` Kadam, Pallavi
2021-03-05  2:04   ` Narcisa Ana Maria Vasile
2021-03-05  2:02 ` [dpdk-dev] [PATCH] " Narcisa Ana Maria Vasile

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git