[dpdk-dev] [PATCH v3 1/2] net/i40e: use PHY type to check PHY capability

Zhang, Qi Z qi.z.zhang at intel.com
Mon Sep 26 02:52:13 CEST 2016


Hi 

> -----Original Message-----
> From: Wu, Jingjing
> Sent: Sunday, September 25, 2016 5:59 PM
> To: Zhang, Qi Z <qi.z.zhang at intel.com>; Zhang, Helin <helin.zhang at intel.com>
> Cc: dev at dpdk.org
> Subject: RE: [PATCH v3 1/2] net/i40e: use PHY type to check PHY capability
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Qi Z
> > Sent: Friday, September 23, 2016 1:50 AM
> > To: Wu, Jingjing <jingjing.wu at intel.com>; Zhang, Helin
> > <helin.zhang at intel.com>
> > Cc: dev at dpdk.org; Zhang, Qi Z <qi.z.zhang at intel.com>
> > Subject: [PATCH v3 1/2] net/i40e: use PHY type to check PHY capability
> >
> > In previous code, we use device ID to check PHY capability which is
> > not extensible since there is always new device be added.
> > Now we use PHY type to detect PHY capability.
> > PHY type encoded all link speed the device support, it is read out
> > through aq command "get_phy_capability"
> > at init stage.
> >
> > Signed-off-by: Zhang Qi <qi.z.zhang at intel.com>
> > ---
> >  drivers/net/i40e/i40e_ethdev.c | 33 ++++++++++++++++++++++++++++-----
> > drivers/net/i40e/i40e_ethdev.h |  8 ++++++++
> >  2 files changed, 36 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev.c
> > b/drivers/net/i40e/i40e_ethdev.c index acc25a2..9658503 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -411,6 +411,7 @@ static int i40e_dev_filter_ctrl(struct rte_eth_dev
> *dev,
> >  				void *arg);
> >  static int i40e_dev_get_dcb_info(struct rte_eth_dev *dev,
> >  				  struct rte_eth_dcb_info *dcb_info);
> > +static int i40e_dev_sync_phy_type(struct i40e_hw *hw);
> >  static void i40e_configure_registers(struct i40e_hw *hw);  static
> > void i40e_hw_init(struct rte_eth_dev *dev);  static int
> > i40e_config_qinq(struct i40e_hw *hw, struct i40e_vsi *vsi); @@ -1028,7
> > +1029,11 @@ eth_i40e_dev_init(struct rte_eth_dev *dev)
> >  	config_floating_veb(dev);
> >  	/* Clear PXE mode */
> >  	i40e_clear_pxe_mode(hw);
> > -
> > +	ret = i40e_dev_sync_phy_type(hw);
> > +	if (ret != I40E_SUCCESS) {
> > +		PMD_INIT_LOG(ERR, "Failed to init phy type: %d", ret);
> > +		goto err_sync_phy_type;
> > +	}
> Should we return from device initialization if failure?
Admin queue is already initialized before this, get_phy_capability should
not fail, so initialization should stop if an unexpected failure happen.
> And return value of i40e_dev_sync_phy_type is standard error, but you check It
> by comparing with I40E defined error code.
I will correct it, thanks for capture this.
> 
> Thanks
> Jingjing
Thanks
Qi


More information about the dev mailing list