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 66398A0508; Thu, 14 Apr 2022 12:50:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 07FF340687; Thu, 14 Apr 2022 12:50:01 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130090.outbound.protection.outlook.com [40.107.13.90]) by mails.dpdk.org (Postfix) with ESMTP id 5DECE40041; Thu, 14 Apr 2022 12:50:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h6u/tdFPoBL+pGQ12yPKB8zihL/LfMwbIrvUq16tSiicUMDe8H4ZbB/Upz2DVwnhyuuwBMDx2DfzhfKfqe/d/Rs9rbtV5VOuqkRSiRAnp4L1pJvzI2NdpvZL9qyo892cYImv4J6g+660jSh7pcp0nzMaLhJ7tIABR0e+XyiremzRcgspNE25065Cp66ZMuSaWdliNon08mg4fb3CTYjArFR3Rji8O34E8xYunnN+B93Kx3T6mgNaq9ScSvrZRqKEVzkbz91X3eLu8Rk7+gjdnR+MDV6MJtbE4p2eMCTpJIQuDNvhBIl3+yWXRjgxoGwG6JJqCErHIefkHGVNbrQpBQ== 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=0vwvlMrWCYJE/eWCuXhSIFIRY5aMcsdcLMroeyXpl+w=; b=gCow9nqHkNIOq9V1G6mWXTeqDUXJG9Kym5lTNmMJY457xRHN+bBESyECYjcipsoXlF/Mndc85KFyIs6tSkuVE8VdDmCCWes8w5OVBzVz6esiySiXaXKWGI7mL2ZN+0f4B2FD2JOVo9kXQwqjkiX2D86CP8t0M0zFwbr13NgFuUYTBuecInenjPu/EwRuPSY9Voexn64zIf77u5kmh0OOjXVEqGwpnhqJPS+Md/O216SPx9+YxfpS60cQ8lmBGAO14nwlyu+IRTMBnX/khpphfWBLlUSECzFg4fkLGWGsYiPA/hjNQOK/Stgy8364h5jpmsT9ImLf7b6/BZQZP/Zq6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silicom-usa.com; dmarc=pass action=none header.from=silicom-usa.com; dkim=pass header.d=silicom-usa.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=SILICOMLTD.onmicrosoft.com; s=selector2-SILICOMLTD-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0vwvlMrWCYJE/eWCuXhSIFIRY5aMcsdcLMroeyXpl+w=; b=olF+7FrRYB0zjvJNrliiI9eqPYgKzdAhQr5Ot2mEf+dt6xlNJAFm3Ym/w3UlfT9DbirdhvwgN2MJQ3XLEl/K/SxeoRTK4fvl5GpQdT+CBlEKvTlVJVTgClpag5KE/NSNscY4bYO/87I28kzM26xJHXkGQQ8neJrEzFB4dfC2se4= Received: from VI1PR0402MB3517.eurprd04.prod.outlook.com (2603:10a6:803:b::16) by AM0PR04MB4466.eurprd04.prod.outlook.com (2603:10a6:208:70::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Thu, 14 Apr 2022 10:49:58 +0000 Received: from VI1PR0402MB3517.eurprd04.prod.outlook.com ([fe80::5dd5:47e1:1cef:cc4e]) by VI1PR0402MB3517.eurprd04.prod.outlook.com ([fe80::5dd5:47e1:1cef:cc4e%6]) with mapi id 15.20.5144.029; Thu, 14 Apr 2022 10:49:58 +0000 From: Jeff Daly To: "Wang, Haiyue" , "dev@dpdk.org" CC: "stable@dpdk.org" , "Yang, Qiming" Subject: RE: [PATCH v6 2/2] net/ixgbe: Fix SFP detection and linking on hotplug Thread-Topic: [PATCH v6 2/2] net/ixgbe: Fix SFP detection and linking on hotplug Thread-Index: AQHYTpSxgnie9TYA7EmxFtoINkPBYqztJEkAgAIXZ6A= Date: Thu, 14 Apr 2022 10:49:58 +0000 Message-ID: References: <20220228152937.21247-1-jeffd@silicom-usa.com> <20220412174220.31195-1-jeffd@silicom-usa.com> <20220412174220.31195-3-jeffd@silicom-usa.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silicom-usa.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b60620cf-17ab-4296-7d56-08da1e048508 x-ms-traffictypediagnostic: AM0PR04MB4466:EE_ 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: G3L2mttx2RXTFiHVjZu1S9gxPUuJgL0YSFDxlVKxGKM+uAMCFhdpgOWj837B5U/cKCZH1BziptMrSA3G9E9llvtAQIPAmLbtYkPze5nCm+6kYhZyAUg0AsxUCQBSS2uynjj8maKRAgZDbjrR1/liqf7qTdmfIiYo23nbbh5wkU6XY7N1aYaM0sncOnysVSSW2ckS2CqXVUwg43W/lzWgb2B04CTPhXB8Uz2f89IglYgjRtjOhkhgI/efmvr6tEq35Y1OPTaXjJclphn9AGuv/w/s/3lofSm4PJSi6W0X18KmAGX7TGY1BuI5OmsVzs7qe4rfVzpzIxALI//bWMTeaUzAVWBvAelJ3AbgToy80iSsrcRIx7O+zpG3+vO2ya2j0U9/zKEbZCfgD6mE46u+Eg2zEqirru9Eykme3hqP7S9W7FKzPW2nXBYpPmc6I8Bs87Fw2VSUqYPpGQA6LAGyZGletFTABIuVWyqwhTgj8wWSqeDNqXcNLwxFhFJl5QPIJY7q8HG+iUKF4aH5thmmIxPn7ucMrkyQ/QG2qukJk5B5aaPAGo641xCBiRMb3H9aUMZxBV5Mcr1HwFVjSh38Fbsp1Lhn9yxGtyl4awBaLZAXSYK4ZyDokXs0guG7Jyc5j2ZbB5hyhHI1b8igwNfYhIS0MgAmKAadcmIbRKOw6gkArBrJ0ajlaIaXy0kzCu4qlIWI42QhqbXn4i+/5BJn6g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB3517.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(186003)(26005)(122000001)(9686003)(316002)(38070700005)(86362001)(7696005)(6506007)(38100700002)(76116006)(2906002)(8676002)(33656002)(4326008)(53546011)(55016003)(52536014)(66946007)(66476007)(64756008)(71200400001)(8936002)(110136005)(83380400001)(54906003)(508600001)(66556008)(66446008)(5660300002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?TqjhWCx9l5Mmp95v5vkCUwdrwLC8v1D0KtWnlbIUiAm+xxX0fcBPYkr3hTxE?= =?us-ascii?Q?9KcY60zddSQcijN3EBvdsc0FdmzKYwu4qUSYpV2JcccTvZGoaFEWO8PTwHUm?= =?us-ascii?Q?6xHaBgs1wKT4MYpAFoG+UAwHPtF8QzzjGbnXhEMBT/4ljROZiYsLSdGL87BQ?= =?us-ascii?Q?hzPQwObB99OLqIG1oyUiNs94HtzfRv0N+oDxrtGEttqHTSWutiDoql64tc0Y?= =?us-ascii?Q?L14yI4Fv1pKTItwo7s9ZsHehzypi4g+WzlV1DI+Ni7r0UVzELeu/HsICMBQh?= =?us-ascii?Q?NQ2bXR/+ACECiiOQt5YveNFk8ChZqhMHWsyV0tN7FKct6lLJ6AKM0nGA2lU6?= =?us-ascii?Q?J11xXTmkbSAar8xtpltRZ+u9L4SeAUWUfNx15Rx71//7OG3K6lEAgipf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yW0ez5H9KLD5F9+VpzKRHPZwui9Fsuot2Hi9YI972lboB?= =?us-ascii?Q?pjbQVrUo4oqsrzr+ssfZrh7SRso2g4w94ICSyaDRns11z63U7dYVkolc5cd5?= =?us-ascii?Q?I3SFHt9/RyQLIsARI5OrEtziMxGuKCreo+KXf4omfHflhC4ZbD26MbKCEeCr?= =?us-ascii?Q?tXC/BzCSbgmLGXGzgz3z4/K+XsKayVlW3Li5xhe2BWnz8yBLboW4gaXIA1e+?= =?us-ascii?Q?Tx1CTdIsaeCxsrmnWRMTc19tfCLhgOMNGkZAvRFmTyuFyeeHO8kk8wPxZ05v?= =?us-ascii?Q?fzzgQTXjz4FxgFDF/KJwYYODAEAjhQcfVnOFvdsIazJ1rWqXCX+4NIDmrNy7?= =?us-ascii?Q?fVMWpOO16IPbk2WXc9pI5c9MzDA4FWqDNuodH7/jbElvlKPI2uZSkL2x96OF?= =?us-ascii?Q?b5sSCFyoJ32cfBODLXh3SqjLBhZaW1bSGPbGYDJshmgo8VI5azOqwSpX/bYL?= =?us-ascii?Q?WCFhbFaxqA=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: silicom-usa.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3517.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b60620cf-17ab-4296-7d56-08da1e048508 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2022 10:49:58.5568 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: c9e326d8-ce47-4930-8612-cc99d3c87ad1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vul43QyR2TmDRHVplQ0wMoJh8IWby2zPD9E7aYK2MBrd9s/Brx5+1/wgAr1D2fpVna9qhhajADFMGzSR/T7OsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4466 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: Wang, Haiyue > Sent: Tuesday, April 12, 2022 10:47 PM > To: Jeff Daly ; dev@dpdk.org > Cc: stable@dpdk.org; Stephen Douthit ; Yang, > Qiming > Subject: RE: [PATCH v6 2/2] net/ixgbe: Fix SFP detection and linking on > hotplug >=20 > Caution: This is an external email. Please take care when clicking links = or > opening attachments. >=20 >=20 > > -----Original Message----- > > From: Jeff Daly > > Sent: Wednesday, April 13, 2022 01:42 > > To: dev@dpdk.org > > Cc: stable@dpdk.org; Stephen Douthit ; > Wang, > > Haiyue > > Subject: [PATCH v6 2/2] net/ixgbe: Fix SFP detection and linking on > > hotplug > > > > Currently the ixgbe driver does not ID any SFP except for the first > > one plugged in. This can lead to no-link, or incorrect speed conditions= . > > > > For example: > > > > * If link is initially established with a 1G SFP, and later a 1G/10G > > multispeed part is later installed, then the MAC link setup functions > > are never called to change from 1000BASE-X to 10GBASE-R mode, and the > > link stays running at the slower rate. > > > > * If link is initially established with a 1G SFP, and later a 10G only > > module is later installed, no link is established, since we are still > > trasnsmitting in 1000BASE-X mode to a 10GBASE-R only partner. > > > > Refactor the SFP ID/setup, and link setup code, to more closely match > > the flow of the mainline kernel driver which does not have these > > issues. In that driver a service task runs periodically to handle > > these operations based on bit flags that have been set (usually via > > interrupt or userspace request), and then get cleared once the > > requested subtask has been completed. > > > > Fixes: af75078fece ("first public release") > > Cc: stable@dpdk.org > > >=20 > So BIG change for new platform, DON'T CC to stable! >=20 > > Signed-off-by: Stephen Douthit > > Signed-off-by: Jeff Daly > > --- > > drivers/net/ixgbe/ixgbe_ethdev.c | 533 > > +++++++++++++++++++++++-------- drivers/net/ixgbe/ixgbe_ethdev.h | > > 14 +- > > 2 files changed, 410 insertions(+), 137 deletions(-) > > > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > > b/drivers/net/ixgbe/ixgbe_ethdev.c > > index f31bbb7895..9e720eee47 100644 > > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > > @@ -236,9 +236,6 @@ static int ixgbe_dev_interrupt_get_status(struct > > rte_eth_dev *dev); static int ixgbe_dev_interrupt_action(struct > > rte_eth_dev *dev); static void ixgbe_dev_interrupt_handler(void > > *param); static void ixgbe_dev_interrupt_delayed_handler(void > > *param); -static void *ixgbe_dev_setup_link_thread_handler(void > > *param); -static int ixgbe_dev_wait_setup_link_complete(struct > rte_eth_dev *dev, > > - uint32_t timeout_ms); > > >=20 >=20 > > + /* TODO - Even for platforms where ixgbe_check_sfp_cage() gives a > clear > > + * status result, if there's no interrupts, or no interrupt for t= he SFP > > + * cage present pin, even if other interrupts exist, then we stil= l need > > + * to poll here to set the flag. > > + */ > > +#ifndef RTE_EXEC_ENV_FREEBSD > > + struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > > + struct rte_intr_handle *intr_handle =3D pci_dev->intr_handle; > > + if (rte_intr_allow_others(intr_handle)) { > > + /* check if lsc interrupt is enabled */ > > + if (dev->data->dev_conf.intr_conf.lsc) > > + have_int =3D true; >=20 >=20 > > + /* Check for loss of SFP */ > > + /* TODO - For platforms that don't have this flag, do we need to = set > > + * NEED_SFP_SETUP on LSC if we're a SFP platform? > > + */ > > + if (hw->mac.type =3D=3D ixgbe_mac_X550EM_a && > > + (eicr & IXGBE_EICR_GPI_SDP0_X550EM_a)) > > + intr->flags |=3D IXGBE_FLAG_NEED_SFP_SETUP; > > + > > return 0; > > } >=20 >=20 > TODO ? >=20 These were notes that some further refinements could be possible. I can re= move the comments if that makes it more acceptable. The first TODO was a n= ote that (for FreeBSD mostly) w/o interrupts the code below (not shown, whi= ch checks for 'have_int') will run vs. exiting early and relying on the NEE= D_SFP_SETUP flag being set elsewhere. The 2nd TODO was a question from the= original developer to himself where (I believe) he was considering other i= mplementations which may not use MOD_ABS the same that other platforms do. = I don't think this is an issue (that I know of) so removing this commend a= nd just moving on would be the best thing, and if someone else knows of a s= ituation where this consideration might need to be made, then another patch= can be submitted to address it. > > -- > > 2.25.1