[v4,18/18] net/i40e: fix redefinition warning

Message ID 20210906020258.1291688-19-robinx.zhang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series i40e base code update |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing fail Testing issues

Commit Message

Robin Zhang Sept. 6, 2021, 2:02 a.m. UTC
  After update i40e share code, there will be a redefinition compile
warning. This patch fix the situation by remove duplicate definition
in i40e_ethdev.c

Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Xing, Beilei Sept. 27, 2021, 9:17 a.m. UTC | #1
> -----Original Message-----
> From: Zhang, RobinX <robinx.zhang@intel.com>
> Sent: Monday, September 6, 2021 10:03 AM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Zhang, Helin <helin.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> remy.horton@intel.com; jijiang.liu@intel.com; jing.d.chen@intel.com; Zhu,
> Heqing <heqing.zhu@intel.com>; Liang, Cunming
> <cunming.liang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhang,
> Roy Fan <roy.fan.zhang@intel.com>; Chilikin, Andrey
> <andrey.chilikin@intel.com>; echaudro@redhat.com; Guo, Junfeng
> <junfeng.guo@intel.com>; Yang, SteveX <stevex.yang@intel.com>; Zhang,
> RobinX <robinx.zhang@intel.com>
> Subject: [PATCH v4 18/18] net/i40e: fix redefinition warning
> 
> After update i40e share code, there will be a redefinition compile warning.
> This patch fix the situation by remove duplicate definition in i40e_ethdev.c
> 
> Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
Need to cc stable?

> 
> Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 7b230e2ed1..4fc44dc5e2 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -2886,7 +2886,6 @@ static __rte_always_inline void
> update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)  {
>  /* Link status registers and values*/
> -#define I40E_PRTMAC_LINKSTA		0x001E2420
>  #define I40E_REG_LINK_UP		0x40000080
>  #define I40E_PRTMAC_MACC		0x001E24E0
>  #define I40E_REG_MACC_25GB		0x00020000
> @@ -2899,7 +2898,7 @@ update_link_reg(struct i40e_hw *hw, struct
> rte_eth_link *link)
>  	uint32_t link_speed;
>  	uint32_t reg_val;
> 
> -	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA);
> +	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA(0));
>  	link_speed = reg_val & I40E_REG_SPEED_MASK;
>  	reg_val &= I40E_REG_LINK_UP;
>  	link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
> --
> 2.25.1
  
Robin Zhang Sept. 27, 2021, 9:30 a.m. UTC | #2
Hi, Beilei

> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Monday, September 27, 2021 5:18 PM
> To: Zhang, RobinX <robinx.zhang@intel.com>; dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhang, Helin
> <helin.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> remy.horton@intel.com; jijiang.liu@intel.com; jing.d.chen@intel.com; Zhu,
> Heqing <heqing.zhu@intel.com>; Liang, Cunming
> <cunming.liang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhang,
> Roy Fan <roy.fan.zhang@intel.com>; Chilikin, Andrey
> <andrey.chilikin@intel.com>; echaudro@redhat.com; Guo, Junfeng
> <junfeng.guo@intel.com>; Yang, SteveX <stevex.yang@intel.com>
> Subject: RE: [PATCH v4 18/18] net/i40e: fix redefinition warning
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, RobinX <robinx.zhang@intel.com>
> > Sent: Monday, September 6, 2021 10:03 AM
> > To: dev@dpdk.org
> > Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Zhang, Helin <helin.zhang@intel.com>; Wu,
> > Jingjing <jingjing.wu@intel.com>; remy.horton@intel.com;
> > jijiang.liu@intel.com; jing.d.chen@intel.com; Zhu, Heqing
> > <heqing.zhu@intel.com>; Liang, Cunming <cunming.liang@intel.com>; Lu,
> > Wenzhuo <wenzhuo.lu@intel.com>; Zhang, Roy Fan
> > <roy.fan.zhang@intel.com>; Chilikin, Andrey
> > <andrey.chilikin@intel.com>; echaudro@redhat.com; Guo, Junfeng
> > <junfeng.guo@intel.com>; Yang, SteveX <stevex.yang@intel.com>; Zhang,
> > RobinX <robinx.zhang@intel.com>
> > Subject: [PATCH v4 18/18] net/i40e: fix redefinition warning
> >
> > After update i40e share code, there will be a redefinition compile warning.
> > This patch fix the situation by remove duplicate definition in
> > i40e_ethdev.c
> >
> > Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
> Need to cc stable?

