net/bnxt: rename a member to avoid conflict

Message ID 20210311233033.67152-1-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series net/bnxt: rename a member to avoid conflict |

Checks

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

Commit Message

Ajit Khaparde March 11, 2021, 11:30 p.m. UTC
  Address build issues with Clang and without glibc on ppc64le.
Vector can be a keyword and should not be used in code.
Renaming it to avoid conflict.

Reported-by: Piotr Kubaj <pkubaj@FreeBSD.org>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_irq.c | 2 +-
 drivers/net/bnxt/bnxt_irq.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Ajit Khaparde March 11, 2021, 11:59 p.m. UTC | #1
On Thu, Mar 11, 2021 at 3:30 PM Ajit Khaparde
<ajit.khaparde@broadcom.com> wrote:
>
> Address build issues with Clang and without glibc on ppc64le.
> Vector can be a keyword and should not be used in code.
> Renaming it to avoid conflict.
>
> Reported-by: Piotr Kubaj <pkubaj@FreeBSD.org>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Patch applied to dpdk-next-net-brcm. Thanks

> ---
>  drivers/net/bnxt/bnxt_irq.c | 2 +-
>  drivers/net/bnxt/bnxt_irq.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
> index a29ac28590..8abbadb3d1 100644
> --- a/drivers/net/bnxt/bnxt_irq.c
> +++ b/drivers/net/bnxt/bnxt_irq.c
> @@ -151,7 +151,7 @@ int bnxt_setup_int(struct bnxt *bp)
>                                  sizeof(struct bnxt_irq), 0);
>         if (bp->irq_tbl) {
>                 for (i = 0; i < total_vecs; i++) {
> -                       bp->irq_tbl[i].vector = i;
> +                       bp->irq_tbl[i].vector_idx = i;
>                         snprintf(bp->irq_tbl[i].name, len,
>                                  "%s-%d", bp->eth_dev->device->name, i);
>                         bp->irq_tbl[i].handler = bnxt_int_handler;
> diff --git a/drivers/net/bnxt/bnxt_irq.h b/drivers/net/bnxt/bnxt_irq.h
> index 7b02f30973..53d9198858 100644
> --- a/drivers/net/bnxt/bnxt_irq.h
> +++ b/drivers/net/bnxt/bnxt_irq.h
> @@ -8,7 +8,7 @@
>
>  struct bnxt_irq {
>         rte_intr_callback_fn    handler;
> -       unsigned int            vector;
> +       unsigned int            vector_idx;
>         uint8_t                 requested;
>         char                    name[RTE_ETH_NAME_MAX_LEN + 2];
>  };
> --
> 2.21.1 (Apple Git-122.3)
>
  
Piotr Kubaj March 12, 2021, 12:33 a.m. UTC | #2
I may have been unclear.

This affects ppc64le overall.

The reason is that vector is a keyword on ppc64(le).
For some reason, GCC does not have an issue with it, but some future version might.
So the current issues happen when using clang (with glibc or not).

The issue that happens when attempting to build without glibc is about the lack of function to read TBR on other libc's.
This issue is resolved further in the code and does not affect bnxt.

On 21-03-11 15:30:33, Ajit Khaparde wrote:
> Address build issues with Clang and without glibc on ppc64le.
> Vector can be a keyword and should not be used in code.
> Renaming it to avoid conflict.
> 
> Reported-by: Piotr Kubaj <pkubaj@FreeBSD.org>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_irq.c | 2 +-
>  drivers/net/bnxt/bnxt_irq.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
> index a29ac28590..8abbadb3d1 100644
> --- a/drivers/net/bnxt/bnxt_irq.c
> +++ b/drivers/net/bnxt/bnxt_irq.c
> @@ -151,7 +151,7 @@ int bnxt_setup_int(struct bnxt *bp)
>  				 sizeof(struct bnxt_irq), 0);
>  	if (bp->irq_tbl) {
>  		for (i = 0; i < total_vecs; i++) {
> -			bp->irq_tbl[i].vector = i;
> +			bp->irq_tbl[i].vector_idx = i;
>  			snprintf(bp->irq_tbl[i].name, len,
>  				 "%s-%d", bp->eth_dev->device->name, i);
>  			bp->irq_tbl[i].handler = bnxt_int_handler;
> diff --git a/drivers/net/bnxt/bnxt_irq.h b/drivers/net/bnxt/bnxt_irq.h
> index 7b02f30973..53d9198858 100644
> --- a/drivers/net/bnxt/bnxt_irq.h
> +++ b/drivers/net/bnxt/bnxt_irq.h
> @@ -8,7 +8,7 @@
>  
>  struct bnxt_irq {
>  	rte_intr_callback_fn	handler;
> -	unsigned int		vector;
> +	unsigned int		vector_idx;
>  	uint8_t			requested;
>  	char			name[RTE_ETH_NAME_MAX_LEN + 2];
>  };
> -- 
> 2.21.1 (Apple Git-122.3)
>
  

Patch

diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index a29ac28590..8abbadb3d1 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -151,7 +151,7 @@  int bnxt_setup_int(struct bnxt *bp)
 				 sizeof(struct bnxt_irq), 0);
 	if (bp->irq_tbl) {
 		for (i = 0; i < total_vecs; i++) {
-			bp->irq_tbl[i].vector = i;
+			bp->irq_tbl[i].vector_idx = i;
 			snprintf(bp->irq_tbl[i].name, len,
 				 "%s-%d", bp->eth_dev->device->name, i);
 			bp->irq_tbl[i].handler = bnxt_int_handler;
diff --git a/drivers/net/bnxt/bnxt_irq.h b/drivers/net/bnxt/bnxt_irq.h
index 7b02f30973..53d9198858 100644
--- a/drivers/net/bnxt/bnxt_irq.h
+++ b/drivers/net/bnxt/bnxt_irq.h
@@ -8,7 +8,7 @@ 
 
 struct bnxt_irq {
 	rte_intr_callback_fn	handler;
-	unsigned int		vector;
+	unsigned int		vector_idx;
 	uint8_t			requested;
 	char			name[RTE_ETH_NAME_MAX_LEN + 2];
 };