[v2] net/i40e: fix SFP X722 not work with FW4.16
diff mbox series

Message ID 1563490319-53151-1-git-send-email-xiao.zhang@intel.com
State Superseded, archived
Delegated to: Qi Zhang
Headers show
Series
  • [v2] net/i40e: fix SFP X722 not work with FW4.16
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Zhang, Xiao July 18, 2019, 10:51 p.m. UTC
FW4.16 of SFP X722 does not support setting TPID by set_switch_config
adminq operation, for firmware version less than 4.16 TPID is set by
register instead. For device SFP X722, disable adminq flag to follow
the same path with old firmware version to make it work.

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
---
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

Zhang, Qi Z July 19, 2019, 12:56 a.m. UTC | #1
> -----Original Message-----
> From: Zhang, Xiao
> Sent: Friday, July 19, 2019 6:52 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>
> Subject: [v2] net/i40e: fix SFP X722 not work with FW4.16

Please add fix line and Cc stable.
Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register setting")

> 
> FW4.16 of SFP X722 does not support setting TPID by set_switch_config
> adminq operation, for firmware version less than 4.16 TPID is set by register
> instead. For device SFP X722, disable adminq flag to follow the same path with
> old firmware version to make it work.
> 
> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> ---
> 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
Haiyue Wang July 19, 2019, 1:02 a.m. UTC | #2
> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Friday, July 19, 2019 08:57
> To: Zhang, Xiao <xiao.zhang@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>
> Subject: RE: [v2] net/i40e: fix SFP X722 not work with FW4.16
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Xiao
> > Sent: Friday, July 19, 2019 6:52 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>
> > Subject: [v2] net/i40e: fix SFP X722 not work with FW4.16
> 
> Please add fix line and Cc stable.
> Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register setting")
> 
> >
> > FW4.16 of SFP X722 does not support setting TPID by set_switch_config
> > adminq operation, for firmware version less than 4.16 TPID is set by register
> > instead. For device SFP X722, disable adminq flag to follow the same path with
> > old firmware version to make it work.
> >
> > Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> > ---
> > 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;
> > +
The commit log says some version like FW4.16 doesn't support ADQ, but this line
of code means all FW doesn't support ADQ. Which one is right ? :-)

> >  	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
Zhang, Xiao July 19, 2019, 1:14 a.m. UTC | #3
> -----Original Message-----
> From: Wang, Haiyue
> Sent: Friday, July 19, 2019 9:02 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhang, Xiao <xiao.zhang@intel.com>;
> dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>
> Subject: RE: [v2] net/i40e: fix SFP X722 not work with FW4.16
> 
> > -----Original Message-----
> > From: Zhang, Qi Z
> > Sent: Friday, July 19, 2019 08:57
> > To: Zhang, Xiao <xiao.zhang@intel.com>; dev@dpdk.org
> > Cc: Xing, Beilei <beilei.xing@intel.com>; Wang, Haiyue
> > <haiyue.wang@intel.com>
> > Subject: RE: [v2] net/i40e: fix SFP X722 not work with FW4.16
> >
> >
> >
> > > -----Original Message-----
> > > From: Zhang, Xiao
> > > Sent: Friday, July 19, 2019 6:52 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>
> > > Subject: [v2] net/i40e: fix SFP X722 not work with FW4.16
> >
> > Please add fix line and Cc stable.
> > Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register
> > setting")
> >
> > >
> > > FW4.16 of SFP X722 does not support setting TPID by
> > > set_switch_config adminq operation, for firmware version less than
> > > 4.16 TPID is set by register instead. For device SFP X722, disable
> > > adminq flag to follow the same path with old firmware version to make it
> work.
> > >
> > > Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> > > ---
> > > 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;
> > > +
> The commit log says some version like FW4.16 doesn't support ADQ, but this line
> of code means all FW doesn't support ADQ. Which one is right ? :-)

Old versions do not support ADQ and did not use ADQ operation in the code. And new FW with version 4.16 also does not support ADQ neither but used the ADQ operation in the code.
So all FW of SFP X722 do not support ADQ, the commit log may be confuse, I will make it more clear.

> 
> > >  	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 mbox series

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,