[dpdk-dev] librte_pmd_e1000: power down the serdes link

Message ID 1425700658-12077-1-git-send-email-jiaxt@sinogrid.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Shelton Chia March 7, 2015, 3:57 a.m. UTC
  Signed-off-by: Shelton Chia <jiaxt@sinogrid.com>
---
 lib/librte_pmd_e1000/igb_ethdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Thomas Monjalon March 23, 2015, 11:40 a.m. UTC | #1
There is no maintainer declared for e1000.
Maybe that an Intel expert could check this patch, please?

2015-03-07 11:57, Shelton Chia:
> Signed-off-by: Shelton Chia <jiaxt@sinogrid.com>
> ---
>  lib/librte_pmd_e1000/igb_ethdev.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c
> index 504ae74..314ef2a 100644
> --- a/lib/librte_pmd_e1000/igb_ethdev.c
> +++ b/lib/librte_pmd_e1000/igb_ethdev.c
> @@ -948,7 +948,10 @@ eth_igb_stop(struct rte_eth_dev *dev)
>  	}
>  
>  	/* Power down the phy. Needed to make the link go Down */
> -	e1000_power_down_phy(hw);
> +	if (hw->phy.media_type == e1000_media_type_copper)
> +		e1000_power_down_phy(hw);
> +	else
> +		e1000_shutdown_fiber_serdes_link(hw);
>  
>  	igb_dev_clear_queues(dev);
>  
>
  
Thomas Monjalon March 30, 2015, 8:30 p.m. UTC | #2
2015-03-07 11:57, Shelton Chia:
> Signed-off-by: Shelton Chia <jiaxt@sinogrid.com>
> ---
>  lib/librte_pmd_e1000/igb_ethdev.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c
> index 504ae74..314ef2a 100644
> --- a/lib/librte_pmd_e1000/igb_ethdev.c
> +++ b/lib/librte_pmd_e1000/igb_ethdev.c
> @@ -948,7 +948,10 @@ eth_igb_stop(struct rte_eth_dev *dev)
>  	}
>  
>  	/* Power down the phy. Needed to make the link go Down */
> -	e1000_power_down_phy(hw);
> +	if (hw->phy.media_type == e1000_media_type_copper)
> +		e1000_power_down_phy(hw);
> +	else
> +		e1000_shutdown_fiber_serdes_link(hw);
>  
>  	igb_dev_clear_queues(dev);

Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c
index 504ae74..314ef2a 100644
--- a/lib/librte_pmd_e1000/igb_ethdev.c
+++ b/lib/librte_pmd_e1000/igb_ethdev.c
@@ -948,7 +948,10 @@  eth_igb_stop(struct rte_eth_dev *dev)
 	}
 
 	/* Power down the phy. Needed to make the link go Down */
-	e1000_power_down_phy(hw);
+	if (hw->phy.media_type == e1000_media_type_copper)
+		e1000_power_down_phy(hw);
+	else
+		e1000_shutdown_fiber_serdes_link(hw);
 
 	igb_dev_clear_queues(dev);