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 BBE39A00C3; Tue, 19 Apr 2022 04:05:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 990E440687; Tue, 19 Apr 2022 04:05:35 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 5DFF640150; Tue, 19 Apr 2022 04:05:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650333933; x=1681869933; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=k/eJ0hFzDSBmpw+LxAUsHa5gSmUif7winOsZQc8OjWU=; b=S8WGahUtEsQAyJZVS09TxqAu1+2NF0AXM8jbr3YepwqfgyOy+4/UwrsU 6eeJTQurl2OFvpUuzJsfFg0+Ommf2KOMHfQ1hMI41pAGVnkHX9KTmcLIe 2UlGspMn8kPCDQcjLEvef7oiBVAysvrzA5yV+X0eTXlhf4EGgLggiMa5Z kQt+NTlFqf8fER9vAWfqdxvSwrI/ScGg1CJZPq2sCCm7oIsJkJzyn3k3Q SX0vyD/Jgs7529nxXG7Q0NM+vEUVc4yi8WBzjDnpoAJq8xSHff1sXuQEQ yuywvyDwyFbH9mBiw7AwgjX+yNkeYoGin3OdPVJ7R6PokcCWZc0GnLY8m g==; X-IronPort-AV: E=McAfee;i="6400,9594,10321"; a="288748269" X-IronPort-AV: E=Sophos;i="5.90,271,1643702400"; d="scan'208";a="288748269" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 19:05:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,271,1643702400"; d="scan'208";a="554495791" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga007.jf.intel.com with ESMTP; 18 Apr 2022 19:05:21 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 18 Apr 2022 19:05:21 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Mon, 18 Apr 2022 19:05:21 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.102) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 18 Apr 2022 19:05:21 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LiFWLqiayWAJrvNYFt2S/UcEUVGF555SMmWyKoL/oAI/ZIMy04MupWOthlUNlnWrTkEGUemKiM8lsBVkqxxPItWC+PUDVEikPERjyRun1Me2neTSDnCZ4X2CCgrqg+lQmbZqonnqqxXwLC4SYov7h2jTQo9VOlo2HSK9V2Toqf14nRmleQEWGioiQ8eN8lPioYueQMOWllx5HzuKDnvGunWuwz2TAAktQXxo11NpcUe1AV5qupHIeOYFmQHkxZbD2qOYX00pyvgCxKz1Zkg72AzotMKczUaMSyssYP+Lg8mMvZzArrsjjudDFrdQSvrKk7uorR7KLsS2+MDHDjw23w== 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=5XZtVj1rqFv5ggb8cHcEAMtovLrMMBTC8OQ64218kbw=; b=QLn3Ky4XKEA8L4u/yjBxdo0gDAJ90RSfuzdagztRpb3hy4sdnWQe17WJEOyRpvi6Amqn9kS3aR3IQaUxVcdsnO8gkqB5045HhsoKfJHnPTWBjAKSxl52veUHYh6GJPrcFw10SLyISdnFhn+lakPiDBPvgQqblhLE3xCWUC0AmtroeALtpN+s2lNrudrbzXoS6jvg163ZsWFNPa4fhc7TFKEdwkkP7kWFiz6xCpFrzSK4wXOODoxNk75OiodRpy47LWKTzgV6TEoS3e/d6cMDlmEbfs9NIiNlRWncGO0FDBo95pXyrYOXo79GiqSPwtf7iIMx0vkPNeKn3zuVAY9mWg== 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 SJ0PR11MB4942.namprd11.prod.outlook.com (2603:10b6:a03:2ac::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Tue, 19 Apr 2022 02:05:19 +0000 Received: from BYAPR11MB3495.namprd11.prod.outlook.com ([fe80::784a:cab8:f035:d8ca]) by BYAPR11MB3495.namprd11.prod.outlook.com ([fe80::784a:cab8:f035:d8ca%6]) with mapi id 15.20.5164.025; Tue, 19 Apr 2022 02:05:19 +0000 From: "Wang, Haiyue" To: "Daly, Jeff" , "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: AQHYTpWG7ngQWSPahkCox1ZHMx0Ya6zutdTwgAAD+BCAAIFJAIAAGMUAgAbswgCAAER2YA== Date: Tue, 19 Apr 2022 02:05:19 +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: 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: e0f25aa8-598b-4736-3ef7-08da21a90e02 x-ms-traffictypediagnostic: SJ0PR11MB4942: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: N3s5narSFuhxyJAjN8oZ9plBtP1Einltsr1UeN0cPnwt0ht0Hfpn1yvCugNfE3QHcm3ULcPBLIJtgQKA6jxJngmCT786I0//zrqX3UDV/fHsA5iy8gj6egRmSFkdfWrOWNvf03VeMUDeCb2dIvU1cZxDJ163qWwzijwTeJ2NYphwHWXenNkcgdPdjeMoFaRylYY2TA/gqcZWh9Nmlo6jJ364PNkciidYbqPyBwk177tq/OI+OV3rmV/5KnDD8YYsvkUOEfFuQUg5FdoJ5DrZ3CNviVA0u3WpoCCdkCJeAg9bxK6ryG+7nBmbyuTM3bHwznPwh/2pXObkhfEYRoDdBJq3XOPWMfaLFGuXtS/QvJZlHQ1cwPOaUp3ixj/Zac1PDMfo2gLBhoi+0njxYw0OSZiNXYfS+XLANrZ1H9w5hwPXEQOBo0GFXyrXv48cJIyAmMfxWmG5nBGKY9RPdWwK/Zius4ozxUWogSLCgM/fhSaQO+pGrb4/vV79Ek2jZ4SdvKQorwKKpuReGfxDARoVZDKem2Ij3wMVbNz9Tp+7aO8B+ueZA2VrvZZbVq8sd8LzM9eSnU+7AUtUG6lkkxse8tQP/qHx1ZXFw4cCdJcFBMo/JDcKBDsjXPs2Ba6KDGPhFnJFGIGUJIwFOvpGAo4FdxX29qpcUh9BW/CX75x1G6sUa8nWxIsrrpixpikwxR54JPqOslPjLORGTBp3Ivc33g== 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)(83380400001)(316002)(54906003)(186003)(4326008)(82960400001)(33656002)(6506007)(110136005)(53546011)(66476007)(66946007)(64756008)(76116006)(8676002)(66556008)(55016003)(66446008)(5660300002)(9686003)(122000001)(8936002)(508600001)(7696005)(71200400001)(86362001)(52536014)(38070700005)(38100700002)(26005)(107886003)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Uo+HusbOxDtfo+WPW/07mu8DY5JlIJE2wCupAMPVPpyCgxs11EoqYA75LTd9?= =?us-ascii?Q?NW7vOssdUmVh8S5xlesHEW3OEpHx1hVy6di43e20YlxzK3W7sNxEg0EIXNKl?= =?us-ascii?Q?AJJRwvMiOT+FzqnwSbFOfkS3xViyLvKVReQwVraDzBTxaTa+GPJncdix5TEh?= =?us-ascii?Q?FPikjtP7KuhGIXysOzn1pb6TPts8Z7o6mvmU/ePBxsDKc2ivVADonHIqwBt6?= =?us-ascii?Q?fAVu7c7mFDN/cEDLXiqxnRRC6NaCMV2hx0sjg8PmXTBTzpCU4HA2OCc7AvNk?= =?us-ascii?Q?MX0r/gnMnfIXsjz6SPlKV7p65jirgGTlL6wxj+up7QVtRTFNfYmm4ys7oKGn?= =?us-ascii?Q?c/1Ly77YYHnB2zXRMzjmTnrwl8OORefDEb0nLFDIhCZhW8Yt9AEp0mxFUEY8?= =?us-ascii?Q?b/HhBvREu2muPKi0XnH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VuIMwWA?= =?us-ascii?Q?c2FaVn39vTHRNxRW5rIQJ5U4bPgwFwfMOnqRSP6U8nQOsm3YLnZnXV0rCKo2?= =?us-ascii?Q?WSmAnztxtRF2pLrMD/3k9YwUp2IbAdo7ncNBz5tMz1WpOCXI1TMC7D5WZdVm?= =?us-ascii?Q?lSfhtAyvLye5w7C6+fNdn1bBHmnQrsv1h943S0TbH1KQVtCKMfcqWg3ZirLI?= =?us-ascii?Q?+NUqDmrokvlg+yABwnE1GCKSdxyPIBWt14OVOR+rK/hZBkr55+GRRq3abtzD?= =?us-ascii?Q?bGMXQyF0tA15gYupeCi/SalyCGSp1xF5JIsQQ4Yh3raRpBN56AqFKNx65XyT?= =?us-ascii?Q?YH5T4enferrdXg7jlHNFMuDsDwo+Y567SCJOc8B4JYTv1vsGAb0R5kNOZgPP?= =?us-ascii?Q?wxfhi/kYwkNj+vq9ENzVXW/+eW1W+0S0mM4th9PAJCwA2NQmkt9yUkQdWj2Z?= =?us-ascii?Q?jk08wuxhOA=3D=3D?= 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: e0f25aa8-598b-4736-3ef7-08da21a90e02 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Apr 2022 02:05:19.3314 (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: nW9PWMBFlYoGYWKA43VLvGWNMAdgf2SaybmHNNCJV/jelb6fsbUwcJqGthyGEOgTPC/QgVkoKjzZ7oa8VLqBAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4942 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: Jeff Daly > Sent: Tuesday, April 19, 2022 05:55 > To: Wang, Haiyue ; dev@dpdk.org > Cc: stable@dpdk.org > Subject: RE: [PATCH v6 2/2] net/ixgbe: Fix SFP detection and linking on h= otplug >=20 >=20 >=20 > > -----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 > > > > Caution: This is an external email. Please take care when clicking link= s or > > opening attachments. > > > > > > > -----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 linkin= g > > > > 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 linkin= g > > > > > > 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 sp= eed > > 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 10GBAS= E-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 hav= e > > > > > > these issues. In that driver a service task runs periodically > > > > > > to handle these operations based on bit flags that have been se= t > > > > > > (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 pat= ch or > > not? > > > > > > > Different thing. > > > > 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 understan= d why you are saying it > should be split into > 2 patches. if I understand *what* you are asking, you're saying make the= original thread periodic to > continuously Well, ... Your patch merges the original 'ixgbe_setup_link' task into one, this will make us hard to review the whole design. So what I said is: firstly, let's change the thread to a service thread to handle the 'ixgbe_setup_link' subtask firstly. Which is 'ixgbe_link_service' in your whole patch. Small patch is good for us to review, and try to do one thing. Hope this time, I can make myself clear. ;-) > do ixgbe_link_setup() ? I believe the problem with the setup is that the= sfp_type is only detected > once > at initialization time and if nothing is in the cage then the code just r= eturns IXGBE_SUCCESS, in > which case making > this task periodic is useless. the whole issue of hotplug is only addres= sed by the entire patch which > 1) makes the > task periodic, 2) changes the actions of the task to look for whether the= cage has something in it and > whether its > been changed and needs to be configured again. >=20 >=20 > > > > > we can separate this patch as least into two patches: > > > > > > > > > > > > > > > > > > 1st, change the thread handle 'ixgbe_dev_setup_link_thread_handle= r' > > > > > from > > > > > > > > > > run-once to as periodical, to handle the original issue. > > > > > > > > > > The name 'ixgbe_dev_setup_link_thread_handler' may be not suitabl= e > > > > > 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