All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib/lib_eal:add mellanox kernel driver type
@ 2017-08-23  2:48 Rongqiang XIE
  2017-08-23  8:04 ` Gaëtan Rivet
  0 siblings, 1 reply; 4+ messages in thread
From: Rongqiang XIE @ 2017-08-23  2:48 UTC (permalink / raw)
  To: bruce.richardson; +Cc: dev, Rongqiang XIE

When use bond function in mellanox driver environment, we call the
find_port_id_by_pci_addr() function,if we don't add mellanox kernel
driver type in enum rte_kernel_driver, the function will return -1
because kdrv unknown, so we add the mellanox driver type, and when
scan the pci, fill the kdrv to fix this problem.

Signed-off-by: Rongqiang XIE <xie.rongqiang@zte.com.cn>
---
 lib/librte_eal/common/include/rte_dev.h | 2 ++
 lib/librte_eal/linuxapp/eal/eal_pci.c   | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index 5386d3a..067ad07 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -123,6 +123,8 @@ enum rte_kernel_driver {
 	RTE_KDRV_VFIO,
 	RTE_KDRV_UIO_GENERIC,
 	RTE_KDRV_NIC_UIO,
+	RTE_KDRV_MLX4,
+	RTE_KDRV_MLX5,
 	RTE_KDRV_NONE,
 };
 
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 8951ce7..31c8ec1 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -349,6 +349,10 @@
 			dev->kdrv = RTE_KDRV_IGB_UIO;
 		else if (!strcmp(driver, "uio_pci_generic"))
 			dev->kdrv = RTE_KDRV_UIO_GENERIC;
+		else if (!strcmp(driver, "mlx4_core"))
+			dev->kdrv = RTE_KDRV_MLX4;
+		else if (!strcmp(driver, "mlx5_core"))
+			dev->kdrv = RTE_KDRV_MLX5;
 		else
 			dev->kdrv = RTE_KDRV_UNKNOWN;
 	} else
-- 
1.8.3.1

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

* Re: [PATCH] lib/lib_eal:add mellanox kernel driver type
  2017-08-23  2:48 [PATCH] lib/lib_eal:add mellanox kernel driver type Rongqiang XIE
@ 2017-08-23  8:04 ` Gaëtan Rivet
  2017-10-09 17:27   ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Gaëtan Rivet @ 2017-08-23  8:04 UTC (permalink / raw)
  To: Rongqiang XIE; +Cc: bruce.richardson, dev

Hi,

On Wed, Aug 23, 2017 at 10:48:01AM +0800, Rongqiang XIE wrote:
> When use bond function in mellanox driver environment, we call the
> find_port_id_by_pci_addr() function,if we don't add mellanox kernel
> driver type in enum rte_kernel_driver, the function will return -1
> because kdrv unknown, so we add the mellanox driver type, and when
> scan the pci, fill the kdrv to fix this problem.
> 

The issue is not that MLX devices are not properly represented, but
that the find_port_id_by_pci_addr function has a crappy way to recognize
PCI devices.

The find_device bus operator should be used to find a device having
a specific rte_pci_addr. I described something similar not too long
ago[1]. This matching function would benefit from being properly
rewritten.

[1]: http://dpdk.org/ml/archives/dev/2017-July/072172.html

> Signed-off-by: Rongqiang XIE <xie.rongqiang@zte.com.cn>
> ---
>  lib/librte_eal/common/include/rte_dev.h | 2 ++
>  lib/librte_eal/linuxapp/eal/eal_pci.c   | 4 ++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
> index 5386d3a..067ad07 100644
> --- a/lib/librte_eal/common/include/rte_dev.h
> +++ b/lib/librte_eal/common/include/rte_dev.h
> @@ -123,6 +123,8 @@ enum rte_kernel_driver {
>  	RTE_KDRV_VFIO,
>  	RTE_KDRV_UIO_GENERIC,
>  	RTE_KDRV_NIC_UIO,
> +	RTE_KDRV_MLX4,
> +	RTE_KDRV_MLX5,
>  	RTE_KDRV_NONE,
>  };
>  
> diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
> index 8951ce7..31c8ec1 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_pci.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
> @@ -349,6 +349,10 @@
>  			dev->kdrv = RTE_KDRV_IGB_UIO;
>  		else if (!strcmp(driver, "uio_pci_generic"))
>  			dev->kdrv = RTE_KDRV_UIO_GENERIC;
> +		else if (!strcmp(driver, "mlx4_core"))
> +			dev->kdrv = RTE_KDRV_MLX4;
> +		else if (!strcmp(driver, "mlx5_core"))
> +			dev->kdrv = RTE_KDRV_MLX5;
>  		else
>  			dev->kdrv = RTE_KDRV_UNKNOWN;
>  	} else
> -- 
> 1.8.3.1
> 
> 