This patch is dependent on share code, so cannot cc stable.

> 
> >
> > Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
> > ---
> >  drivers/net/i40e/i40e_ethdev.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev.c
> > b/drivers/net/i40e/i40e_ethdev.c index 7b230e2ed1..4fc44dc5e2 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -2886,7 +2886,6 @@ static __rte_always_inline void
> > update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)  {
> >  /* Link status registers and values*/
> > -#define I40E_PRTMAC_LINKSTA		0x001E2420
> >  #define I40E_REG_LINK_UP		0x40000080
> >  #define I40E_PRTMAC_MACC		0x001E24E0
> >  #define I40E_REG_MACC_25GB		0x00020000
> > @@ -2899,7 +2898,7 @@ update_link_reg(struct i40e_hw *hw, struct
> > rte_eth_link *link)
> >  	uint32_t link_speed;
> >  	uint32_t reg_val;
> >
> > -	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA);
> > +	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA(0));
> >  	link_speed = reg_val & I40E_REG_SPEED_MASK;
> >  	reg_val &= I40E_REG_LINK_UP;
> >  	link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
> > --
> > 2.25.1
  
Kevin Traynor Sept. 27, 2021, 10:37 a.m. UTC | #3
Hi,

On 27/09/2021 10:30, Zhang, RobinX wrote:
> Hi, Beilei
> 
>> -----Original Message-----
>> From: Xing, Beilei <beilei.xing@intel.com>
>> Sent: Monday, September 27, 2021 5:18 PM
>> To: Zhang, RobinX <robinx.zhang@intel.com>; dev@dpdk.org
>> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhang, Helin
>> <helin.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
>> remy.horton@intel.com; jijiang.liu@intel.com; jing.d.chen@intel.com; Zhu,
>> Heqing <heqing.zhu@intel.com>; Liang, Cunming
>> <cunming.liang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhang,
>> Roy Fan <roy.fan.zhang@intel.com>; Chilikin, Andrey
>> <andrey.chilikin@intel.com>; echaudro@redhat.com; Guo, Junfeng
>> <junfeng.guo@intel.com>; Yang, SteveX <stevex.yang@intel.com>
>> Subject: RE: [PATCH v4 18/18] net/i40e: fix redefinition warning
>>
>>
>>
>>> -----Original Message-----
>>> From: Zhang, RobinX <robinx.zhang@intel.com>
>>> Sent: Monday, September 6, 2021 10:03 AM
>>> To: dev@dpdk.org
>>> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
>>> <qi.z.zhang@intel.com>; Zhang, Helin <helin.zhang@intel.com>; Wu,
>>> Jingjing <jingjing.wu@intel.com>; remy.horton@intel.com;
>>> jijiang.liu@intel.com; jing.d.chen@intel.com; Zhu, Heqing
>>> <heqing.zhu@intel.com>; Liang, Cunming <cunming.liang@intel.com>; Lu,
>>> Wenzhuo <wenzhuo.lu@intel.com>; Zhang, Roy Fan
>>> <roy.fan.zhang@intel.com>; Chilikin, Andrey
>>> <andrey.chilikin@intel.com>; echaudro@redhat.com; Guo, Junfeng
>>> <junfeng.guo@intel.com>; Yang, SteveX <stevex.yang@intel.com>; Zhang,
>>> RobinX <robinx.zhang@intel.com>
>>> Subject: [PATCH v4 18/18] net/i40e: fix redefinition warning
>>>
>>> After update i40e share code, there will be a redefinition compile warning.
>>> This patch fix the situation by remove duplicate definition in
>>> i40e_ethdev.c
>>>
>>> Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
>> Need to cc stable?
> 
> This patch is dependent on share code, so cannot cc stable.
> 

