From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 41FCD5678 for ; Sun, 4 Dec 2016 07:35:34 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 03 Dec 2016 22:35:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,740,1477983600"; d="scan'208";a="908483896" Received: from dpdk4.bj.intel.com ([172.16.182.178]) by orsmga003.jf.intel.com with ESMTP; 03 Dec 2016 22:35:31 -0800 From: Wei Dai To: helin.zhang@intel.com, konstantin.ananyev@intel.com Cc: dev@dpdk.org, Wei Dai Date: Sun, 4 Dec 2016 14:31:20 +0800 Message-Id: <1480833100-48545-9-git-send-email-wei.dai@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480833100-48545-1-git-send-email-wei.dai@intel.com> References: <1480833100-48545-1-git-send-email-wei.dai@intel.com> Subject: [dpdk-dev] [PATCH 09/29] net/ixgbe/base: enable LASI interrupts only for X552 devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2016 06:35:34 -0000 Enable the LASI interrupts on X552 devices to receive notifications of the link configurations of the external PHY and correspondingly support the configuration of the internal iXFI link, since iXFI does not support auto-negotiation. This is not required for X553 devices having KR support, which performs auto-negotiations and which is used as the internal link to the external PHY. Hence adding a check here to avoid enabling LASI interrupts for X553 devices. For X553 devices we get link notifications through LSC interrupts in the MAC. That should suffice to handle link notifications. The default value of "Link connect/disconnect mask" (IXGBE_MDIO_PMA_TX_VEN_LASI_INT_EN) in auto-neg transmit vendor interrupt mask 2 (7.D401) is 0. Hence added a check that disables code in ixgbe_x550.c/ixgbe_enable_lasi_ext_t_x550em() that sets this bit and hence retains the default value for this bit, for X553 devices. Signed-off-by: Wei Dai --- drivers/net/ixgbe/base/ixgbe_x550.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c index 28c7ce3..fecc8e6 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -2026,19 +2026,32 @@ STATIC s32 ixgbe_enable_lasi_ext_t_x550em(struct ixgbe_hw *hw) status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc); /* Enable link status change alarm */ - status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_PMA_TX_VEN_LASI_INT_MASK, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, ®); - if (status != IXGBE_SUCCESS) - return status; + /* Enable the LASI interrupts on X552 devices to receive notifications + * of the link configurations of the external PHY and correspondingly + * support the configuration of the internal iXFI link, since iXFI does + * not support auto-negotiation. This is not required for X553 devices + * having KR support, which performs auto-negotiations and which is used + * as the internal link to the external PHY. Hence adding a check here + * to avoid enabling LASI interrupts for X553 devices. + */ + if (hw->mac.type != ixgbe_mac_X550EM_a) { + status = hw->phy.ops.read_reg(hw, + IXGBE_MDIO_PMA_TX_VEN_LASI_INT_MASK, + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, ®); + + if (status != IXGBE_SUCCESS) + return status; - reg |= IXGBE_MDIO_PMA_TX_VEN_LASI_INT_EN; + reg |= IXGBE_MDIO_PMA_TX_VEN_LASI_INT_EN; - status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_PMA_TX_VEN_LASI_INT_MASK, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, reg); + status = hw->phy.ops.write_reg(hw, + IXGBE_MDIO_PMA_TX_VEN_LASI_INT_MASK, + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, reg); - if (status != IXGBE_SUCCESS) - return status; + if (status != IXGBE_SUCCESS) + return status; + } /* Enable high temperature failure and global fault alarms */ status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, -- 2.7.4