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 F0BEEA00C4; Mon, 18 Apr 2022 23:54:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D2D054014F; Mon, 18 Apr 2022 23:54:37 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2090.outbound.protection.outlook.com [40.107.20.90]) by mails.dpdk.org (Postfix) with ESMTP id 1293040141; Mon, 18 Apr 2022 23:54:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PapakjF5nlJKFLGa2bCSfeOAoiiWzH4WMvEh0C8aLjWNoXT2fp/+PTzexs1WyHiou0l5kUyjX8UrYvk2W0JkVPNTNE3x18YeWqaBXodCcaHzFQqUCPz9UPnqfNu1b22WlMeWFupmFTAaHO3owCrJ9xxXH5z5r8IeKNqdZMzPGaQizxQSxXsojwaV5vmFmdef340PDmi8UMokpcuizQPZAX1LRRBwj3OLRJjkNNeMmT7gNj0vN6ftljzCBYGpfC2Cm4mIw1x8aAfgzKUzLlDmSd6rPoLYGPhoaYjP6VpVN7kiL8ybgl0BdI0Re/YfEB/7s0qXLFBqIO4mnQfmZMQ97w== 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=0BO8e4qYqD9VqGiPj3lYnUk6gSIoaNmb9wkdkCh67FA=; b=hVjOYgG3dxB8fZPh0x0fVJv2MIBuLOvg+HXaA8wOqPEdgZxrowRVxcIVibES6WvjnhdLMd/7LeWkMQlh5mqs9feLEgiPhb195rtz9MuRsPnbvcSGSGvtUQFaNA9Le5ogw1u5GTeK3QyqPtdfip9DJM8s+UVbG2WJL4Vb5VEqezDsyPCJwL5ttoLJIuhJaNqpnos2GDvCA2Q56SssH/CC/wD4mST4z5xZ+KGZpiTnMlY34AbdOOcm3YG78tdBqNYOmtQP9skd4eeC8kFvO7pUZyc9VZ4sVZ9vO31xmbw2Wom6knt727RLBWSCVnXGE6SobNCApRPVyb2At6+fOHPkNw== 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=0BO8e4qYqD9VqGiPj3lYnUk6gSIoaNmb9wkdkCh67FA=; b=v017UiSqMEvjNbV6kMuwKpTzAvAlycmyS29tgaILvXgvUUUagKYz4Iri6hujOwZxPtnxJonjcXKS2W/C3qnSRDSSd+w8qwXUY/dNN/TaXzU4+IuThYtTBBL0XZnr5UTiRPessFHilQWlxdGCHmRZvy1X0HF10p9vdDx2XD1mkR0= Received: from VI1PR0402MB3517.eurprd04.prod.outlook.com (52.134.5.144) by AS8PR04MB7943.eurprd04.prod.outlook.com (20.182.244.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Mon, 18 Apr 2022 21:54:34 +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.5164.025; Mon, 18 Apr 2022 21:54:34 +0000 From: Jeff Daly To: "Wang, Haiyue" , "dev@dpdk.org" CC: "stable@dpdk.org" 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: AQHYTpSxgnie9TYA7EmxFtoINkPBYqzut1YAgAAC04CAAIB+kIAAGaEAgAboqgA= Date: Mon, 18 Apr 2022 21:54:34 +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: 5ecdac6d-46e9-4125-6a15-08da21860696 x-ms-traffictypediagnostic: AS8PR04MB7943: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: 9kK7QxSjMV/TwUk9nxetw2rJnUX9m5QfhYbZg7f/wxf8WVw28QWoetGtslfHI+cJHYYe82ZGLNHCdwm9+/ub5PPN5zfwfhDysAdD/lBZeNQtTeA64dfeuPJEAC0+lFeY0K0YPQheR4G/f+/kef8YyDCkDFUKO8JFoekLsztgplaf0hvuKdeje1weAbT0cPHQ0YSEre6k8ukjBUARUoM7oleURIyzZR8Ne8mR9ciPkNVl2LyiLR4Z8IDPF4xpQ4uF5lqbpC6tHrjNVmHKqOk15d6FBhPjVMfGzqmEBgAz4Ao3IYPjIVjFAAEXpc2ND7XL7tXci51b07C4GZ+UAXK8DErhp3IwyMGQYB4SzLrvao72aqtNhsYyFIkwA7T3l6mUV9vKFE0J2ZQNFfbnAHyhUu6YsBZrjvuVqDjHI+Fjhn/QFU2+vGcD4q1ck0vp2RAxGAE86oXTKUTV5lGE9abJL9xWmY5H3jTwN1VF2QQphL+GXafSM5zxxy2KC6eBpBQL5kr80mUuj1DPoZWO7HHB1XNHkO3fHLMPxQIKVo88NJ5DL2DLeg7KEwo48HdPi4et0EU6E3EYzG/1yXxqWLf5j/y2lph7ZxAbSIznSXXBflQO4Rd/38WHzw74MnkV2sBD0LlXlhByRLreg6L4yDGAiwNz1Eb0cqMof5A0jDuci2Rh4VZ/nDlwu8jKABEZSV7odQBtrqK4piQVX77ePNH15w== 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)(66476007)(508600001)(66946007)(66446008)(38070700005)(38100700002)(86362001)(122000001)(4326008)(76116006)(64756008)(8676002)(83380400001)(316002)(110136005)(66556008)(71200400001)(7696005)(53546011)(6506007)(9686003)(52536014)(186003)(8936002)(55016003)(2906002)(5660300002)(33656002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?2klMdmcXvZIz/t8uXc++PhTNIdZ4F/hWSWoMYjxkxge9umD92liraItcAc6K?= =?us-ascii?Q?byvYQWP8JKciZ3hsgixIqQU9QM9qj9CUulunglviABl7JS+Ye+nvL5n3LQSi?= =?us-ascii?Q?K7UGx/QcP03edoUCRTKI10OJaguUPM5RHlGMjWc/24EODREL77wGxVDqml7B?= =?us-ascii?Q?keBGx/rebjYeixj+/H9nOCHfHVMvFW3VkmLKqh1f5BuVocb7LjzrEd9Py2Hm?= =?us-ascii?Q?aNEpXvAS7LYq1QZHCGnHzoFaj2anXpe0gMxipfxfXyta4T5PIRCRtYx5nxnd?= =?us-ascii?Q?7HF9sJw9akaDX8kSCgjsXYXKYMCUjXir0qgxuuDCpG+xP43X7TseNjOEkzFY?= =?us-ascii?Q?l37sUTr42RfHarNqh3Fx5boIJHyldVBTjZBJTdT1EVgtr375xWa5syvLPQaG?= =?us-ascii?Q?xvEZb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-ascii?Q?arSvVmGfbB9OMUf3nk+s4LrupRiq6dLUKvg+6Y2oZTUA4SHRPN6OLkgoGU3J?= =?us-ascii?Q?bsJ93LKdTdsDREXrb67HSnKmNfuOXkK1TM4J6sCkK4nOsyJJiuknDiIpRhV5?= =?us-ascii?Q?2AtbT826GrBIfrJNDdCvE2UPlZRQkoMGrziBDxgKcD2HBEdme+6ZV000AjJd?= =?us-ascii?Q?PXGAyrK/QID04n8cRJ7tTo8Ar+pyOIkbROtMteUeeQuLyvuWrkcnyh05TURd?= =?us-ascii?Q?YTyMc8LYqDU9jh99OXLZSnzQD3xP00G72dbYTErOqRontUWJBJab4GMzyeh2?= =?us-ascii?Q?vrZ62OVT1cGX+FUePXP/xHpv7us5F7ALOKrKoQTcXPn9YVXPWk85stSjiKPA?= =?us-ascii?Q?Y9cvYq78NOIa5GH5AdQBkHTMlc+ckmAh+Rh9+tm3WQD3U+C+775Ck4LbRKt7?= =?us-ascii?Q?q4xRAx7AcK+/aQTv9imCwCP+odtO4T5v4gwTM9C/pyLFKNobFtQr?= 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: 5ecdac6d-46e9-4125-6a15-08da21860696 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2022 21:54:34.5420 (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: ag3PGtFF6Fc7KQsCUb11fH2Tb9Zk58C1X+WTJbJfwctjYtr7GIyp54iUHnm5a8NyIu9CAcnrptdt4ZscjgabIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7943 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: Thursday, April 14, 2022 8:11 AM > To: Jeff Daly ; dev@dpdk.org > Cc: stable@dpdk.org > 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: Thursday, April 14, 2022 18:41 > > To: Wang, Haiyue ; dev@dpdk.org > > Cc: stable@dpdk.org > > Subject: RE: [PATCH v6 2/2] net/ixgbe: Fix SFP detection and linking > > on hotplug > > > > > > > > > -----Original Message----- > > > From: Wang, Haiyue > > > Sent: Wednesday, April 13, 2022 11:00 PM > > > To: Jeff Daly ; dev@dpdk.org > > > Cc: stable@dpdk.org; Stephen Douthit > > > Subject: RE: [PATCH v6 2/2] net/ixgbe: Fix SFP detection and linking > > > on hotplug > > > > > > Caution: This is an external email. Please take care when clicking > > > links or opening attachments. > > > > > > > > > > -----Original Message----- > > > > From: Wang, Haiyue > > > > Sent: Thursday, April 14, 2022 10:49 > > > > To: Jeff Daly ; dev@dpdk.org > > > > Cc: stable@dpdk.org; Stephen Douthit > > > > Subject: RE: [PATCH v6 2/2] net/ixgbe: Fix SFP detection and > > > > linking on hotplug > > > > > > > > > -----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 spee= d > 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 > > > > > > > > > > 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(-) > > > > > > > > > > > > > > > > > > > > > > > struct ixgbe_stat_mapping_registers { @@ -510,7 +509,7 @@ > > > > > struct ixgbe_adapter { > > > > > uint8_t pflink_fullchk; > > > > > uint8_t mac_ctrl_frame_fwd; > > > > > rte_atomic32_t link_thread_running; > > > > > - pthread_t link_thread_tid; > > > > > + pthread_t service_thread_tid; > > > > > > > > No need to rename this variable, > > > > > > Let's do link related service now, so we can keep it, I missed to > > > add my comment. ;-) > > > > > > > I don't understand this reply, are you still asking to rework the patch= or > not? > > >=20 > Different thing. >=20 > 1. This var can be kept to trace the created thread. (change less code to= keep > the patch clean.) > 2. Yes, two patches. >=20 ok, I guess I'm just being thick-headed here, but I still don't understand = why you are saying it should be split into=20 2 patches. if I understand *what* you are asking, you're saying make the o= riginal thread periodic to continuously do ixgbe_link_setup() ? I believe the problem with the setup is that the s= fp_type is only detected once at initialization time and if nothing is in the cage then the code just ret= urns IXGBE_SUCCESS, in which case making=20 this task periodic is useless. the whole issue of hotplug is only addresse= d by the entire patch which 1) makes the task periodic, 2) changes the actions of the task to look for whether the c= age has something in it and whether its been changed and needs to be configured again. > > > > we can separate this patch as least into two patches: > > > > > > > > > > > > > > 1st, change the thread handle 'ixgbe_dev_setup_link_thread_handler' > > > > from > > > > > > > > run-once to as periodical, to handle the original issue. > > > > > > > > The name 'ixgbe_dev_setup_link_thread_handler' may be not suitable > > > > now, as it is a service thread. > > > > > > > > We can change it to "'ixgbe_link_service_thread_handler'" to > > > > reflect the change purpose. > > > > > > > > 2nd, add the SFP hotplug in this patch. > > > > > > > > > > > > > > > > > }; > > > > > > > > > > -- > > > > > 2.25.1