I don't think the original definition should be the fixes commit, unless 
it was incorrect before these patches.

This warning was introduced by the redefining in patch 13/18. It would 
be better to fix 13/18 to not introduce the warning, rather than 
introduce a warning and fix it at the end of the series.

>>
>>>
>>> Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
>>> ---
>>>   drivers/net/i40e/i40e_ethdev.c | 3 +--
>>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/i40e/i40e_ethdev.c
>>> b/drivers/net/i40e/i40e_ethdev.c index 7b230e2ed1..4fc44dc5e2 100644
>>> --- a/drivers/net/i40e/i40e_ethdev.c
>>> +++ b/drivers/net/i40e/i40e_ethdev.c
>>> @@ -2886,7 +2886,6 @@ static __rte_always_inline void
>>> update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)  {
>>>   /* Link status registers and values*/
>>> -#define I40E_PRTMAC_LINKSTA		0x001E2420
>>>   #define I40E_REG_LINK_UP		0x40000080
>>>   #define I40E_PRTMAC_MACC		0x001E24E0
>>>   #define I40E_REG_MACC_25GB		0x00020000
>>> @@ -2899,7 +2898,7 @@ update_link_reg(struct i40e_hw *hw, struct
>>> rte_eth_link *link)
>>>   	uint32_t link_speed;
>>>   	uint32_t reg_val;
>>>
>>> -	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA);
>>> +	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA(0));
>>>   	link_speed = reg_val & I40E_REG_SPEED_MASK;
>>>   	reg_val &= I40E_REG_LINK_UP;
>>>   	link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
>>> --
>>> 2.25.1
>
  
Qi Zhang Sept. 27, 2021, 11 a.m. UTC | #4
> -----Original Message-----
> From: Kevin Traynor <ktraynor@redhat.com>
> Sent: Monday, September 27, 2021 6:38 PM
> To: Zhang, RobinX <robinx.zhang@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhang, Helin <helin.zhang@intel.com>;
> Wu, Jingjing <jingjing.wu@intel.com>; remy.horton@intel.com;
> jijiang.liu@intel.com; jing.d.chen@intel.com; Zhu, Heqing
> <heqing.zhu@intel.com>; Liang, Cunming <cunming.liang@intel.com>; Lu,
> Wenzhuo <wenzhuo.lu@intel.com>; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>; Chilikin, Andrey <andrey.chilikin@intel.com>;
> echaudro@redhat.com; Guo, Junfeng <junfeng.guo@intel.com>; Yang, SteveX
> <stevex.yang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v4 18/18] net/i40e: fix redefinition warning
> 
> Hi,
> 
> On 27/09/2021 10:30, Zhang, RobinX wrote:
> > Hi, Beilei
> >
> >> -----Original Message-----
> >> From: Xing, Beilei <beilei.xing@intel.com>
> >> Sent: Monday, September 27, 2021 5:18 PM
> >> To: Zhang, RobinX <robinx.zhang@intel.com>; dev@dpdk.org
> >> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhang, Helin
> >> <helin.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> >> remy.horton@intel.com; jijiang.liu@intel.com; jing.d.chen@intel.com;
> >> Zhu, Heqing <heqing.zhu@intel.com>; Liang, Cunming
> >> <cunming.liang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>;
> Zhang,
> >> Roy Fan <roy.fan.zhang@intel.com>; Chilikin, Andrey
> >> <andrey.chilikin@intel.com>; echaudro@redhat.com; Guo, Junfeng
> >> <junfeng.guo@intel.com>; Yang, SteveX <stevex.yang@intel.com>
> >> Subject: RE: [PATCH v4 18/18] net/i40e: fix redefinition warning
> >>
> >>
> >>
> >>> -----Original Message-----
> >>> From: Zhang, RobinX <robinx.zhang@intel.com>
> >>> Sent: Monday, September 6, 2021 10:03 AM
> >>> To: dev@dpdk.org
> >>> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z
> >>> <qi.z.zhang@intel.com>; Zhang, Helin <helin.zhang@intel.com>; Wu,
> >>> Jingjing <jingjing.wu@intel.com>; remy.horton@intel.com;
> >>> jijiang.liu@intel.com; jing.d.chen@intel.com; Zhu, Heqing
> >>> <heqing.zhu@intel.com>; Liang, Cunming <cunming.liang@intel.com>;
> >>> Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhang, Roy Fan
> >>> <roy.fan.zhang@intel.com>; Chilikin, Andrey
> >>> <andrey.chilikin@intel.com>; echaudro@redhat.com; Guo, Junfeng
> >>> <junfeng.guo@intel.com>; Yang, SteveX <stevex.yang@intel.com>;
> >>> Zhang, RobinX <robinx.zhang@intel.com>
> >>> Subject: [PATCH v4 18/18] net/i40e: fix redefinition warning
> >>>
> >>> After update i40e share code, there will be a redefinition compile warning.
> >>> This patch fix the situation by remove duplicate definition in
> >>> i40e_ethdev.c
> >>>
> >>> Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")
> >> Need to cc stable?
> >
> > This patch is dependent on share code, so cannot cc stable.
> >
> 
> I don't think the original definition should be the fixes commit, unless it was
> incorrect before these patches.
> 
> This warning was introduced by the redefining in patch 13/18. It would be
> better to fix 13/18 to not introduce the warning, rather than introduce a
> warning and fix it at the end of the series.

