DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 15/17] ixgbe/base: prevent KR PHY reset in init
Date: Fri, 20 Nov 2015 15:17:56 +0800	[thread overview]
Message-ID: <1448003879-29960-16-git-send-email-wenzhuo.lu@intel.com> (raw)
In-Reply-To: <1448003879-29960-1-git-send-email-wenzhuo.lu@intel.com>

This patch removes KR PHY reset from ixgbe_init_phy_ops_X550em. Since
this function is meant to initialize function pointers for detected PHY
type. Internal PHY reset was moved to ixgbe_setup_internal_phy_t_x550em
which will now detect which mode does internal PHY work in, and setup it
as required.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_x550.c | 79 +++++++++++++++++++------------------
 1 file changed, 40 insertions(+), 39 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c
index 6b27234..4ca7998 100644
--- a/drivers/net/ixgbe/base/ixgbe_x550.c
+++ b/drivers/net/ixgbe/base/ixgbe_x550.c
@@ -1456,7 +1456,6 @@ STATIC s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw,
 s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
 {
 	struct ixgbe_phy_info *phy = &hw->phy;
-	ixgbe_link_speed speed;
 	s32 ret_val;
 
 	DEBUGFUNC("ixgbe_init_phy_ops_X550em");
@@ -1505,14 +1504,8 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
 		/* If internal link mode is XFI, then setup iXFI internal link,
 		 * else setup KR now.
 		 */
-		if (!(phy->nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
-			phy->ops.setup_internal_link =
+		phy->ops.setup_internal_link =
 					      ixgbe_setup_internal_phy_t_x550em;
-		} else {
-			speed = IXGBE_LINK_SPEED_10GB_FULL |
-				IXGBE_LINK_SPEED_1GB_FULL;
-			ret_val = ixgbe_setup_kr_speed_x550em(hw, speed);
-		}
 
 		/* setup SW LPLU only for first revision */
 		if (!(IXGBE_FUSES0_REV1 & IXGBE_READ_REG(hw,
@@ -1962,43 +1955,50 @@ s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw)
 	if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
 		return IXGBE_ERR_CONFIG;
 
-	/* If link is not up, then there is no setup necessary so return  */
-	status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
-	if (status != IXGBE_SUCCESS)
-		return status;
+	if (!(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
+		/* If link is down, there is no setup necessary so return  */
+		status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
+		if (status != IXGBE_SUCCESS)
+			return status;
 
-	if (!link_up)
-		return IXGBE_SUCCESS;
+		if (!link_up)
+			return IXGBE_SUCCESS;
 
-	status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT,
-				      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				      &speed);
-	if (status != IXGBE_SUCCESS)
-		return status;
+		status = hw->phy.ops.read_reg(hw,
+					      IXGBE_MDIO_AUTO_NEG_VENDOR_STAT,
+					      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
+					      &speed);
+		if (status != IXGBE_SUCCESS)
+			return status;
 
-	/* If link is not still up, then no setup is necessary so return */
-	status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
-	if (status != IXGBE_SUCCESS)
-		return status;
-	if (!link_up)
-		return IXGBE_SUCCESS;
+		/* If link is still down - no setup is required so return */
+		status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
+		if (status != IXGBE_SUCCESS)
+			return status;
+		if (!link_up)
+			return IXGBE_SUCCESS;
 
-	/* clear everything but the speed and duplex bits */
-	speed &= IXGBE_MDIO_AUTO_NEG_VENDOR_STATUS_MASK;
+		/* clear everything but the speed and duplex bits */
+		speed &= IXGBE_MDIO_AUTO_NEG_VENDOR_STATUS_MASK;
 
-	switch (speed) {
-	case IXGBE_MDIO_AUTO_NEG_VENDOR_STATUS_10GB_FULL:
-		force_speed = IXGBE_LINK_SPEED_10GB_FULL;
-		break;
-	case IXGBE_MDIO_AUTO_NEG_VENDOR_STATUS_1GB_FULL:
-		force_speed = IXGBE_LINK_SPEED_1GB_FULL;
-		break;
-	default:
-		/* Internal PHY does not support anything else */
-		return IXGBE_ERR_INVALID_LINK_SETTINGS;
-	}
+		switch (speed) {
+		case IXGBE_MDIO_AUTO_NEG_VENDOR_STATUS_10GB_FULL:
+			force_speed = IXGBE_LINK_SPEED_10GB_FULL;
+			break;
+		case IXGBE_MDIO_AUTO_NEG_VENDOR_STATUS_1GB_FULL:
+			force_speed = IXGBE_LINK_SPEED_1GB_FULL;
+			break;
+		default:
+			/* Internal PHY does not support anything else */
+			return IXGBE_ERR_INVALID_LINK_SETTINGS;
+		}
 
-	return ixgbe_setup_ixfi_x550em(hw, &force_speed);
+		return ixgbe_setup_ixfi_x550em(hw, &force_speed);
+	} else {
+		speed = IXGBE_LINK_SPEED_10GB_FULL |
+			IXGBE_LINK_SPEED_1GB_FULL;
+		return ixgbe_setup_kr_speed_x550em(hw, speed);
+	}
 }
 
 /**
@@ -3160,3 +3160,4 @@ s32 ixgbe_led_off_t_X550em(struct ixgbe_hw *hw, u32 led_idx)
 
 	return IXGBE_SUCCESS;
 }
+
-- 
1.9.3

  parent reply	other threads:[~2015-11-20  7:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20  7:17 [dpdk-dev] [PATCH 00/17] Update ixgbe base code Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 01/17] ixgbe/base: update README Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 02/17] ixgbe/base: avoid needless PHY access on copper phys Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 03/17] ixgbe/base: do not wait for signature rule addition Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 04/17] ixgbe/base: use mvals values instead of defines Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 05/17] ixgbe/base: add Single-port Sage Pond device ID Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 06/17] ixgbe/base: remove driver config of KX4 PHY Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 07/17] ixgbe/base: add Flow Control Ethertype to ETQF filter list Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 08/17] ixgbe/base: add KR mode support Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 09/17] ixgbe/base: add flow director drop queue Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 10/17] ixgbe/base: check mac type for iosf and phy Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 11/17] ixgbe/base: configure x550 MDIO clock speed Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 12/17] ixgbe/base: fill at least min credits to a TC credit refills Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 13/17] ixgbe/base: support new thermal alarm Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 14/17] ixgbe/base: add new iXFI configuration helper function Wenzhuo Lu
2015-11-20  7:17 ` Wenzhuo Lu [this message]
2015-11-20  7:17 ` [dpdk-dev] [PATCH 16/17] ixgbe/base: new defines for FW Wenzhuo Lu
2015-11-20  7:17 ` [dpdk-dev] [PATCH 17/17] ixgbe: add new device X550T1 Wenzhuo Lu
2015-11-20 16:41   ` Stephen Hemminger
2016-01-14  8:48 ` [dpdk-dev] [PATCH 00/17] Update ixgbe base code Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448003879-29960-16-git-send-email-wenzhuo.lu@intel.com \
    --to=wenzhuo.lu@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).