net/bnxt: fix variable size of port id

Message ID 20200804174147.64473-1-chenbo.xia@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ajit Khaparde
Headers
Series net/bnxt: fix variable size of port id |

Checks

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

Commit Message

Chenbo Xia Aug. 4, 2020, 5:41 p.m. UTC
  Currenly the variable size of ethdev port id is 8 bits. This
patch standarizes it to 16 bits.

Fixes: 769de16872ab ("net/bnxt: fix port default rule create/destroy")
Cc: stable@dpdk.org

Reported-by: Yinan Wang <yinan.wang@intel.com>
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Stephen Hemminger Aug. 4, 2020, 4:22 p.m. UTC | #1
On Tue,  4 Aug 2020 17:41:47 +0000
Chenbo Xia <chenbo.xia@intel.com> wrote:

> Currenly the variable size of ethdev port id is 8 bits. This
> patch standarizes it to 16 bits.
> 
> Fixes: 769de16872ab ("net/bnxt: fix port default rule create/destroy")
> Cc: stable@dpdk.org
> 
> Reported-by: Yinan Wang <yinan.wang@intel.com>
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
	    BNXT_ETH_DEV_IS_REPRESENTOR(bp->eth_dev))

Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  
Thomas Monjalon Aug. 5, 2020, 8:18 p.m. UTC | #2
04/08/2020 19:41, Chenbo Xia:
> Currenly the variable size of ethdev port id is 8 bits. This
> patch standarizes it to 16 bits.
> 
> Fixes: 769de16872ab ("net/bnxt: fix port default rule create/destroy")
> Cc: stable@dpdk.org
> 
> Reported-by: Yinan Wang <yinan.wang@intel.com>
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
>  drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> index 9fb1a028f..ff5aed3d7 100644
> --- a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> +++ b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> @@ -397,7 +397,7 @@ void
>  bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)
>  {
>  	struct bnxt_ulp_df_rule_info *info;
> -	uint8_t port_id;
> +	uint16_t port_id;

There are more occurences in bnxt, introduced by the same patch.

In general, in other drivers, it would be good to make this clean-up.
	git grep 'uint8_t port' | wc -l
	297
  
Chenbo Xia Aug. 6, 2020, 2:03 a.m. UTC | #3
Hi Thomas,

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Thursday, August 6, 2020 4:18 AM
> To: Xia, Chenbo <chenbo.xia@intel.com>; Wang, Yinan <yinan.wang@intel.com>
> Cc: dev@dpdk.org; ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com;
> kishore.padmanabha@broadcom.com; venkatkumar.duvvuru@broadcom.com;
> stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/bnxt: fix variable size of port id
> 
> 04/08/2020 19:41, Chenbo Xia:
> > Currenly the variable size of ethdev port id is 8 bits. This
> > patch standarizes it to 16 bits.
> >
> > Fixes: 769de16872ab ("net/bnxt: fix port default rule create/destroy")
> > Cc: stable@dpdk.org
> >
> > Reported-by: Yinan Wang <yinan.wang@intel.com>
> > Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> > ---
> >  drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> > index 9fb1a028f..ff5aed3d7 100644
> > --- a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> > +++ b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> > @@ -397,7 +397,7 @@ void
> >  bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)
> >  {
> >  	struct bnxt_ulp_df_rule_info *info;
> > -	uint8_t port_id;
> > +	uint16_t port_id;
> 
> There are more occurences in bnxt, introduced by the same patch.
> 
> In general, in other drivers, it would be good to make this clean-up.

Sure, I could do the clean-up. Btw, only net drivers, right?

> 	git grep 'uint8_t port' | wc -l
> 	297
>
  
Thomas Monjalon Aug. 6, 2020, 7:57 a.m. UTC | #4
06/08/2020 04:03, Xia, Chenbo:
> Hi Thomas,
> 
> From: Thomas Monjalon <thomas@monjalon.net>
> > 04/08/2020 19:41, Chenbo Xia:
> > > Currenly the variable size of ethdev port id is 8 bits. This
> > > patch standarizes it to 16 bits.
> > >
> > > Fixes: 769de16872ab ("net/bnxt: fix port default rule create/destroy")
> > > Cc: stable@dpdk.org
> > >
> > > Reported-by: Yinan Wang <yinan.wang@intel.com>
> > > Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> > > ---
> > >  drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> > b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> > > index 9fb1a028f..ff5aed3d7 100644
> > > --- a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> > > +++ b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> > > @@ -397,7 +397,7 @@ void
> > >  bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)
> > >  {
> > >  	struct bnxt_ulp_df_rule_info *info;
> > > -	uint8_t port_id;
> > > +	uint16_t port_id;
> > 
> > There are more occurences in bnxt, introduced by the same patch.
> > 
> > In general, in other drivers, it would be good to make this clean-up.
> 
> Sure, I could do the clean-up. Btw, only net drivers, right?

ethdev drivers and applications referencing a port id should
use uint16_t, yes.
  
Xiao, QimaiX Sept. 3, 2020, 6:49 a.m. UTC | #5
Tested-by: Xiao, Qimai <qimaix.xiao@intel.com>

Regards,
Xiao Qimai

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Chenbo Xia
> Sent: Wednesday, August 5, 2020 1:42 AM
> To: dev@dpdk.org
> Cc: ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com;
> kishore.padmanabha@broadcom.com;
> venkatkumar.duvvuru@broadcom.com; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/bnxt: fix variable size of port id
> 
> Currenly the variable size of ethdev port id is 8 bits. This patch standarizes it
> to 16 bits.
> 
> Fixes: 769de16872ab ("net/bnxt: fix port default rule create/destroy")
> Cc: stable@dpdk.org
> 
> Reported-by: Yinan Wang <yinan.wang@intel.com>
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
>  drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> index 9fb1a028f..ff5aed3d7 100644
> --- a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> +++ b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
> @@ -397,7 +397,7 @@ void
>  bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)  {
>  	struct bnxt_ulp_df_rule_info *info;
> -	uint8_t port_id;
> +	uint16_t port_id;
> 
>  	if (!BNXT_TRUFLOW_EN(bp) ||
>  	    BNXT_ETH_DEV_IS_REPRESENTOR(bp->eth_dev))
> --
> 2.17.1
  

Patch

diff --git a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
index 9fb1a028f..ff5aed3d7 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c
@@ -397,7 +397,7 @@  void
 bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)
 {
 	struct bnxt_ulp_df_rule_info *info;
-	uint8_t port_id;
+	uint16_t port_id;
 
 	if (!BNXT_TRUFLOW_EN(bp) ||
 	    BNXT_ETH_DEV_IS_REPRESENTOR(bp->eth_dev))