diff mbox series

[v1] raw/ifpga: fix ifpga device name format

Message ID 20210422082716.4734-1-wei.huang@intel.com (mailing list archive)
State Rejected
Delegated to: Qi Zhang
Headers show
Series [v1] raw/ifpga: fix ifpga device name format | expand

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot success github build: passed
ci/checkpatch success coding style OK

Commit Message

Wei Huang April 22, 2021, 8:27 a.m. UTC
The device name format used in ifpga_rawdev_create() was changed to
"IFPGA:%02x:%02x.%x", but the format used in ifpga_rawdev_destroy()
was left as "IFPGA:%x:%02x.%x", it should be changed synchronously.

Fixes: 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
Cc: stable@dpdk.org

Signed-off-by: Wei Huang <wei.huang@intel.com>
---
 drivers/raw/ifpga/ifpga_rawdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Xu, Rosen April 22, 2021, 11:13 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Huang, Wei <wei.huang@intel.com>
> Sent: Thursday, April 22, 2021 16:27
> To: dev@dpdk.org; Xu, Rosen <rosen.xu@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Cc: stable@dpdk.org; Zhang, Tianfei <tianfei.zhang@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Huang, Wei <wei.huang@intel.com>
> Subject: [PATCH v1] raw/ifpga: fix ifpga device name format
> 
> The device name format used in ifpga_rawdev_create() was changed to
> "IFPGA:%02x:%02x.%x", but the format used in ifpga_rawdev_destroy() was
> left as "IFPGA:%x:%02x.%x", it should be changed synchronously.
> 
> Fixes: 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Huang <wei.huang@intel.com>
> ---
>  drivers/raw/ifpga/ifpga_rawdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c
> b/drivers/raw/ifpga/ifpga_rawdev.c
> index d9a46ef915..f591a87b49 100644
> --- a/drivers/raw/ifpga/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> @@ -1551,7 +1551,7 @@ ifpga_rawdev_destroy(struct rte_pci_device
> *pci_dev)
>  	}
> 
>  	memset(name, 0, sizeof(name));
> -	snprintf(name, RTE_RAWDEV_NAME_MAX_LEN,
> "IFPGA:%x:%02x.%x",
> +	snprintf(name, RTE_RAWDEV_NAME_MAX_LEN,
> "IFPGA:%02x:%02x.%x",
>  		pci_dev->addr.bus, pci_dev->addr.devid, pci_dev-
> >addr.function);
> 
>  	IFPGA_RAWDEV_PMD_INFO("Closing %s on NUMA node %d",
> --
> 2.29.2

Acked-by: Rosen Xu <rosen.xu@intel.com>
Zhang, Qi Z April 25, 2021, 2:07 a.m. UTC | #2
> -----Original Message-----
> From: Xu, Rosen <rosen.xu@intel.com>
> Sent: Thursday, April 22, 2021 7:13 PM
> To: Huang, Wei <wei.huang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Cc: stable@dpdk.org; Zhang, Tianfei <tianfei.zhang@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>
> Subject: RE: [PATCH v1] raw/ifpga: fix ifpga device name format
> 
> Hi,
> 
> > -----Original Message-----
> > From: Huang, Wei <wei.huang@intel.com>
> > Sent: Thursday, April 22, 2021 16:27
> > To: dev@dpdk.org; Xu, Rosen <rosen.xu@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>
> > Cc: stable@dpdk.org; Zhang, Tianfei <tianfei.zhang@intel.com>; Yigit,
> > Ferruh <ferruh.yigit@intel.com>; Huang, Wei <wei.huang@intel.com>
> > Subject: [PATCH v1] raw/ifpga: fix ifpga device name format
> >
> > The device name format used in ifpga_rawdev_create() was changed to
> > "IFPGA:%02x:%02x.%x", but the format used in ifpga_rawdev_destroy()
> > was left as "IFPGA:%x:%02x.%x", it should be changed synchronously.
> >
> > Fixes: 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Wei Huang <wei.huang@intel.com>
> > ---
> >  drivers/raw/ifpga/ifpga_rawdev.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/raw/ifpga/ifpga_rawdev.c
> > b/drivers/raw/ifpga/ifpga_rawdev.c
> > index d9a46ef915..f591a87b49 100644
> > --- a/drivers/raw/ifpga/ifpga_rawdev.c
> > +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> > @@ -1551,7 +1551,7 @@ ifpga_rawdev_destroy(struct rte_pci_device
> > *pci_dev)
> >  }
> >
> >  memset(name, 0, sizeof(name));
> > -snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%x:%02x.%x",
> > +snprintf(name, RTE_RAWDEV_NAME_MAX_LEN,
> > "IFPGA:%02x:%02x.%x",
> >  pci_dev->addr.bus, pci_dev->addr.devid, pci_dev-
> > >addr.function);
> >
> >  IFPGA_RAWDEV_PMD_INFO("Closing %s on NUMA node %d",
> > --
> > 2.29.2
> 
> Acked-by: Rosen Xu <rosen.xu@intel.com>

Applied to dpdk-next-net-intel

Thanks
Qi
Ferruh Yigit April 28, 2021, 9:26 a.m. UTC | #3
On 4/22/2021 9:27 AM, Wei Huang wrote:
> The device name format used in ifpga_rawdev_create() was changed to
> "IFPGA:%02x:%02x.%x", but the format used in ifpga_rawdev_destroy()
> was left as "IFPGA:%x:%02x.%x", it should be changed synchronously.
> 

Hi Wei,

If the name is significant, why not convert the format into a macro and use it?
This prevents further similar errors, also highlights that format should be
exact same.

> Fixes: 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Huang <wei.huang@intel.com>
> ---
>  drivers/raw/ifpga/ifpga_rawdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
> index d9a46ef915..f591a87b49 100644
> --- a/drivers/raw/ifpga/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> @@ -1551,7 +1551,7 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)
>  	}
>  
>  	memset(name, 0, sizeof(name));
> -	snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%x:%02x.%x",
> +	snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%02x:%02x.%x",
>  		pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function);
>  
>  	IFPGA_RAWDEV_PMD_INFO("Closing %s on NUMA node %d",
>
diff mbox series

Patch

diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index d9a46ef915..f591a87b49 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -1551,7 +1551,7 @@  ifpga_rawdev_destroy(struct rte_pci_device *pci_dev)
 	}
 
 	memset(name, 0, sizeof(name));
-	snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%x:%02x.%x",
+	snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%02x:%02x.%x",
 		pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function);
 
 	IFPGA_RAWDEV_PMD_INFO("Closing %s on NUMA node %d",