From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 1D4102B83; Tue, 20 Nov 2018 22:08:26 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id 96so3470474wrb.2; Tue, 20 Nov 2018 13:08:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:mime-version; bh=P8nLNEhyesPuO4lIGDsq9L5jVZBbjCiJBcHEJdV7s44=; b=A9ojvrlfvnZ4lCBzCAG9PhnRXRHasN5t3a+m9fi8iQCzOsEHm3ge0Gibz7CTyRBzSd xIUpZOgnnKjomVL/tAtHReS4PrfgC+tz7JBZAfP0Z4t3mnB9vmb2e/fUG4K4sbNsmYRl iaZliY4UO4xutU/vE3tlacM4S1HYIDJgM8AZXRlu5tk065Y79PW1NBEa7mFWFG5lQJ4g /hr0iQAby4cBaDV5GAVFhQcR4DRTinnGQblMxtECUBswZuNaKxNQZcqPODFMfuSBnqlI 3TPaP7+5BUDWLutHOzYBr18DktnciZ37dQChqKB0jknHcK3XEz37DcX5bp+N84R0yFzc D7RQ== X-Gm-Message-State: AA+aEWb/4tBeGL2H4a9Z/gmmqMVeh5CPg3xUVjKCMM1ZfHipuWBoCKln +Txq459ItUk2+3J4YbfrZlw= X-Google-Smtp-Source: AFSGD/WeFuv0G8s4Uw90+L94GYDdSKmMQs4e3h1v5h+vCBvSX3FjDOZf+A2zvnq1fGSb9HoCVXbVbg== X-Received: by 2002:adf:9467:: with SMTP id 94mr3336589wrq.305.1542748105461; Tue, 20 Nov 2018 13:08:25 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:34a8:a417:adce:5308]) by smtp.gmail.com with ESMTPSA id 134-v6sm40756653wmp.6.2018.11.20.13.08.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Nov 2018 13:08:24 -0800 (PST) Message-ID: <1542748103.27590.2.camel@debian.org> From: Luca Boccassi To: "Zhang, Qi Z" , "dev@dpdk.org" Cc: "Lu, Wenzhuo" , "Ananyev, Konstantin" , "3chas3@gmail.com" <3chas3@gmail.com>, "stable@dpdk.org" Date: Tue, 20 Nov 2018 21:08:23 +0000 In-Reply-To: <039ED4275CED7440929022BC67E70611532E8C42@SHSMSX103.ccr.corp.intel.com> References: <20181102151848.18024-1-bluca@debian.org> <20181120112712.1261-1-bluca@debian.org> <039ED4275CED7440929022BC67E70611532E8C42@SHSMSX103.ccr.corp.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Subject: Re: [dpdk-dev] [dpdk-stable] [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 21:08:26 -0000 On Tue, 2018-11-20 at 19:52 +0000, Zhang, Qi Z wrote: > > -----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 >=20 > The patch is OK for me, but here is some coding style need to fix. >=20 > Reviewed-by: Qi Zhang Thanks for the review! I intentionally left the checkpatch complaint unfixed as it applies just the same to the other existing lines above and below the addition of this patch, so it makes more sense for it to be fixed (if desired) separately and for all affected lines. > > --- > > v4: dropped first patch, no longer necessary in 18.11 > >=20 > > =C2=A0drivers/net/ixgbe/base/ixgbe_82599.c |=C2=A0=C2=A02 ++ > > =C2=A0drivers/net/ixgbe/base/ixgbe_phy.c=C2=A0=C2=A0=C2=A0| 13 ++++++++= +++++ > > =C2=A0drivers/net/ixgbe/base/ixgbe_phy.h=C2=A0=C2=A0=C2=A0|=C2=A0=C2=A0= 1 + > > =C2=A0drivers/net/ixgbe/base/ixgbe_type.h=C2=A0=C2=A0|=C2=A0=C2=A02 ++ > > drivers/net/ixgbe/base/ixgbe_x550.c=C2=A0=C2=A0|=C2=A0=C2=A04 ++++ > > =C2=A05 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, > > =C2=A0 /* Check if 1G SFP module. */ > > =C2=A0 if (hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_cu_core0 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1= g_cu_core1 || > > + =C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lha= _core0 || > > + =C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_lha= _core1 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1= g_lx_core0 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1= g_lx_core1 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1= g_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) > > =C2=A0 else > > =C2=A0 hw->phy.sfp_type =3D > > =C2=A0 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; > > =C2=A0 } else { > > =C2=A0 hw->phy.sfp_type =3D > > ixgbe_sfp_type_unknown; > > =C2=A0 } > > @@ -1489,6 +1496,8 @@ s32 ixgbe_identify_sfp_module_generic(struct > > ixgbe_hw *hw) > > =C2=A0 if (comp_codes_10g =3D=3D 0 && > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0!(hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_cu_core1 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_cu_core0 || > > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_lha_core0 || > > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_lha_core1 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_lx_core0 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_lx_core1 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hw->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) > > =C2=A0 if (!(enforce_sfp & > > IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP) && > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0!(hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_cu_core0 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_cu_core1 || > > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_lha_core0 || > > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_lha_core1 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_lx_core0 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_lx_core1 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hw->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, > > =C2=A0 =C2=A0*/ > > =C2=A0 if (sfp_type =3D=3D ixgbe_sfp_type_da_act_lmt_core0 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0sfp_type =3D=3D ixgbe_sfp_type_1g_lx_cor= e0 || > > + =C2=A0=C2=A0=C2=A0=C2=A0sfp_type =3D=3D ixgbe_sfp_type_1g_lha_core0 |= | > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0sfp_type =3D=3D ixgbe_sfp_type_1g_cu_cor= e0 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0sfp_type =3D=3D ixgbe_sfp_type_1g_sx_cor= e0) > > =C2=A0 sfp_type =3D ixgbe_sfp_type_srlr_core0; > > =C2=A0 else if (sfp_type =3D=3D ixgbe_sfp_type_da_act_lmt_core1 || > > =C2=A0 =C2=A0sfp_type =3D=3D ixgbe_sfp_type_1g_lx_core1 || > > + =C2=A0sfp_type =3D=3D ixgbe_sfp_type_1g_lha_core1 || > > =C2=A0 =C2=A0sfp_type =3D=3D ixgbe_sfp_type_1g_cu_core1 || > > =C2=A0 =C2=A0sfp_type =3D=3D ixgbe_sfp_type_1g_sx_core1) > > =C2=A0 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 @@ > > =C2=A0#define IXGBE_SFF_1GBASESX_CAPABLE 0x1 > > =C2=A0#define IXGBE_SFF_1GBASELX_CAPABLE 0x2 > > =C2=A0#define IXGBE_SFF_1GBASET_CAPABLE 0x8 > > +#define IXGBE_SFF_1GBASELHA_CAPABLE 0x10 > > =C2=A0#define IXGBE_SFF_10GBASESR_CAPABLE 0x10 > > =C2=A0#define IXGBE_SFF_10GBASELR_CAPABLE 0x20 > > =C2=A0#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 { > > =C2=A0 ixgbe_sfp_type_1g_sx_core1 =3D 12, > > =C2=A0 ixgbe_sfp_type_1g_lx_core0 =3D 13, > > =C2=A0 ixgbe_sfp_type_1g_lx_core1 =3D 14, > > + ixgbe_sfp_type_1g_lha_core0 =3D 15, > > + ixgbe_sfp_type_1g_lha_core1 =3D 16, > > =C2=A0 ixgbe_sfp_type_not_present =3D 0xFFFE, > > =C2=A0 ixgbe_sfp_type_unknown =3D 0xFFFF > > =C2=A0}; > > 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) > > =C2=A0 case ixgbe_sfp_type_1g_sx_core1: > > =C2=A0 case ixgbe_sfp_type_1g_lx_core0: > > =C2=A0 case ixgbe_sfp_type_1g_lx_core1: > > + case ixgbe_sfp_type_1g_lha_core0: > > + case ixgbe_sfp_type_1g_lha_core1: > > =C2=A0 *linear =3D false; > > =C2=A0 break; > > =C2=A0 case ixgbe_sfp_type_unknown: > > @@ -1874,6 +1876,8 @@ s32 ixgbe_get_link_capabilities_X550em(struct > > ixgbe_hw *hw, > > =C2=A0 /* Check if 1G SFP module. */ > > =C2=A0 if (hw->phy.sfp_type =3D=3D ixgbe_sfp_type_1g_sx_core0 > > || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D ixgbe_sfp_type_= 1g_sx_core1 > > + =C2=A0=C2=A0=C2=A0=C2=A0|| hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_lha_core0 || > > + =C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_lha_core1 > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0|| hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_lx_core0 || > > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0hw->phy.sfp_type =3D=3D > > ixgbe_sfp_type_1g_lx_core1) { > > =C2=A0 *speed =3D IXGBE_LINK_SPEED_1GB_FULL; > > -- > > 2.19.1 >=20 >=20 --=20 Kind regards, Luca Boccassi