[dpdk-dev] i40e: skip any phy config as a workaround

Message ID 1447744187-32638-1-git-send-email-helin.zhang@intel.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Zhang, Helin Nov. 17, 2015, 7:09 a.m. UTC
  As firmware does not support any link control from software driver
side, any phy config should be ignored as a workaround. Otherwise
the link might not be up again after binding back to kernel driver.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 61 +++++++-----------------------------------
 1 file changed, 9 insertions(+), 52 deletions(-)
  

Comments

Thomas Monjalon Nov. 23, 2015, 10:17 p.m. UTC | #1
2015-11-17 15:09, Helin Zhang:
> As firmware does not support any link control from software driver
> side, any phy config should be ignored as a workaround. Otherwise
> the link might not be up again after binding back to kernel driver.
> 
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
[...]
> +i40e_phy_conf_link(__rte_unused struct i40e_hw *hw,
> +		   __rte_unused uint8_t abilities,
> +		   __rte_unused uint8_t force_speed)
> +{
> +	/* Skip any phy config on both 10G and 40G interfaces, as a workaround
> +	 * for the link control limitation of that all link control should be
> +	 * handled by firmware. It should follow up if link control will be
> +	 * opened to software driver in future firmware versions.
> +	 */
>  	return I40E_SUCCESS;
>  }

An error code seems more appropriate.
But I guess you perfectly know what you do, so
Applied, thanks
  
Zhang, Helin Nov. 24, 2015, 12:33 a.m. UTC | #2
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Tuesday, November 24, 2015 6:17 AM
> To: Zhang, Helin
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] i40e: skip any phy config as a workaround
> 
> 2015-11-17 15:09, Helin Zhang:
> > As firmware does not support any link control from software driver
> > side, any phy config should be ignored as a workaround. Otherwise the
> > link might not be up again after binding back to kernel driver.
> >
> > Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> [...]
> > +i40e_phy_conf_link(__rte_unused struct i40e_hw *hw,
> > +		   __rte_unused uint8_t abilities,
> > +		   __rte_unused uint8_t force_speed) {
> > +	/* Skip any phy config on both 10G and 40G interfaces, as a
> workaround
> > +	 * for the link control limitation of that all link control should be
> > +	 * handled by firmware. It should follow up if link control will be
> > +	 * opened to software driver in future firmware versions.
> > +	 */
> >  	return I40E_SUCCESS;
> >  }
> 
> An error code seems more appropriate.
> But I guess you perfectly know what you do, so Applied, thanks

Yes, for now, I'd prefer to use I40E_SUCCESS. We will continue working on this when
firmware provides the link control to sw driver. Thank you very much!

Regards,
Helin
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 2c51a0b..f06c566 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1347,58 +1347,15 @@  i40e_parse_link_speed(uint16_t eth_link_speed)
 }
 
 static int
-i40e_phy_conf_link(struct i40e_hw *hw, uint8_t abilities, uint8_t force_speed)
-{
-	enum i40e_status_code status;
-	struct i40e_aq_get_phy_abilities_resp phy_ab;
-	struct i40e_aq_set_phy_config phy_conf;
-	const uint8_t mask = I40E_AQ_PHY_FLAG_PAUSE_TX |
-			I40E_AQ_PHY_FLAG_PAUSE_RX |
-			I40E_AQ_PHY_FLAG_LOW_POWER;
-	const uint8_t advt = I40E_LINK_SPEED_40GB |
-			I40E_LINK_SPEED_10GB |
-			I40E_LINK_SPEED_1GB |
-			I40E_LINK_SPEED_100MB;
-	int ret = -ENOTSUP;
-
-	/* Skip it on 40G interfaces, as a workaround for the link issue */
-	if (i40e_is_40G_device(hw->device_id))
-		return I40E_SUCCESS;
-
-	status = i40e_aq_get_phy_capabilities(hw, false, false, &phy_ab,
-					      NULL);
-	if (status)
-		return ret;
-
-	memset(&phy_conf, 0, sizeof(phy_conf));
-
-	/* bits 0-2 use the values from get_phy_abilities_resp */
-	abilities &= ~mask;
-	abilities |= phy_ab.abilities & mask;
-
-	/* update ablities and speed */
-	if (abilities & I40E_AQ_PHY_AN_ENABLED)
-		phy_conf.link_speed = advt;
-	else
-		phy_conf.link_speed = force_speed;
-
-	phy_conf.abilities = abilities;
-
-	/* use get_phy_abilities_resp value for the rest */
-	phy_conf.phy_type = phy_ab.phy_type;
-	phy_conf.eee_capability = phy_ab.eee_capability;
-	phy_conf.eeer = phy_ab.eeer_val;
-	phy_conf.low_power_ctrl = phy_ab.d3_lpan;
-
-	PMD_DRV_LOG(DEBUG, "\tCurrent: abilities %x, link_speed %x",
-		    phy_ab.abilities, phy_ab.link_speed);
-	PMD_DRV_LOG(DEBUG, "\tConfig:  abilities %x, link_speed %x",
-		    phy_conf.abilities, phy_conf.link_speed);
-
-	status = i40e_aq_set_phy_config(hw, &phy_conf, NULL);
-	if (status)
-		return ret;
-
+i40e_phy_conf_link(__rte_unused struct i40e_hw *hw,
+		   __rte_unused uint8_t abilities,
+		   __rte_unused uint8_t force_speed)
+{
+	/* Skip any phy config on both 10G and 40G interfaces, as a workaround
+	 * for the link control limitation of that all link control should be
+	 * handled by firmware. It should follow up if link control will be
+	 * opened to software driver in future firmware versions.
+	 */
 	return I40E_SUCCESS;
 }