From patchwork Wed Aug 15 17:09:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 43720 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BEED73772; Wed, 15 Aug 2018 19:09:46 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 9367D324B; Wed, 15 Aug 2018 19:09:45 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id g1-v6so1733876wru.2; Wed, 15 Aug 2018 10:09:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=o9HqYJerh4kJ9w12YEYOjQgxZSx+zNRMgSeRpRtiBV0=; b=jWtUjjzLvgUXsz3hjHRxW2mhMlVoXxdlMAuA/ehptQ+pR1LR39lWS5j/FaJJg49F89 0PnV8nyabj49iJGDTKofhMRQesAyzoKRAtMM/hRFvQSU9eejG+TtMalLzESIi0at6UN8 0+d6WwO4F2NpAEChork83ItxyIuIumpC7SY2gwZ5umNaBpZbZhORKFRttpISO6eJT5UY bHwihHhQdl8TIl90pD1nvEf0JPKst8DYav+cuGAk+ikM/dRzSBp+lNgMEHjzRu53aZRg /8aclyW09sGoqhLABh0SzFiHGdtDygE5qdjhpncqss107l4gtSEReDxe3SGzfKmWrko3 T3UQ== X-Gm-Message-State: AOUpUlHag+m/06U9qEOaLyf77b/0axPRf115nx0p+tC3Z+JrRmiA02m3 /nV7lvQcvt9T2dtouHgIQNTLBQPn X-Google-Smtp-Source: AA+uWPyiUUIEc7ycQQyRp5MLs7fMpbbwLeUbz2pQrvw+KGcQY/SfaQUmE/BxAmvUCEc7XgHoYReH7Q== X-Received: by 2002:adf:ed8e:: with SMTP id c14-v6mr16387086wro.264.1534352984907; Wed, 15 Aug 2018 10:09:44 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id q188-v6sm4392077wmd.36.2018.08.15.10.09.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Aug 2018 10:09:43 -0700 (PDT) From: Luca Boccassi To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, Luca Boccassi , stable@dpdk.org Date: Wed, 15 Aug 2018 18:09:31 +0100 Message-Id: <20180815170932.23536-1-bluca@debian.org> X-Mailer: git-send-email 2.18.0 Subject: [dpdk-dev] [PATCH 1/2] net/ixgbe: fix x550 code to handle unidentified PHY 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" ixgbe_identify_phy_x550em() was missing the code to handle unidentified PHY that has been there in 82599 so it was not able to complete initialization of ixgbe sequence if no sfp plugged in. Port it over to return an appropriate type and complete init sequence properly. Fixes: d2e72774e58c ("ixgbe/base: support X550") Cc: stable@dpdk.org Signed-off-by: Luca Boccassi --- drivers/net/ixgbe/base/ixgbe_x550.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c index f66f540761..ef51b6a9a6 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -343,13 +343,21 @@ STATIC void ixgbe_setup_mux_ctl(struct ixgbe_hw *hw) */ STATIC s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) { + s32 status; + hw->mac.ops.set_lan_id(hw); ixgbe_read_mng_if_sel_x550em(hw); switch (hw->device_id) { case IXGBE_DEV_ID_X550EM_A_SFP: - return ixgbe_identify_module_generic(hw); + status = ixgbe_identify_module_generic(hw); + /* Set PHY type none if no PHY detected */ + if (hw->phy.type == ixgbe_phy_unknown) { + hw->phy.type = ixgbe_phy_none; + return IXGBE_SUCCESS; + } + return status; case IXGBE_DEV_ID_X550EM_X_SFP: /* set up for CS4227 usage */ ixgbe_setup_mux_ctl(hw); @@ -357,8 +365,13 @@ STATIC s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) /* Fallthrough */ case IXGBE_DEV_ID_X550EM_A_SFP_N: - return ixgbe_identify_module_generic(hw); - break; + status = ixgbe_identify_module_generic(hw); + /* Set PHY type none if no PHY detected */ + if (hw->phy.type == ixgbe_phy_unknown) { + hw->phy.type = ixgbe_phy_none; + return IXGBE_SUCCESS; + } + return status; case IXGBE_DEV_ID_X550EM_X_KX4: hw->phy.type = ixgbe_phy_x550em_kx4; break; From patchwork Wed Aug 15 17:09:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 43721 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7DD864C6F; Wed, 15 Aug 2018 19:09:52 +0200 (CEST) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 33A0744C3; Wed, 15 Aug 2018 19:09:51 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id l2-v6so13492651wme.1; Wed, 15 Aug 2018 10:09:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=APkjbMA1ZKl+JB8N9qonsdgKmlDtB4cT9X3DEOsDHrQ=; b=oOhUniCoohHJJUPdZJwmCthZEWd+sjuONf1yVI1rbeZD/UsXUmoPTTwBqnLfttpiRd htxybbO245jArnYO4o6gEkhvtta8lAP3TO4mYu3y9WjSvZNjPx6iPBgnMXz+7XehTJ5Y M1S8vdu7HL0FdzfyBvsc8IWtfRahQSJV5+UffHjtGvDJGhhA+dU8frNXONi1brHITVK/ xFuRkHQtpp4bx4bO7MHfF/p2Lspapm4bHuyUSX3uWtpJ2QZ1HAmdOdzQHkC6Qs1OtqsE V+91yDJ9dWCCDXRgWglAwBOYM0INcuP3Uh2bMlzaATCY+nQo3AMhc2RMK+xcFQJ5nyGo +dZA== X-Gm-Message-State: AOUpUlHfNvZE812TfR6ulH5R0o6xGQ9oW+OOjq0UYcYeCtXr/z1iWqxI ITKuoASihqXgQ+ubyiQvRiyKAkaY X-Google-Smtp-Source: AA+uWPwdsz7CUQcvNPzeWZDNjAXeTzY2RQFLNhOLyco4TlcqrPqeoY5hAGxWHUkD4UNXT7sNhNgHMw== X-Received: by 2002:a1c:5bc7:: with SMTP id p190-v6mr13877157wmb.101.1534352990607; Wed, 15 Aug 2018 10:09:50 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id s5-v6sm17253114wro.33.2018.08.15.10.09.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Aug 2018 10:09:49 -0700 (PDT) From: Luca Boccassi To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, Luca Boccassi , stable@dpdk.org Date: Wed, 15 Aug 2018 18:09:32 +0100 Message-Id: <20180815170932.23536-2-bluca@debian.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180815170932.23536-1-bluca@debian.org> References: <20180815170932.23536-1-bluca@debian.org> Subject: [dpdk-dev] [PATCH 2/2] net/ixgbe: add LHA ID to x550 code 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" ixgbe is able to recognize 1G SX and LX id, but it is missing the LHA. Add it, so that it can handle LHA sfp plugin. Fixes: d2e72774e58c ("ixgbe/base: support X550") Cc: stable@dpdk.org Signed-off-by: Luca Boccassi --- drivers/net/ixgbe/base/ixgbe_82599.c | 2 ++ drivers/net/ixgbe/base/ixgbe_phy.c | 13 +++++++++++++ drivers/net/ixgbe/base/ixgbe_phy.h | 1 + drivers/net/ixgbe/base/ixgbe_type.h | 2 ++ drivers/net/ixgbe/base/ixgbe_x550.c | 4 ++++ 5 files changed, 22 insertions(+) diff --git a/drivers/net/ixgbe/base/ixgbe_82599.c b/drivers/net/ixgbe/base/ixgbe_82599.c index 26217212aa..0075404763 100644 --- a/drivers/net/ixgbe/base/ixgbe_82599.c +++ b/drivers/net/ixgbe/base/ixgbe_82599.c @@ -424,6 +424,8 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, /* Check if 1G SFP module. */ if (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 || hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 || + hw->phy.sfp_type == ixgbe_sfp_type_1g_lha_core0 || + hw->phy.sfp_type == ixgbe_sfp_type_1g_lha_core1 || hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 || hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 || hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || diff --git a/drivers/net/ixgbe/base/ixgbe_phy.c b/drivers/net/ixgbe/base/ixgbe_phy.c index 2df068ee30..e1e7a184c9 100644 --- a/drivers/net/ixgbe/base/ixgbe_phy.c +++ b/drivers/net/ixgbe/base/ixgbe_phy.c @@ -1431,6 +1431,13 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) else hw->phy.sfp_type = ixgbe_sfp_type_1g_lx_core1; + } else if (comp_codes_1g & IXGBE_SFF_1GBASELHA_CAPABLE) { + if (hw->bus.lan_id == 0) + hw->phy.sfp_type = + ixgbe_sfp_type_1g_lha_core0; + else + hw->phy.sfp_type = + ixgbe_sfp_type_1g_lha_core1; } else { hw->phy.sfp_type = ixgbe_sfp_type_unknown; } @@ -1518,6 +1525,8 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) if (comp_codes_10g == 0 && !(hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 || hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 || + hw->phy.sfp_type == ixgbe_sfp_type_1g_lha_core0 || + hw->phy.sfp_type == ixgbe_sfp_type_1g_lha_core1 || hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 || hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 || hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || @@ -1537,6 +1546,8 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) if (!(enforce_sfp & IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP) && !(hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 || hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 || + hw->phy.sfp_type == ixgbe_sfp_type_1g_lha_core0 || + hw->phy.sfp_type == ixgbe_sfp_type_1g_lha_core1 || hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 || hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 || hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || @@ -1864,11 +1875,13 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw, */ if (sfp_type == ixgbe_sfp_type_da_act_lmt_core0 || sfp_type == ixgbe_sfp_type_1g_lx_core0 || + sfp_type == ixgbe_sfp_type_1g_lha_core0 || sfp_type == ixgbe_sfp_type_1g_cu_core0 || sfp_type == ixgbe_sfp_type_1g_sx_core0) sfp_type = ixgbe_sfp_type_srlr_core0; else if (sfp_type == ixgbe_sfp_type_da_act_lmt_core1 || sfp_type == ixgbe_sfp_type_1g_lx_core1 || + sfp_type == ixgbe_sfp_type_1g_lha_core1 || sfp_type == ixgbe_sfp_type_1g_cu_core1 || sfp_type == ixgbe_sfp_type_1g_sx_core1) sfp_type = ixgbe_sfp_type_srlr_core1; diff --git a/drivers/net/ixgbe/base/ixgbe_phy.h b/drivers/net/ixgbe/base/ixgbe_phy.h index cf8cadd96a..5a5f995003 100644 --- a/drivers/net/ixgbe/base/ixgbe_phy.h +++ b/drivers/net/ixgbe/base/ixgbe_phy.h @@ -70,6 +70,7 @@ POSSIBILITY OF SUCH DAMAGE. #define IXGBE_SFF_1GBASESX_CAPABLE 0x1 #define IXGBE_SFF_1GBASELX_CAPABLE 0x2 #define IXGBE_SFF_1GBASET_CAPABLE 0x8 +#define IXGBE_SFF_1GBASELHA_CAPABLE 0x10 #define IXGBE_SFF_10GBASESR_CAPABLE 0x10 #define IXGBE_SFF_10GBASELR_CAPABLE 0x20 #define IXGBE_SFF_SOFT_RS_SELECT_MASK 0x8 diff --git a/drivers/net/ixgbe/base/ixgbe_type.h b/drivers/net/ixgbe/base/ixgbe_type.h index 6e03089eb9..2a384b71c5 100644 --- a/drivers/net/ixgbe/base/ixgbe_type.h +++ b/drivers/net/ixgbe/base/ixgbe_type.h @@ -3748,6 +3748,8 @@ enum ixgbe_sfp_type { ixgbe_sfp_type_1g_sx_core1 = 12, ixgbe_sfp_type_1g_lx_core0 = 13, ixgbe_sfp_type_1g_lx_core1 = 14, + ixgbe_sfp_type_1g_lha_core0 = 15, + ixgbe_sfp_type_1g_lha_core1 = 16, ixgbe_sfp_type_not_present = 0xFFFE, ixgbe_sfp_type_unknown = 0xFFFF }; diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c index ef51b6a9a6..f24c3c266c 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -1575,6 +1575,8 @@ STATIC s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear) case ixgbe_sfp_type_1g_sx_core1: case ixgbe_sfp_type_1g_lx_core0: case ixgbe_sfp_type_1g_lx_core1: + case ixgbe_sfp_type_1g_lha_core0: + case ixgbe_sfp_type_1g_lha_core1: *linear = false; break; case ixgbe_sfp_type_unknown: @@ -1915,6 +1917,8 @@ s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, /* Check if 1G SFP module. */ if (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1 + || hw->phy.sfp_type == ixgbe_sfp_type_1g_lha_core0 || + hw->phy.sfp_type == ixgbe_sfp_type_1g_lha_core1 || hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 || hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1) { *speed = IXGBE_LINK_SPEED_1GB_FULL;