From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 997A411A4; Tue, 20 Nov 2018 20:52:37 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Nov 2018 11:52:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,258,1539673200"; d="scan'208";a="282772113" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga006.fm.intel.com with ESMTP; 20 Nov 2018 11:52:36 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 20 Nov 2018 11:52:36 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 20 Nov 2018 11:52:36 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.161]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.117]) with mapi id 14.03.0415.000; Wed, 21 Nov 2018 03:52:34 +0800 From: "Zhang, Qi Z" To: Luca Boccassi , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Ananyev, Konstantin" , "3chas3@gmail.com" <3chas3@gmail.com>, "stable@dpdk.org" Thread-Topic: [PATCH v4] net/ixgbe: add LHA ID to x550 code Thread-Index: AQHUgMQKVXElxam2VUK7kmpP6YvUxKVZE1wA Date: Tue, 20 Nov 2018 19:52:33 +0000 Message-ID: <039ED4275CED7440929022BC67E70611532E8C42@SHSMSX103.ccr.corp.intel.com> References: <20181102151848.18024-1-bluca@debian.org> <20181120112712.1261-1-bluca@debian.org> In-Reply-To: <20181120112712.1261-1-bluca@debian.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDdiMjU4N2EtYjEyNi00NDgzLWEzYTUtODgwMDdlOTJjNzA5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiYmVoWWpHNnBxU2NGdGtGZE5CVHh1bEtVczlTSzViRGN2elR1bUE2V3lKMmF4MkJGaHVBa0c3MFdcL29DdmpsXC9BIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4] 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: , X-List-Received-Date: Tue, 20 Nov 2018 19:52:38 -0000 > -----Original Message----- > From: Luca Boccassi [mailto:bluca@debian.org] > Sent: Tuesday, November 20, 2018 3:27 AM > To: dev@dpdk.org > Cc: Lu, Wenzhuo ; Ananyev, Konstantin > ; Zhang, Qi Z ; > 3chas3@gmail.com; Luca Boccassi ; stable@dpdk.org > Subject: [PATCH v4] net/ixgbe: add LHA ID to x550 code >=20 > 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. >=20 > Fixes: d2e72774e58c ("ixgbe/base: support X550") > Cc: stable@dpdk.org >=20 > Signed-off-by: Luca Boccassi The patch is OK for me, but here is some coding style need to fix. Reviewed-by: Qi Zhang > --- > v4: dropped first patch, no longer necessary in 18.11 >=20 > 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(+) >=20 > 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 =3D=3D ixgbe_sfp_type_1g_cu_core0 || > hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_cu_core1 || > + hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lha_core0 || > + hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lha_core1 || > hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lx_core0 || > hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lx_core1 || > hw->phy.sfp_type =3D=3D 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 =3D > ixgbe_sfp_type_1g_lx_core1; > + } else if (comp_codes_1g & IXGBE_SFF_1GBASELHA_CAPABLE) { > + if (hw->bus.lan_id =3D=3D 0) > + hw->phy.sfp_type =3D > + ixgbe_sfp_type_1g_lha_core0; > + else > + hw->phy.sfp_type =3D > + ixgbe_sfp_type_1g_lha_core1; > } else { > hw->phy.sfp_type =3D ixgbe_sfp_type_unknown; > } > @@ -1489,6 +1496,8 @@ s32 ixgbe_identify_sfp_module_generic(struct > ixgbe_hw *hw) > if (comp_codes_10g =3D=3D 0 && > !(hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_cu_core1 || > hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_cu_core0 || > + hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lha_core0 || > + hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lha_core1 || > hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lx_core0 || > hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lx_core1 || > hw->phy.sfp_type =3D=3D 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 =3D=3D ixgbe_sfp_type_1g_cu_core0 || > hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_cu_core1 || > + hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lha_core0 || > + hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lha_core1 || > hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lx_core0 || > hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lx_core1 || > hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_sx_core0 || @@ > -1835,11 +1846,13 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct > ixgbe_hw *hw, > */ > if (sfp_type =3D=3D ixgbe_sfp_type_da_act_lmt_core0 || > sfp_type =3D=3D ixgbe_sfp_type_1g_lx_core0 || > + sfp_type =3D=3D ixgbe_sfp_type_1g_lha_core0 || > sfp_type =3D=3D ixgbe_sfp_type_1g_cu_core0 || > sfp_type =3D=3D ixgbe_sfp_type_1g_sx_core0) > sfp_type =3D ixgbe_sfp_type_srlr_core0; > else if (sfp_type =3D=3D ixgbe_sfp_type_da_act_lmt_core1 || > sfp_type =3D=3D ixgbe_sfp_type_1g_lx_core1 || > + sfp_type =3D=3D ixgbe_sfp_type_1g_lha_core1 || > sfp_type =3D=3D ixgbe_sfp_type_1g_cu_core1 || > sfp_type =3D=3D ixgbe_sfp_type_1g_sx_core1) > sfp_type =3D 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 =3D 12, > ixgbe_sfp_type_1g_lx_core0 =3D 13, > ixgbe_sfp_type_1g_lx_core1 =3D 14, > + ixgbe_sfp_type_1g_lha_core0 =3D 15, > + ixgbe_sfp_type_1g_lha_core1 =3D 16, > ixgbe_sfp_type_not_present =3D 0xFFFE, > ixgbe_sfp_type_unknown =3D 0xFFFF > }; > diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c > b/drivers/net/ixgbe/base/ixgbe_x550.c > index f7b98af52..a920a146e 100644 > --- a/drivers/net/ixgbe/base/ixgbe_x550.c > +++ b/drivers/net/ixgbe/base/ixgbe_x550.c > @@ -1534,6 +1534,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 =3D false; > break; > case ixgbe_sfp_type_unknown: > @@ -1874,6 +1876,8 @@ s32 ixgbe_get_link_capabilities_X550em(struct > ixgbe_hw *hw, > /* Check if 1G SFP module. */ > if (hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_sx_core0 || > hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_sx_core1 > + || hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lha_core0 || > + hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lha_core1 > || hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lx_core0 || > hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lx_core1) { > *speed =3D IXGBE_LINK_SPEED_1GB_FULL; > -- > 2.19.1