From: Ouyang Changchun <changchun.ouyang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 14/18] ixgbe: Remove unnecessary delay
Date: Thu, 25 Sep 2014 22:19:00 +0800 [thread overview]
Message-ID: <1411654744-9460-15-git-send-email-changchun.ouyang@intel.com> (raw)
In-Reply-To: <1411654744-9460-1-git-send-email-changchun.ouyang@intel.com>
This patch removes unnecessary delay when setting up physical link
and negotiating in IXGBE share code.
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
---
lib/librte_pmd_ixgbe/ixgbe/ixgbe_phy.c | 53 ++++------------------------------
1 file changed, 6 insertions(+), 47 deletions(-)
diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_phy.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_phy.c
index f39df9a..e1e560b 100644
--- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_phy.c
+++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_phy.c
@@ -713,16 +713,14 @@ s32 ixgbe_write_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
}
/**
- * ixgbe_setup_phy_link_generic - Set and restart autoneg
+ * ixgbe_setup_phy_link_generic - Set and restart auto-neg
* @hw: pointer to hardware structure
*
- * Restart autonegotiation and PHY and waits for completion.
+ * Restart auto-negotiation and PHY and waits for completion.
**/
s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw)
{
s32 status = IXGBE_SUCCESS;
- u32 time_out;
- u32 max_time_out = 10;
u16 autoneg_reg = IXGBE_MII_AUTONEG_REG;
bool autoneg = false;
ixgbe_link_speed speed;
@@ -783,7 +781,7 @@ s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw)
if (ixgbe_check_reset_blocked(hw))
return status;
- /* Restart PHY autonegotiation and wait for completion */
+ /* Restart PHY auto-negotiation. */
hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg);
@@ -792,25 +790,6 @@ s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw)
hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg);
- /* Wait for autonegotiation to finish */
- for (time_out = 0; time_out < max_time_out; time_out++) {
- usec_delay(10);
- /* Restart PHY autonegotiation and wait for completion */
- status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
- IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
- &autoneg_reg);
-
- autoneg_reg &= IXGBE_MII_AUTONEG_COMPLETE;
- if (autoneg_reg == IXGBE_MII_AUTONEG_COMPLETE)
- break;
- }
-
- if (time_out == max_time_out) {
- status = IXGBE_ERR_LINK_SETUP;
- ERROR_REPORT1(IXGBE_ERROR_POLLING,
- "PHY autonegotiation time out");
- }
-
return status;
}
@@ -934,16 +913,14 @@ s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
}
/**
- * ixgbe_setup_phy_link_tnx - Set and restart autoneg
+ * ixgbe_setup_phy_link_tnx - Set and restart auto-neg
* @hw: pointer to hardware structure
*
- * Restart autonegotiation and PHY and waits for completion.
+ * Restart auto-negotiation and PHY and waits for completion.
**/
s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw)
{
s32 status = IXGBE_SUCCESS;
- u32 time_out;
- u32 max_time_out = 10;
u16 autoneg_reg = IXGBE_MII_AUTONEG_REG;
bool autoneg = false;
ixgbe_link_speed speed;
@@ -1001,7 +978,7 @@ s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw)
if (ixgbe_check_reset_blocked(hw))
return status;
- /* Restart PHY autonegotiation and wait for completion */
+ /* Restart PHY auto-negotiation. */
hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg);
@@ -1010,24 +987,6 @@ s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw)
hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL,
IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg);
- /* Wait for autonegotiation to finish */
- for (time_out = 0; time_out < max_time_out; time_out++) {
- usec_delay(10);
- /* Restart PHY autonegotiation and wait for completion */
- status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
- IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
- &autoneg_reg);
-
- autoneg_reg &= IXGBE_MII_AUTONEG_COMPLETE;
- if (autoneg_reg == IXGBE_MII_AUTONEG_COMPLETE)
- break;
- }
-
- if (time_out == max_time_out) {
- status = IXGBE_ERR_LINK_SETUP;
- DEBUGOUT("ixgbe_setup_phy_link_tnx: time out");
- }
-
return status;
}
--
1.8.4.2
next prev parent reply other threads:[~2014-09-25 14:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-25 14:18 [dpdk-dev] [PATCH 00/18] Update IXGBE base code Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 01/18] ixgbe: Update comments and fix some comments typo in " Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 02/18] ixgbe: Clean up IXGBE base codes Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 03/18] ixgbe: New function to check command complete in IXGBE base code Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 04/18] ixgbe: Support cloud mode " Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 05/18] ixgbe: eeprom checksum calculation return new value " Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 06/18] ixgbe: New argument in host interface command function Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 07/18] ixgbe: Extend mask for SWFW semaphore Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 08/18] ixgbe: New function to read and write I2C bytes Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 09/18] ixgbe: Support new device id 82599_QSFP and 82599_LS Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 10/18] ixgbe: Modify time to wait in polling flash update Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 11/18] ixgbe: New error type Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 12/18] ixgbe: Use hardware MAC type for I2C control Ouyang Changchun
2014-09-25 14:18 ` [dpdk-dev] [PATCH 13/18] ixgbe: semaphore mask move into hardware physical information Ouyang Changchun
2014-09-25 14:19 ` Ouyang Changchun [this message]
2014-09-25 14:19 ` [dpdk-dev] [PATCH 15/18] ixgbe: New function for resetting VF register Ouyang Changchun
2014-09-25 14:19 ` [dpdk-dev] [PATCH 16/18] ixgbe: New functionalities in IXGBE base code Ouyang Changchun
2014-09-25 14:19 ` [dpdk-dev] [PATCH 17/18] ixgbe: Support X550 " Ouyang Changchun
2014-09-25 14:19 ` [dpdk-dev] [PATCH 18/18] ixgbe: Support X550 in IXGBE poll mode driver Ouyang Changchun
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=1411654744-9460-15-git-send-email-changchun.ouyang@intel.com \
--to=changchun.ouyang@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).