Thread (18 messages) 18 messages, 5 authors, 2012-10-22

RE: [net-next 12/13] ixgbe: Add support for pipeline reset

flat view

From: Skidmore, Donald C <hidden>
Date: 2012-10-22 20:45:53

-----Original Message-----
From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Martin Josefsson
Sent: Sunday, October 21, 2012 5:06 AM
To: Kirsher, Jeffrey T
Cc: davem@davemloft.net; Skidmore, Donald C; netdev@vger.kernel.org; gospo@redhat.com; sassmann@redhat.com
Subject: Re: [net-next 12/13] ixgbe: Add support for pipeline reset

On Sat, Oct 20, 2012 at 8:26 AM, Jeff Kirsher [off-list ref] wrote:
From: Don Skidmore <redacted>
Hi Jeff, Don,
Calling the ixgbe_reset_pipeline_82599 function will ensure a full 
pipeline reset on all 82599 devices.  This is necessary to avoid possible link issues.
Since this patch accomplishes this by modifying AUTOC.LMS we need to 
wrap all AUTOC writes when LESM is enabled.
The section below doesn't look right.
Old behaviour gave LMS == 011b (SFI)
New behaviour gives LMS == 000b (1 GbE link (no backplane auto-negotiation))

LMS is reset to 0 before ixgbe_reset_pipeline_82599() is called.
Looks like that part of the old code wasn't removed.
quoted hunk ↗ jump to hunk
@@ -137,28 +135,37 @@ static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
                usleep_range(hw->eeprom.semaphore_delay * 1000,
                             hw->eeprom.semaphore_delay * 2000);

+               /* Need SW/FW semaphore around AUTOC writes if LESM on,
+                * likewise reset_pipeline requires lock as it also writes
+                * AUTOC.
+                */
+               if (ixgbe_verify_lesm_fw_enabled_82599(hw)) {
+                       ret_val = hw->mac.ops.acquire_swfw_sync(hw,
+                                                       IXGBE_GSSR_MAC_CSR_SM);
+                       if (ret_val)
+                               goto setup_sfp_out;
+
+                       got_lock = true;
+               }
+
                /* Now restart DSP by setting Restart_AN and clearing LMS */
                IXGBE_WRITE_REG(hw, IXGBE_AUTOC, ((IXGBE_READ_REG(hw,
                                IXGBE_AUTOC) & ~IXGBE_AUTOC_LMS_MASK) |
                                IXGBE_AUTOC_AN_RESTART));

-               /* Wait for AN to leave state 0 */
-               for (i = 0; i < 10; i++) {
-                       usleep_range(4000, 8000);
-                       reg_anlp1 = IXGBE_READ_REG(hw, IXGBE_ANLP1);
-                       if (reg_anlp1 & IXGBE_ANLP1_AN_STATE_MASK)
-                               break;
+               ret_val = ixgbe_reset_pipeline_82599(hw);
+
+               if (got_lock) {
+                       hw->mac.ops.release_swfw_sync(hw,
+                                                     IXGBE_GSSR_MAC_CSR_SM);
+                       got_lock = false;
                }
-               if (!(reg_anlp1 & IXGBE_ANLP1_AN_STATE_MASK)) {
-                       hw_dbg(hw, "sfp module setup not complete\n");
+
+               if (ret_val) {
+                       hw_dbg(hw, " sfp module setup not 
+ complete\n");
                        ret_val = IXGBE_ERR_SFP_SETUP_NOT_COMPLETE;
                        goto setup_sfp_out;
                }
-
-               /* Restart DSP by setting Restart_AN and return to SFI mode */
-               IXGBE_WRITE_REG(hw, IXGBE_AUTOC, (IXGBE_READ_REG(hw,
-                               IXGBE_AUTOC) | IXGBE_AUTOC_LMS_10G_SERIAL |
-                               IXGBE_AUTOC_AN_RESTART));
        }

 setup_sfp_out:
--
/Martin
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html

Hi Martin,

Thanks for pointing this problem out and I believe I see what is wrong.  I'll work with Jeff to get a new patch created and tested.

Thanks again,
-Don Skidmore [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help