[v4] net/i40e: fix SFP X722 not work with FW4.16

Message ID 1563533997-10878-1-git-send-email-xiao.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v4] net/i40e: fix SFP X722 not work with FW4.16 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Xiao Zhang July 19, 2019, 10:59 a.m. UTC
  The code checked the NVM API version of FW to check if support adminq 
operation, when version is 1.7 or above adminq operation is support 
and the adminq flag will be set. The code will use adminq to set TPID if
the flags set or to use register. The NVM API version of SFP X722 old
versions are lowwer than 1.7 and for FW4.16 is 1.8. But FW4.16 of SFP
X722 does not support adminq operation, the legacy logic is not compatible
with device SFP X722 currently. Check the device id to unset adminq
flag to use resigter setting to make it work.

Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register
setting")
Cc: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
---
v4
Add more detailed information in the commit log.
v3
Modify the commit log to make it not confused and add fixed line.
v2
Unset adminq flag instead of only checking device id when set TPID.
v1
Check device id when setting TPID, use adminq if not SFP X722, else 
use register.
---
 drivers/net/i40e/i40e_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Wang, Haiyue July 19, 2019, 2:17 a.m. UTC | #1
> -----Original Message-----
> From: Zhang, Xiao
> Sent: Friday, July 19, 2019 19:00
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Zhang, Xiao <xiao.zhang@intel.com>; stable@dpdk.org
> Subject: [v4] net/i40e: fix SFP X722 not work with FW4.16
> 
> The code checked the NVM API version of FW to check if support adminq
> operation, when version is 1.7 or above adminq operation is support
> and the adminq flag will be set. The code will use adminq to set TPID if
> the flags set or to use register. The NVM API version of SFP X722 old
> versions are lowwer than 1.7 and for FW4.16 is 1.8. But FW4.16 of SFP
> X722 does not support adminq operation, the legacy logic is not compatible
> with device SFP X722 currently. Check the device id to unset adminq
> flag to use resigter setting to make it work.
> 
> Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register
> setting")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> ---

    Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
  
Qi Zhang July 19, 2019, 5:26 a.m. UTC | #2
> -----Original Message-----
> From: Wang, Haiyue
> Sent: Friday, July 19, 2019 10:18 AM
> To: Zhang, Xiao <xiao.zhang@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> stable@dpdk.org
> Subject: RE: [v4] net/i40e: fix SFP X722 not work with FW4.16
> 
> > -----Original Message-----
> > From: Zhang, Xiao
> > Sent: Friday, July 19, 2019 19:00
> > To: dev@dpdk.org
> > Cc: Xing, Beilei <beilei.xing@intel.com>; Wang, Haiyue
> > <haiyue.wang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhang,
> > Xiao <xiao.zhang@intel.com>; stable@dpdk.org
> > Subject: [v4] net/i40e: fix SFP X722 not work with FW4.16
> >
> > The code checked the NVM API version of FW to check if support adminq
> > operation, when version is 1.7 or above adminq operation is support
> > and the adminq flag will be set. The code will use adminq to set TPID
> > if the flags set or to use register. The NVM API version of SFP X722
> > old versions are lowwer than 1.7 and for FW4.16 is 1.8. But FW4.16 of
> > SFP
> > X722 does not support adminq operation, the legacy logic is not
> > compatible with device SFP X722 currently. Check the device id to
> > unset adminq flag to use resigter setting to make it work.
> >
> > Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register
> > setting")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> > ---
> 
>     Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  
Stillwell Jr, Paul M July 19, 2019, 3:30 p.m. UTC | #3
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Xiao Zhang
> Sent: Friday, July 19, 2019 4:00 AM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhang, Xiao
> <xiao.zhang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [v4] net/i40e: fix SFP X722 not work with FW4.16
> 
> The code checked the NVM API version of FW to check if support adminq
> operation, when version is 1.7 or above adminq operation is support and the
> adminq flag will be set. The code will use adminq to set TPID if the flags set or
> to use register. The NVM API version of SFP X722 old versions are lowwer
> than 1.7 and for FW4.16 is 1.8. But FW4.16 of SFP
> X722 does not support adminq operation, the legacy logic is not compatible
> with device SFP X722 currently. Check the device id to unset adminq flag to
> use resigter setting to make it work.
> 

Sorry, I'm still confused about what this patch is doing. From the commit message it seems like there are a couple of conditions:

If the device is X722
	Then if FW < 1.7 then use register to set TPID
	Else use adminq to set TPID

The change in the code is only looking to see if the device is X722 and not doing any other checking of FW version.

Am I misunderstanding the commit message, the patch, or both?

> Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register
> setting")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> ---
> v4
> Add more detailed information in the commit log.
> v3
> Modify the commit log to make it not confused and add fixed line.
> v2
> Unset adminq flag instead of only checking device id when set TPID.
> v1
> Check device id when setting TPID, use adminq if not SFP X722, else use
> register.
> ---
>  drivers/net/i40e/i40e_ethdev.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 2b9fc45..2b2c877 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -1358,6 +1358,10 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void
> *init_params __rte_unused)
>  		PMD_INIT_LOG(ERR, "Failed to init adminq: %d", ret);
>  		return -EIO;
>  	}
> +	/* Firmware of SFP x722 does not support adminq option */
> +	if (hw->device_id == I40E_DEV_ID_SFP_X722)
> +		hw->flags &= ~I40E_HW_FLAG_802_1AD_CAPABLE;
> +
>  	PMD_INIT_LOG(INFO, "FW %d.%d API %d.%d NVM
> %02d.%02d.%02d eetrack %04x",
>  		     hw->aq.fw_maj_ver, hw->aq.fw_min_ver,
>  		     hw->aq.api_maj_ver, hw->aq.api_min_ver,
> --
> 2.7.4
  
Ferruh Yigit July 19, 2019, 6:17 p.m. UTC | #4
On 7/19/2019 4:30 PM, Stillwell Jr, Paul M wrote:
> 
>> -----Original Message-----
>> From: dev <dev-bounces@dpdk.org> On Behalf Of Xiao Zhang
>> Sent: Friday, July 19, 2019 4:00 AM
>> To: dev@dpdk.org
>> Cc: Xing, Beilei <beilei.xing@intel.com>; Wang, Haiyue
>> <haiyue.wang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhang, Xiao
>> <xiao.zhang@intel.com>; stable@dpdk.org
>> Subject: [dpdk-dev] [v4] net/i40e: fix SFP X722 not work with FW4.16
>>
>> The code checked the NVM API version of FW to check if support adminq
>> operation, when version is 1.7 or above adminq operation is support and the
>> adminq flag will be set. The code will use adminq to set TPID if the flags set or
>> to use register. The NVM API version of SFP X722 old versions are lowwer
>> than 1.7 and for FW4.16 is 1.8. But FW4.16 of SFP
>> X722 does not support adminq operation, the legacy logic is not compatible
>> with device SFP X722 currently. Check the device id to unset adminq flag to
>> use resigter setting to make it work.
>>
> 
> Sorry, I'm still confused about what this patch is doing. From the commit message it seems like there are a couple of conditions:
> 
> If the device is X722
> 	Then if FW < 1.7 then use register to set TPID
> 	Else use adminq to set TPID
> 
> The change in the code is only looking to see if the device is X722 and not doing any other checking of FW version.
> 
> Am I misunderstanding the commit message, the patch, or both?

I have updated the commit log while merging [1] (according what I understand) I
hope it is more clear.

[1]
    net/i40e: fix SFP X722 with FW4.16

    When NVM API version is 1.7 or above adminq operation to set TPID is
    set as supported. This cause using adminq instead of registers.

    For SFP X722 FW4.16, reported NVM API version is 1.8, and this cause
    adminq operation to set as supported but it is not supported on FW4.16

    Additional check added for SFP X722 to not enable adminq operation.

    Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register setting")
    Cc: stable@dpdk.org

    Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
    Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>



> 
>> Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register
>> setting")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
>> ---
>> v4
>> Add more detailed information in the commit log.
>> v3
>> Modify the commit log to make it not confused and add fixed line.
>> v2
>> Unset adminq flag instead of only checking device id when set TPID.
>> v1
>> Check device id when setting TPID, use adminq if not SFP X722, else use
>> register.
>> ---
>>  drivers/net/i40e/i40e_ethdev.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
>> index 2b9fc45..2b2c877 100644
>> --- a/drivers/net/i40e/i40e_ethdev.c
>> +++ b/drivers/net/i40e/i40e_ethdev.c
>> @@ -1358,6 +1358,10 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void
>> *init_params __rte_unused)
>>  		PMD_INIT_LOG(ERR, "Failed to init adminq: %d", ret);
>>  		return -EIO;
>>  	}
>> +	/* Firmware of SFP x722 does not support adminq option */
>> +	if (hw->device_id == I40E_DEV_ID_SFP_X722)
>> +		hw->flags &= ~I40E_HW_FLAG_802_1AD_CAPABLE;
>> +
>>  	PMD_INIT_LOG(INFO, "FW %d.%d API %d.%d NVM
>> %02d.%02d.%02d eetrack %04x",
>>  		     hw->aq.fw_maj_ver, hw->aq.fw_min_ver,
>>  		     hw->aq.api_maj_ver, hw->aq.api_min_ver,
>> --
>> 2.7.4
>
  
Xiao Zhang July 20, 2019, 12:53 a.m. UTC | #5
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Saturday, July 20, 2019 2:18 AM
> To: Stillwell Jr, Paul M <paul.m.stillwell.jr@intel.com>; Zhang, Xiao
> <xiao.zhang@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> stable@dpdk.org
> Subject: Re: [dpdk-stable] [dpdk-dev] [v4] net/i40e: fix SFP X722 not work
> with FW4.16
> 
> On 7/19/2019 4:30 PM, Stillwell Jr, Paul M wrote:
> >
> >> -----Original Message-----
> >> From: dev <dev-bounces@dpdk.org> On Behalf Of Xiao Zhang
> >> Sent: Friday, July 19, 2019 4:00 AM
> >> To: dev@dpdk.org
> >> Cc: Xing, Beilei <beilei.xing@intel.com>; Wang, Haiyue
> >> <haiyue.wang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhang,
> >> Xiao <xiao.zhang@intel.com>; stable@dpdk.org
> >> Subject: [dpdk-dev] [v4] net/i40e: fix SFP X722 not work with FW4.16
> >>
> >> The code checked the NVM API version of FW to check if support adminq
> >> operation, when version is 1.7 or above adminq operation is support
> >> and the adminq flag will be set. The code will use adminq to set TPID
> >> if the flags set or to use register. The NVM API version of SFP X722
> >> old versions are lowwer than 1.7 and for FW4.16 is 1.8. But FW4.16 of
> >> SFP
> >> X722 does not support adminq operation, the legacy logic is not
> >> compatible with device SFP X722 currently. Check the device id to
> >> unset adminq flag to use resigter setting to make it work.
> >>
> >
> > Sorry, I'm still confused about what this patch is doing. From the commit
> message it seems like there are a couple of conditions:
> >
> > If the device is X722
> > 	Then if FW < 1.7 then use register to set TPID
> > 	Else use adminq to set TPID
> >
> > The change in the code is only looking to see if the device is X722 and not
> doing any other checking of FW version.
> >
> > Am I misunderstanding the commit message, the patch, or both?
> 
> I have updated the commit log while merging [1] (according what I
> understand) I hope it is more clear.
> 
> [1]
>     net/i40e: fix SFP X722 with FW4.16
> 
>     When NVM API version is 1.7 or above adminq operation to set TPID is
>     set as supported. This cause using adminq instead of registers.
> 
>     For SFP X722 FW4.16, reported NVM API version is 1.8, and this cause
>     adminq operation to set as supported but it is not supported on FW4.16
> 
>     Additional check added for SFP X722 to not enable adminq operation.
> 
>     Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register
> setting")
>     Cc: stable@dpdk.org
> 
>     Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
>     Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
> 

Thanks Ferruh for updating the log. 

There are two versions here, NVM API version and FW version.
For SFP X722, NVM API version of FW4.16 is 1.8, old versions bellow 1.7.(eg. FW4.0 with NVM API 1.6).
The adminq operation is not workable for FW4.16, so all FW versions do not work with adminq operation for SFP X722 currently. So add device check for SFP X722 in this fix.

> 
> 
> >
> >> Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register
> >> setting")
> >> Cc: stable@dpdk.org
> >>
> >> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> >> ---
> >> v4
> >> Add more detailed information in the commit log.
> >> v3
> >> Modify the commit log to make it not confused and add fixed line.
> >> v2
> >> Unset adminq flag instead of only checking device id when set TPID.
> >> v1
> >> Check device id when setting TPID, use adminq if not SFP X722, else
> >> use register.
> >> ---
> >>  drivers/net/i40e/i40e_ethdev.c | 4 ++++
> >>  1 file changed, 4 insertions(+)
> >>
> >> diff --git a/drivers/net/i40e/i40e_ethdev.c
> >> b/drivers/net/i40e/i40e_ethdev.c index 2b9fc45..2b2c877 100644
> >> --- a/drivers/net/i40e/i40e_ethdev.c
> >> +++ b/drivers/net/i40e/i40e_ethdev.c
> >> @@ -1358,6 +1358,10 @@ eth_i40e_dev_init(struct rte_eth_dev *dev,
> >> void *init_params __rte_unused)
> >>  		PMD_INIT_LOG(ERR, "Failed to init adminq: %d", ret);
> >>  		return -EIO;
> >>  	}
> >> +	/* Firmware of SFP x722 does not support adminq option */
> >> +	if (hw->device_id == I40E_DEV_ID_SFP_X722)
> >> +		hw->flags &= ~I40E_HW_FLAG_802_1AD_CAPABLE;
> >> +
> >>  	PMD_INIT_LOG(INFO, "FW %d.%d API %d.%d
> NVM %02d.%02d.%02d eetrack
> >> %04x",
> >>  		     hw->aq.fw_maj_ver, hw->aq.fw_min_ver,
> >>  		     hw->aq.api_maj_ver, hw->aq.api_min_ver,
> >> --
> >> 2.7.4
> >
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 2b9fc45..2b2c877 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1358,6 +1358,10 @@  eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
 		PMD_INIT_LOG(ERR, "Failed to init adminq: %d", ret);
 		return -EIO;
 	}
+	/* Firmware of SFP x722 does not support adminq option */
+	if (hw->device_id == I40E_DEV_ID_SFP_X722)
+		hw->flags &= ~I40E_HW_FLAG_802_1AD_CAPABLE;
+
 	PMD_INIT_LOG(INFO, "FW %d.%d API %d.%d NVM %02d.%02d.%02d eetrack %04x",
 		     hw->aq.fw_maj_ver, hw->aq.fw_min_ver,
 		     hw->aq.api_maj_ver, hw->aq.api_min_ver,