]> git.droids-corp.org - dpdk.git/commitdiff
ixgbe/base: optimize link up time
authorWenzhuo Lu <wenzhuo.lu@intel.com>
Wed, 24 Jun 2015 03:26:25 +0000 (11:26 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 26 Jun 2015 10:59:05 +0000 (12:59 +0200)
This patch adds max_link_up_time parameter to mac structure.
This parameter is used to control maximum link polling time in
ixgbe_check_mac_link functions. It is required to prevent long wait
time on x550 PHY that have no external link.

Since x550 is handled by software, we have to reset internal (PHY to
PHY) link when external link changes, and after reset, we have to wait for
this link to be established. As a result of not having interrupts, we have
to poll for link state, and we know that this link comes up much faster
than default 9 seconds. This parameter is added to prevent waiting 9
seconds for link when external link is not established.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
drivers/net/ixgbe/base/ixgbe_82598.c
drivers/net/ixgbe/base/ixgbe_api.c
drivers/net/ixgbe/base/ixgbe_common.c
drivers/net/ixgbe/base/ixgbe_type.h

index 9bdbce481eba9a0af34b93afd613099c2fd7d1e9..9e65fffa0b267f97e6ddfa4ebd314da910fb2511 100644 (file)
@@ -659,7 +659,7 @@ STATIC s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw,
                hw->phy.ops.read_reg(hw, 0xC00C, IXGBE_TWINAX_DEV,
                                     &adapt_comp_reg);
                if (link_up_wait_to_complete) {
-                       for (i = 0; i < IXGBE_LINK_UP_TIME; i++) {
+                       for (i = 0; i < hw->mac.max_link_up_time; i++) {
                                if ((link_reg & 1) &&
                                    ((adapt_comp_reg & 1) == 0)) {
                                        *link_up = true;
@@ -688,7 +688,7 @@ STATIC s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw,
 
        links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
        if (link_up_wait_to_complete) {
-               for (i = 0; i < IXGBE_LINK_UP_TIME; i++) {
+               for (i = 0; i < hw->mac.max_link_up_time; i++) {
                        if (links_reg & IXGBE_LINKS_UP) {
                                *link_up = true;
                                break;
index 0c4f8d8b76a59c577c7fce9efb071156bc21cc01..64579ae844c91642abff88881bdc27e7c32fb2ac 100644 (file)
@@ -114,6 +114,7 @@ s32 ixgbe_init_shared_code(struct ixgbe_hw *hw)
                status = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
                break;
        }
+       hw->mac.max_link_up_time = IXGBE_LINK_UP_TIME;
 
        return status;
 }
index 17db352476e09ff6409c6c23353ce7d036a23f41..08754c8328336f8f1c83c3ee62bc0e300aba11b3 100644 (file)
@@ -4067,7 +4067,7 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
        }
 
        if (link_up_wait_to_complete) {
-               for (i = 0; i < IXGBE_LINK_UP_TIME; i++) {
+               for (i = 0; i < hw->mac.max_link_up_time; i++) {
                        if (links_reg & IXGBE_LINKS_UP) {
                                *link_up = true;
                                break;
index 8e72c89e957c4761a946b0a776966dba41bfcf52..881f34cca103fb58a8c8308ba4ef366db59c6bf0 100644 (file)
@@ -3830,6 +3830,7 @@ struct ixgbe_mac_info {
        bool thermal_sensor_enabled;
        struct ixgbe_dmac_config dmac_config;
        bool set_lben;
+       u32  max_link_up_time;
 };
 
 struct ixgbe_phy_info {