From patchwork Thu Nov 1 14:04:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 47678 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 854811B1D6; Thu, 1 Nov 2018 15:04:34 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 97544559A; Thu, 1 Nov 2018 15:04:32 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id x12-v6so20198256wrw.8; Thu, 01 Nov 2018 07:04:32 -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:mime-version:content-transfer-encoding; bh=t9rbgefZa+FKltzT6l0uoUYF9+Rj44108VO9Ktb7DyY=; b=tBsKFLsDGs65V9C6p8NFjG8veg/aOX48ywiD67lWIh7vCG9rwKR8D1PXunm3wIuStY JSEDoJVJsy/wtORMmnMiugpEHOu07IG5x2j/u+XhoJ97DVDbZe/Vym/Clt+kCEhHQRg0 fZGIY0D83ykSFMOcizVu70KuAPnNHngdOUvoUTpENDXIHPH+bl9vGo/AG6+2FLVyeuwD oCwwMaV1dVyQ6CkxNkZjpLR8zx4IJX9tpaGBXNF8TM5uEVm2KIa+0AlrWFpYheDnuZfc +oFLuPiE2T5JJi+obXymw7zyT/zAhnclD4NPR40udTv9cF7qZ08ddWvj5pJ5rsJIGZ4j /ioA== X-Gm-Message-State: AGRZ1gKaXHD/XFDYG21Xfqki+xYfXycw/eS3afX1PIyiS4YfIFL8zpuI G5WB3a2PIYddaiT6ub3qnD7Fn2oBNdc= X-Google-Smtp-Source: AJdET5ektvw8s/s15U98QszqHsI8JUmLg0+/uW2cwi8D8f1RD50Iynzef30pkG7cuw0ZplDBdwfnGQ== X-Received: by 2002:a5d:5012:: with SMTP id e18-v6mr6074591wrt.99.1541081071789; Thu, 01 Nov 2018 07:04:31 -0700 (PDT) Received: from localhost ([2001:1be0:110d:fcfe:70c5:32f6:c5b6:39e6]) by smtp.gmail.com with ESMTPSA id b8-v6sm11014302wrt.49.2018.11.01.07.04.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Nov 2018 07:04:30 -0700 (PDT) From: Luca Boccassi To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, qi.z.zhang@intel.com, Luca Boccassi , stable@dpdk.org Date: Thu, 1 Nov 2018 14:04:12 +0000 Message-Id: <20181101140413.18665-1-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20180815170932.23536-1-bluca@debian.org> References: <20180815170932.23536-1-bluca@debian.org> MIME-Version: 1.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 --- v2: refresh to remove merge conflict with master 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 f7b98af52..83b394861 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -315,13 +315,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_sfp_module_X550em(hw); + status = ixgbe_identify_sfp_module_X550em(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); @@ -329,8 +337,13 @@ STATIC s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) /* Fallthrough */ case IXGBE_DEV_ID_X550EM_A_SFP_N: - return ixgbe_identify_sfp_module_X550em(hw); - break; + status = ixgbe_identify_sfp_module_X550em(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 Thu Nov 1 14:04:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 47679 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 622321B3D7; Thu, 1 Nov 2018 15:04:36 +0100 (CET) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 68AA1559A; Thu, 1 Nov 2018 15:04:34 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id y16so20208594wrw.3; Thu, 01 Nov 2018 07:04:34 -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:mime-version:content-transfer-encoding; bh=NXG94gLYrFjZgAKAeBmJdDRjgfa8pqZkudEQAsFfg0Q=; b=GKdx8fooQrBjnUWCpzOtgzslRG7a7bQxiGf+87ezBJ46/PuLN9rhga8RG/NRVZZ4TZ AT4MGFSTwsyXHeQnTdy2yxmuhTSRFtBiDVrnovbTZhfs/wf4NHbP8WZhxfNn7WwtAaK4 hl3feSHZp7GLwwDy1SbWooDI1avzLS2TvEbPJUMkIZPU5tC+4bcEW3sE7FVUQCTOYpqV jtms0ZDFkQMhGPnTIH6/llXAbvlvbtVQHQi23JJ7J7NnsN2XZc6Z6MHd8Ag6K0PJrCk9 8Ehb9JEbGkN5kVWydqbZtOt59yjfPIHGtr8BXTvx7U/tS2oq9lMw/1aV22qdQU2QYyBv YEEw== X-Gm-Message-State: AGRZ1gJryy4H9mKA0P4kXSn0gqxS+FsjFW1TXb1LGsAPmyKS5Vvird+N H85NSEsKDudoMRFSQ0rU7c2acBSFGuM= X-Google-Smtp-Source: AJdET5cM0DJdQwnmerVkPwXerNCOwGnz50PrKsRxDtZfbm6DRUtBtmcPT1OmAA08lHazGTSOXSfhqg== X-Received: by 2002:a5d:5045:: with SMTP id h5-v6mr6867607wrt.210.1541081073719; Thu, 01 Nov 2018 07:04:33 -0700 (PDT) Received: from localhost ([2001:1be0:110d:fcfe:70c5:32f6:c5b6:39e6]) by smtp.gmail.com with ESMTPSA id 21-v6sm13685810wmv.5.2018.11.01.07.04.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Nov 2018 07:04:32 -0700 (PDT) From: Luca Boccassi To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, qi.z.zhang@intel.com, Luca Boccassi , stable@dpdk.org Date: Thu, 1 Nov 2018 14:04:13 +0000 Message-Id: <20181101140413.18665-2-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181101140413.18665-1-bluca@debian.org> References: <20180815170932.23536-1-bluca@debian.org> <20181101140413.18665-1-bluca@debian.org> MIME-Version: 1.0 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 7de753fd3..96bdde62c 100644 --- a/drivers/net/ixgbe/base/ixgbe_82599.c +++ b/drivers/net/ixgbe/base/ixgbe_82599.c @@ -392,6 +392,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 6cdd8fbab..dd118f917 100644 --- a/drivers/net/ixgbe/base/ixgbe_phy.c +++ b/drivers/net/ixgbe/base/ixgbe_phy.c @@ -1402,6 +1402,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; } @@ -1489,6 +1496,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 || @@ -1508,6 +1517,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 || @@ -1835,11 +1846,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 132fa542b..f1605f2cc 100644 --- a/drivers/net/ixgbe/base/ixgbe_phy.h +++ b/drivers/net/ixgbe/base/ixgbe_phy.h @@ -41,6 +41,7 @@ #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 cee6ba2e0..077b8f01c 100644 --- a/drivers/net/ixgbe/base/ixgbe_type.h +++ b/drivers/net/ixgbe/base/ixgbe_type.h @@ -3724,6 +3724,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 83b394861..d2b1000e9 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -1547,6 +1547,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: @@ -1887,6 +1889,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;