From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BBF39A0093; Thu, 17 Mar 2022 08:39:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 86D1D4067B; Thu, 17 Mar 2022 08:39:12 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 5BC1C40151 for ; Thu, 17 Mar 2022 08:39:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647502750; x=1679038750; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=rfa6o5Cxm5WRSwsTgTPpt/soXp2W15t1CqkLOuAPXl0=; b=RcwzbkWo1hksQj9wQUpvrChaaNBeCPBwTQb51gJkQJgjgWaCuEwfqXot Mkb1VV+LFMdmg9jPOKNBWQilsF6zyHJUF98ASxiBaadwOF7YN8ZruKp6C ejIBKgeCw8U2DFnnvk+Ch7zDcBgLKd1Yb3JfrX9NGhxeAhN92Qdu1orTi k+Y6mYPUagyZJcLSdKsyjYfsaxuFa3Nn1Cq8B88Oa1/jqm281W9NJO1G9 CfiZ1ac3DxbdojVIuYi9Im1lIjjpUL13IKHfhKKtAKESU08twCU7evMMC TgNnmwzmESmvftX2OgvvLTSmUTao2gzuZNceh44ck2jJzTUk8HRrhmqsw Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10288"; a="256994925" X-IronPort-AV: E=Sophos;i="5.90,188,1643702400"; d="scan'208";a="256994925" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2022 00:39:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,188,1643702400"; d="scan'208";a="599018081" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga008.fm.intel.com with ESMTP; 17 Mar 2022 00:39:09 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 17 Mar 2022 00:39:08 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 17 Mar 2022 00:39:08 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Thu, 17 Mar 2022 00:39:08 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.108) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Thu, 17 Mar 2022 00:39:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MI69lYco3YpuwY3+ZtQbsLXPMiPFJ0A3alHm37XtAh+rGoHbz8iaQKdUK8x0Afs+2MKvqzTsND6hn22G4h1uLy0Xwn0bPEG9oB110D6F36Ib+ziwU9qLzcTxAWmRb0DyrY7zJmvcSRdcdk4J3NagUskT7KvEMkZoL4mLP602YuyLLaNTpoBsSo/wEqzFBHLrytCOJ1M5fHDDYL+yJK7CPZOtoFLFyAEIi3D2NINXjtHOSHb/tJRnWBTetVnduZlpgdYkEg/AvWWbo/AQcnIyxruWFk03dhX7Kh4p+i5TrZr/T3g9ZPSmE6ySFkBNdtRuwjfE5w6trJsS/E+tdulx5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Xdns7alFY3nYiR18n1a85bt/26HtrBCX9mpJ5TWndfY=; b=lnW+1hkWX4EAtCHdV1Yi4LPUt6zDx2qF46939PFYdgfFZbLP8X55UjGswB3u6CsJVltP10zSfGF5gdVvQGGrE7ssULFWKH/CLJLn/9lO3K016pSnU0vQKHCUxYVV3S+MkRde1zJgryyGhdIzn25yxkMQvfedgQIK8L+VZltfD4XSCHgbO+TzTpD/6bKBPXSBmXdDyQj/wQ5PLT+19pJT8YrQA+liwEu/b39RYVcIOq9QR9S0pM+Z3ku/BMi1nFWRLIcVstWccG9LBr485PU1ku4SkOnXtUhjcVnnEML1VnY03Z5vghbnlEZlZMbRBkfV1INxebDbYlt5USHEzGrgiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BYAPR11MB3495.namprd11.prod.outlook.com (2603:10b6:a03:8a::14) by BN9PR11MB5276.namprd11.prod.outlook.com (2603:10b6:408:135::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.14; Thu, 17 Mar 2022 07:39:06 +0000 Received: from BYAPR11MB3495.namprd11.prod.outlook.com ([fe80::cc6f:9806:bca7:2297]) by BYAPR11MB3495.namprd11.prod.outlook.com ([fe80::cc6f:9806:bca7:2297%7]) with mapi id 15.20.5061.028; Thu, 17 Mar 2022 07:39:06 +0000 From: "Wang, Haiyue" To: "Daly, Jeff" , "dev@dpdk.org" CC: Stephen Douthit , "Daly, Jeff" Subject: RE: [PATCH] net/ixgbe: Retry SFP ID read field to handle misbehaving SFPs Thread-Topic: [PATCH] net/ixgbe: Retry SFP ID read field to handle misbehaving SFPs Thread-Index: AQHYMnN2OSsY5R5Kd0S/NDxX6Uzl/qzDPkbw Date: Thu, 17 Mar 2022 07:39:06 +0000 Message-ID: References: <20220307223337.27876-1-jeffd@silicom-usa.com> In-Reply-To: <20220307223337.27876-1-jeffd@silicom-usa.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 64b8e96e-0e4a-4adf-0307-08da07e9376b x-ms-traffictypediagnostic: BN9PR11MB5276:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GrmCJzTMeQZ65DsiNvD4mbb/ajW0bjm+Y2J/rn67DaB+5jPRUehOxhVYXUh+keUvbN7yHhMfY/vZ3OUMx77IVOPXPCV7xtTE/dRAXrsm949U8vvuGBwy185LccvmpxcvGMY+ODlLqyNHKGncwC/TwIEnK3sQUs9NTMKesF2bJAyCFx0+NHBLeWA/dYcY0j+TsvxQyKlLnVybXnnVDE+3vXVgOvyMj3yqVqc3nEvjOKlCRXkoUSNXwXlCeQ+g83G85epBnkTCWt4inv4dAtAvIT/6C+Lbt5lI89GyxcZZCykG5hhGy2oESvtiyhfZSc/QX4/eo0WhZ+Q1ziQ6F0m67/XWcVyKFs+i3Vl30sp+aduqAVrSC1EZPGHB+8fgMBw/aFniCSI3rcDT7+zef2jiVNZBJd2TZz8QJQfwyyPW2zyhxdKndn3mw55JMfKzF4sPaNBoFy7GGbqso7SPCPezvy58xEPU8KOaep7laih1W7ZQm0sUahmQSEvQFCfwQMzl3LafSdtetEbHg/A578n/IA61RR523GZkaUddYMSBoP6Eb/vG5UAxute7hwO9OWADTZlMOVqgRdUqobBtZ1kT/+JFxnx5FeYgqEwStKIaEWrA5FkWTpOVQ4pK+oJ6mQegM2L9yq5jXXRXn8yEbEYDq6CnJ5ohBTLHvWl9lfdS43G9aEeRu+giJs9WQXWp0gZfQ77pSElM2RBnk7RaTD0peg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3495.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(64756008)(55016003)(6506007)(4326008)(54906003)(7696005)(66946007)(110136005)(66476007)(71200400001)(8676002)(76116006)(508600001)(66556008)(53546011)(66446008)(316002)(5660300002)(52536014)(8936002)(9686003)(83380400001)(33656002)(38070700005)(86362001)(38100700002)(26005)(2906002)(186003)(82960400001)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?FxBrGpkcZaTHJV2xOjMketl42o/ltJgLAANACU3cn5WIkGMAxU1xeD0rXDF/?= =?us-ascii?Q?SYME3X6g7XyxJCk/oBvNEuQdrlfc6W2w3FH7p81pwU/nvapuvrksdwbCZOhz?= =?us-ascii?Q?bjMUzOjy4He+9TfpCxnrGPgests1M+k+JKMtN63Xv9RVs2+vz9cynCh0281k?= =?us-ascii?Q?z+/HEOR221sHj5tU8neivjgw2Wy0sSunU23x+nmZGGjMwOE54/nwUjhFd30h?= =?us-ascii?Q?P09q7Wt0zvfZMypNpbh0fz8E810JNWI2bSDqooR844J8gtueYg29hVrLo3Cx?= =?us-ascii?Q?aERJLGv7qw0HEVFaCnQChVNcaeXeUr52/cpWDkD//Q6uIy9zjFOvtqKbJtR7?= =?us-ascii?Q?0W3krLt/iRdkKHVrol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?us-ascii?Q?hRnha78OsI97fE3w8BKjOjqj5b0R1ziAGmD7bAQgh3DylOZ2uqcFlq2scUG/?= =?us-ascii?Q?/NyI/RdKNe731YUuznGM1Q7lDBBu3jvB/vEs4gjINLEuDIsE5Dv9dotFkqzv?= =?us-ascii?Q?qRVouI6rNNyp95mJC5qiLriFiDtzNb6vy+T5Xii3yP+HTLb5OLkaYtsqa/sw?= =?us-ascii?Q?bkxJP/7skAdK6oM7gETRrTjhZ0qF3L2L?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3495.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64b8e96e-0e4a-4adf-0307-08da07e9376b X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Mar 2022 07:39:06.3787 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WLTSwlF32cpqUhcDSSRA4v7JzoG1saUU5XJPi6Jj7Uh8COnPAAMCLqqhQYx5cK4DR9Xuc1ucB9z1Gjgr9oF38w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5276 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: jeffd@silicom-usa.com > Sent: Tuesday, March 8, 2022 06:34 > To: dev@dpdk.org > Cc: Stephen Douthit ; Daly, Jeff ; Wang, Haiyue > > Subject: [PATCH] net/ixgbe: Retry SFP ID read field to handle misbehaving= SFPs >=20 > From: Stephen Douthit >=20 > Some XGS-PON SFPs have been observed ACKing I2C reads and returning > uninitialized garbage while their uC boots. This can lead to the SFP ID > code marking an otherwise working SFP module as unsupported if a bogus > ID value is read while its internal PHY/microcontroller is still > booting. >=20 > Retry the ID read several times looking not just for NAK, but also for a > valid ID field. >=20 > Since the device isn't NAKing the trasanction the existing longer retry > code in ixgbe_read_i2c_byte_generic_int() doesn't apply here. >=20 > Signed-off-by: Stephen Douthit > Signed-off-by: Jeff Daly > --- > drivers/net/ixgbe/base/ixgbe_phy.c | 31 ++++++++++++++++++++++++++---- > 1 file changed, 27 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/net/ixgbe/base/ixgbe_phy.c b/drivers/net/ixgbe/base/= ixgbe_phy.c > index d8d51d2c3f..27bce066a1 100644 > --- a/drivers/net/ixgbe/base/ixgbe_phy.c > +++ b/drivers/net/ixgbe/base/ixgbe_phy.c > @@ -1275,6 +1275,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_= hw *hw) > + for (id_reads =3D 0; id_reads < 5; id_reads++) { > + status =3D hw->phy.ops.read_i2c_eeprom(hw, > + IXGBE_SFF_IDENTIFIER, > + &identifier); >=20 > - if (status !=3D IXGBE_SUCCESS) > + DEBUGOUT("status %d, id %d\n", status, identifier); DEBUGOUT("status %d, SFF identifier 0x%x\n", status, identifier); Since "#define IXGBE_SFF_IDENTIFIER_SFP 0x3" is hex value, and the ID is to= o simple. > + if (!status && > + identifier =3D=3D IXGBE_SFF_IDENTIFIER_SFP) > + break; > + } > + > + if (status !=3D IXGBE_SUCCESS) { > + DEBUGOUT("Failed SFF ID read (%d attempts)\n", id_reads); > goto err_read_i2c_eeprom; > + } This DEBUGOUT can be removed, it's redundant, every call for hw->phy.ops.re= ad_i2c_eeprom has added the DEBUOUT. >=20 > if (identifier !=3D IXGBE_SFF_IDENTIFIER_SFP) { > hw->phy.type =3D ixgbe_phy_sfp_unsupported; > -- > 2.25.1