-- 
Gaëtan Rivet
6WIND

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

* Re: [PATCH] lib/lib_eal:add mellanox kernel driver type
  2017-08-23  8:04 ` Gaëtan Rivet
@ 2017-10-09 17:27   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2017-10-09 17:27 UTC (permalink / raw)
  To: Rongqiang XIE; +Cc: dev, Gaëtan Rivet, bruce.richardson

23/08/2017 10:04, Gaëtan Rivet:
> Hi,
> 
> On Wed, Aug 23, 2017 at 10:48:01AM +0800, Rongqiang XIE wrote:
> > When use bond function in mellanox driver environment, we call the
> > find_port_id_by_pci_addr() function,if we don't add mellanox kernel
> > driver type in enum rte_kernel_driver, the function will return -1
> > because kdrv unknown, so we add the mellanox driver type, and when
> > scan the pci, fill the kdrv to fix this problem.
> > 
> 
> The issue is not that MLX devices are not properly represented, but
> that the find_port_id_by_pci_addr function has a crappy way to recognize
> PCI devices.
> 
> The find_device bus operator should be used to find a device having
> a specific rte_pci_addr. I described something similar not too long
> ago[1]. This matching function would benefit from being properly
> rewritten.
> 
> [1]: http://dpdk.org/ml/archives/dev/2017-July/072172.html
> 
> > Signed-off-by: Rongqiang XIE <xie.rongqiang@zte.com.cn>

This issue has been fixed as a result of the thread which
Gaetan is referencing:
	http://dpdk.org/browse/dpdk/commit/?id=c848b518bb

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

* [PATCH] lib/lib_eal:add mellanox kernel driver type
@ 2017-08-23  1:57 Rongqiang XIE
  0 siblings, 0 replies; 4+ messages in thread
From: Rongqiang XIE @ 2017-08-23  1:57 UTC (permalink / raw)
  To: bruce.richardson; +Cc: dev, Rongqiang XIE

When use bond function in mellanox driver environment, we call the
find_port_id_by_pci_addr() function,if we don't add mellanox kernel
driver type in enum rte_kernel_driver, the function will return -1
because kdrv unknow, so we add the mellanox driver type, and when
scan the pci, fill the kdrv to fix this problem.

Signed-off-by: Rongqiang XIE <xie.rongqiang@zte.com.cn>
---
 lib/librte_eal/common/include/rte_dev.h | 2 ++
 lib/librte_eal/linuxapp/eal/eal_pci.c   | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index 5386d3a..067ad07 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -123,6 +123,8 @@ enum rte_kernel_driver {
 	RTE_KDRV_VFIO,
 	RTE_KDRV_UIO_GENERIC,
 	RTE_KDRV_NIC_UIO,
+	RTE_KDRV_MLX4,
+	RTE_KDRV_MLX5,
 	RTE_KDRV_NONE,
 };
 
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 8951ce7..31c8ec1 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -349,6 +349,10 @@
 			dev->kdrv = RTE_KDRV_IGB_UIO;
 		else if (!strcmp(driver, "uio_pci_generic"))
 			dev->kdrv = RTE_KDRV_UIO_GENERIC;
+		else if (!strcmp(driver, "mlx4_core"))
+			dev->kdrv = RTE_KDRV_MLX4;
+		else if (!strcmp(driver, "mlx5_core"))
+			dev->kdrv = RTE_KDRV_MLX5;
 		else
 			dev->kdrv = RTE_KDRV_UNKNOWN;
 	} else
-- 
1.8.3.1

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

end of thread, other threads:[~2017-10-09 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23  2:48 [PATCH] lib/lib_eal:add mellanox kernel driver type Rongqiang XIE
2017-08-23  8:04 ` Gaëtan Rivet
2017-10-09 17:27   ` Thomas Monjalon
  -- strict thread matches above, loose matches on Subject: below --
2017-08-23  1:57 Rongqiang XIE

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.