[dpdk-dev,v2,3/3] mlx5: handle 32 bit PCI domain

Message ID 20170622155641.25916-4-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Stephen Hemminger June 22, 2017, 3:56 p.m. UTC
  The PCI domain in Azure maybe 32 bits. When device is passed through
the domain is synthesize from the internal GUID.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon June 22, 2017, 4:17 p.m. UTC | #1
22/06/2017 17:56, Stephen Hemminger:
> The PCI domain in Azure maybe 32 bits. When device is passed through
> the domain is synthesize from the internal GUID.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> ---
>  drivers/net/mlx5/mlx5_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Do you want to update other drivers, or should we ask to
PMD maintainers to do the update of their driver?
  
Stephen Hemminger June 22, 2017, 4:41 p.m. UTC | #2
On Thu, 22 Jun 2017 18:17:38 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:

> 22/06/2017 17:56, Stephen Hemminger:
> > The PCI domain in Azure maybe 32 bits. When device is passed through
> > the domain is synthesize from the internal GUID.
> > 
> > Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> > ---
> >  drivers/net/mlx5/mlx5_ethdev.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)  
> 
> Do you want to update other drivers, or should we ask to
> PMD maintainers to do the update of their driver?
> 

Only mlx5 driver used sscanf, others did not do that.
  
Stephen Hemminger June 22, 2017, 4:42 p.m. UTC | #3
On Thu, 22 Jun 2017 18:17:38 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:

> 22/06/2017 17:56, Stephen Hemminger:
> > The PCI domain in Azure maybe 32 bits. When device is passed through
> > the domain is synthesize from the internal GUID.
> > 
> > Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> > ---
> >  drivers/net/mlx5/mlx5_ethdev.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)  
> 
> Do you want to update other drivers, or should we ask to
> PMD maintainers to do the update of their driver?
> 

Looks like mlx4 is only other driver looking for PCI_SLOT_NAME
  
Thomas Monjalon June 22, 2017, 5:04 p.m. UTC | #4
22/06/2017 18:42, Stephen Hemminger:
> On Thu, 22 Jun 2017 18:17:38 +0200
> Thomas Monjalon <thomas@monjalon.net> wrote:
> 
> > 22/06/2017 17:56, Stephen Hemminger:
> > > The PCI domain in Azure maybe 32 bits. When device is passed through
> > > the domain is synthesize from the internal GUID.
> > > 
> > > Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> > > ---
> > >  drivers/net/mlx5/mlx5_ethdev.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)  
> > 
> > Do you want to update other drivers, or should we ask to
> > PMD maintainers to do the update of their driver?
> > 
> 
> Looks like mlx4 is only other driver looking for PCI_SLOT_NAME

Yes the same change must be done for mlx4.
  

Patch

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index eadf452b9e95..6a5733354b2c 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1185,7 +1185,7 @@  mlx5_ibv_device_to_pci_addr(const struct ibv_device *device,
 		/* Extract information. */
 		if (sscanf(line,
 			   "PCI_SLOT_NAME="
-			   "%" SCNx16 ":%" SCNx8 ":%" SCNx8 ".%" SCNx8 "\n",
+			   "%" SCNx32 ":%" SCNx8 ":%" SCNx8 ".%" SCNx8 "\n",
 			   &pci_addr->domain,
 			   &pci_addr->bus,
 			   &pci_addr->devid,