[v4,18/18] net/i40e: fix redefinition warning
Checks
Commit Message
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
> -----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
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
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
>
> -----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
> >
@@ -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;