+1

If fix a patch belong to the same set, please squash them into 1.

> 
> >>
> >>>
> >>> Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
> >>> ---
> >>>   drivers/net/i40e/i40e_ethdev.c | 3 +--
> >>>   1 file changed, 1 insertion(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/net/i40e/i40e_ethdev.c
> >>> b/drivers/net/i40e/i40e_ethdev.c index 7b230e2ed1..4fc44dc5e2 100644
> >>> --- a/drivers/net/i40e/i40e_ethdev.c
> >>> +++ b/drivers/net/i40e/i40e_ethdev.c
> >>> @@ -2886,7 +2886,6 @@ static __rte_always_inline void
> >>> update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)  {
> >>>   /* Link status registers and values*/
> >>> -#define I40E_PRTMAC_LINKSTA		0x001E2420
> >>>   #define I40E_REG_LINK_UP		0x40000080
> >>>   #define I40E_PRTMAC_MACC		0x001E24E0
> >>>   #define I40E_REG_MACC_25GB		0x00020000
> >>> @@ -2899,7 +2898,7 @@ update_link_reg(struct i40e_hw *hw, struct
> >>> rte_eth_link *link)
> >>>   	uint32_t link_speed;
> >>>   	uint32_t reg_val;
> >>>
> >>> -	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA);
> >>> +	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA(0));
> >>>   	link_speed = reg_val & I40E_REG_SPEED_MASK;
> >>>   	reg_val &= I40E_REG_LINK_UP;
> >>>   	link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
> >>> --
> >>> 2.25.1
> >
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7b230e2ed1..4fc44dc5e2 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2886,7 +2886,6 @@  static __rte_always_inline void
 update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
 {
 /* Link status registers and values*/
-#define I40E_PRTMAC_LINKSTA		0x001E2420
 #define I40E_REG_LINK_UP		0x40000080
 #define I40E_PRTMAC_MACC		0x001E24E0
 #define I40E_REG_MACC_25GB		0x00020000
@@ -2899,7 +2898,7 @@  update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
 	uint32_t link_speed;
 	uint32_t reg_val;
 
-	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA);
+	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA(0));
 	link_speed = reg_val & I40E_REG_SPEED_MASK;
 	reg_val &= I40E_REG_LINK_UP;
 	link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;