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 02CA7A0093; Fri, 22 Apr 2022 04:12:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92FDE40042; Fri, 22 Apr 2022 04:12:05 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id A634840040; Fri, 22 Apr 2022 04:12:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650593524; x=1682129524; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=PnVd3jg03+WDiLKUUU8IU7KeVAlRIg/4AMljfMMjvgs=; b=Hc2AHH7A6NNQUzDnLRgnMkuOweiHlAWVGThSzcK0l5EhSMVjIEXyYjzZ 025DVJdUM0fg8/ZkoYwyc9kNv2QQp+Zq/YvcAAmzuIaN/QBJLLOKnlPMW lkcKyXX7uZXCY7Rj10scv9bEqd90YWCiZy/4J/nbYp3Ewg2+z6h8Ux4Fi t10CAtEqewobOZ8bydYtKdaOujvsuUSuNrcsAudwdEbRW+W+KUsg+8xNW GRBZFBK+8A8wsagms0mHNwkXGap5Z7ZddX+wbh/4ftFp508+tKhp6aZ/s qsFRtKEE+U2s0LrM2z1fS8g0Ukm4NAMpty+yFN8plD/OMmxEOwC+up0xS g==; X-IronPort-AV: E=McAfee;i="6400,9594,10324"; a="324991393" X-IronPort-AV: E=Sophos;i="5.90,280,1643702400"; d="scan'208";a="324991393" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2022 19:12:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,280,1643702400"; d="scan'208";a="577599278" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga008.jf.intel.com with ESMTP; 21 Apr 2022 19:12:02 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 21 Apr 2022 19:12:02 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 21 Apr 2022 19:12:01 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Thu, 21 Apr 2022 19:12:01 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.44) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 21 Apr 2022 19:12:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AAG8V7y4lBJMrZ8m18VOXcSnMIl7kRZlWNJKSaHwHBuqyeTBSchOfkE7wNJB5aWG+54uKWZ2LRg880/+CboL8S2inlgfNWHCbfGK+GyWOLG00OEm8r1D5AOeBzlkuEG5Na4y3xPEgzWXqGSgMISnH5pIgeOrt2pKQO9xtSgNWUU4LXMCZU3p3Q2/snbLkEVZm6ouoZcGEO10dsAs2fzz0XZx7IKWBEdGfxNz3onhzo0pJfBW912Yv3QeDnAquiK5Zo3mXLrvIK68A4SLY/zBorRFCJXan56IXtqablSG+lRbh4Jy1g2dY0L69zFtxUmdUMNIasrCzmMKbguI3b1y9A== 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=flEu0U2AoYa+BhV2LE0HntpZ3B0/XQPfb7TZuRWNsyQ=; b=NTSmb/n9+8b1F4X0a2MdXy7CnXjDCuPk5T+92oZL0J2WaCA8x2Bl5Cy3WoQN91MDGD7G5w3xEoZ9ejWEIe9N2JUPsEvBY/pSI2pPfy+/Ou68bRA8DeUO/G9IfI3qOdGPPmXkACA7RlARBwyaiuP68dcGx2LLdcYd2kF3uvMEvdeBjizdJKElShp75h7II6KUapz7QSVUknVcjhjVDG25caqzuH8xx6pPZ12o5BKcQORAjwNVU+EnqLT1ua5aru8114KyVYMQjYaX6rHPKhJ6HBDsiLI0YQzXyTFx16T8oCq4SfXPBv4ES4N4Y4gYIdAhO1BtBoHDN3tQOBC26Swfag== 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 BN6PR1101MB2147.namprd11.prod.outlook.com (2603:10b6:405:57::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Fri, 22 Apr 2022 02:11:53 +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; Fri, 22 Apr 2022 02:11:53 +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+BCAAIFJAIAAGMUAgAbswgCAAER2YIABBPuAgAB9ACCAAqbwgIAAjycw Date: Fri, 22 Apr 2022 02:11:53 +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: 8c4c55c4-83bc-44af-0e6a-08da24057858 x-ms-traffictypediagnostic: BN6PR1101MB2147: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: l7LK5vj0ti543Qa7ZQO7/zmD3OaRXS+GI/nZlj1Gd+AirmDcb2rsDmKf/zL/LEgBpMrF4BbT2xaySqeYsxIio+hnh3H+nsCqyBcihbzPQBJbPOVD7IC6iwAzI2HVaNQWxFfaiPAFvL/pUoDG3KXKC7gcknqeZW38VNpWVwBDn4LmGNuinmGn0YQj/4Oaq8XTcLeRsQcIrKv32OG5EvcesxHpNxJ+JVUpvqmiOBNcpz9WbIxsdh4BRQ7G1c+eRfqIhyXB4zj4BpFo5dRGES5dgAySnyyiyH/dJE49Ff5NVsEQ1kqWTWZY0PZDpL4BsnJXXnyJe16t78OS6Gy6dxrXTnsUxZ/eQpFPzE1GeNlbx27+Gg6PpFY8OYHqoAtwcOauP3JYEqe8UZfl1nVnTfCYzUjku9vo21IYBMruF8VN2UO0h6IM2GQ/RUVOS2wKSJVca689dPS1ziJ7Uqg+SBfRUQNzeyug/4hJwYn6AVi6jb4qDhXsN1HB2BJPoAR5dZOYap3mt2n8VndBwr1MumvC3JMpCmapISXWlNwqm5jA5fwnXuLUWaPdU1JdIhikx2ZF16TNrJ/tJYfk2l2eNkMUMm54zPjqMNF5VN7cx4lnv2dfRMQusWeytjA3NBlNTrSvG9R7C+syscdRPX6SuZEUKQ13UKn0BUqK0OmCaRGtoj8jzHQbyheH8ncFA353GnZm9DQOCbMGB94T0n7pP5vWDg== 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)(52536014)(30864003)(110136005)(7696005)(8936002)(186003)(6506007)(26005)(107886003)(83380400001)(86362001)(316002)(122000001)(5660300002)(53546011)(508600001)(54906003)(76116006)(66446008)(9686003)(2906002)(4326008)(8676002)(82960400001)(33656002)(66476007)(66556008)(64756008)(66946007)(38100700002)(38070700005)(55016003)(71200400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UlTvmYk2WsVfZnMfBP/kcWboBYIP2tY6+eMTWIAoTMAB2TCdYFvuHuw1HBEq?= =?us-ascii?Q?zkDrNYJl+3Jn3T3HiKwQhQOV7kyxGHYv2aVlFstyMg2TPadA+L+yVZap4Qwb?= =?us-ascii?Q?WwYVgJi1vgLBg0Q35C5a55KcpSBBtt4cNEqOAvmOtn2j6qHYLybvZp/1YsjI?= =?us-ascii?Q?Vi2aJMZiWeIibrWI5D/ieLmncj1TS09+KrryEKpXaWhvO1BqrfaZJU/vLaP7?= =?us-ascii?Q?zQz7P+Ud1kmqS5XP3zYQsQoDrAwlqS5ze22v8592Wpv7IdE0CgJF7oWHCbKc?= =?us-ascii?Q?8/WJm7PFZnXcDKvRazK31c8ngqHcxMpSP2Bh4UB/uHxRr6YRac5I7uwHbl8r?= =?us-ascii?Q?bX0K8yo6KJ22k3LGxOfk2gh5HNftiLw1HiIK6iwTV2cpWnHYdyDtwkR5HRCD?= =?us-ascii?Q?6lSfsNBpl0SVPRxdomOkd0cydbgeyZuy84Ko7SxpomP95BYjOKR/hw9wcd4p?= =?us-ascii?Q?ZevnyzoljiuLPQkKCNCbQ52d7vVvpkre1JQtggpwj0Z76ZmGp6euEk61kke2?= =?us-ascii?Q?8wWlV9XAXZIIXbbYbVPuJVlZJosOyeCz64DrlOOFV4lvnWoLghPqWTkzStC/?= =?us-ascii?Q?OTA2W12qGiyn7cAuhlOn+sVxGYdeKVsEfVBvIyuAPhOevyBVairYY9YbChG4?= =?us-ascii?Q?ZtB1o9JPYigXgcyGc7aRfTnhcdbOKwvjcRJnyUScz3q1B+otklyCQ+leRfKb?= =?us-ascii?Q?YUAFinwFaabrsfImbyWRsLSAMKZXapIceM5FvYrhFuY1Rnx4flPKFgbLwNTk?= =?us-ascii?Q?0hgCtBrlpYXmV7/OcqiNVr54kjnK9Y3FbABHlGxNdF2WmLd9tfMHjBagUOIq?= =?us-ascii?Q?c2/+WlegWNbhKNHTsf0bk6pk4wF5EBVQGoGRMhGtdGoDfaVCb3muXC5EByvX?= =?us-ascii?Q?jLZHtv7DIHlAhZ0yUX7M0b1t09xXc9OtoW1HgkFDAbzpPeEuKHvT4vXvwQVg?= =?us-ascii?Q?NM2RWEo064Et0zrLKmWVeOZhhS7jTm5hLxAlb+w0VIrNoyKkRG8dsQgzVww4?= =?us-ascii?Q?n0vohQdXCGkm/yZB1f1WpQzExaVC+WGFP2vz/cLajTvUoGgEWUg1T1eZf71d?= =?us-ascii?Q?JFgS/aOe1ZEjdsSwMHDgbRN4QzUWhkrzdvvx0FPSNkCRyTrXVIFTEp6NqJyn?= =?us-ascii?Q?jP9bfzyZfWkZuHdQfaVJPjESesj1WG9OuDteGPcrl4LjwemT/iHCb+XzztQX?= =?us-ascii?Q?bmTZwtv5s18l/SOn791uQCUccMXluycJxmiWE1lkMCLdL+iSmEMH1rXNvkqO?= =?us-ascii?Q?CN3yGkX42Pek4qKnfgLWMS050TYlwuyP0Aa280Yx//+tpA279A+1YFDuDupN?= =?us-ascii?Q?4BFwZvE3hP78m1dcuIlehVxr8waIRieIpyGmMzuq5WC/fW8rCbfoUKIwuzOr?= =?us-ascii?Q?LL+Ne8Wsy6H4EJxt1CjBGL6SXdJJdIHPUlJGnhK0Eu1nM6DmmuGjrLGTcikj?= =?us-ascii?Q?tfNk4bBsSM316HcE6J23W4mZwCyaa73Paswd8DpBFL9nLLtz6Bf63OFdl1S0?= =?us-ascii?Q?+Qidv+lYGMABL0iigJtMrBIJ3eoc0HGDKBqcUh1/fEHtzHnwRpAN+JR06GA9?= =?us-ascii?Q?ij1zm4p7f3l18a8vowQ0rtKWRYuuH+jtiocfmkSgvgzKNFflWlwB4SP6dViJ?= =?us-ascii?Q?7Asz0eJMi61X2IlKn6ptjwVTnBXdt2vF3gY43Hh+35cBv8AQB1/sHuhmNhXp?= =?us-ascii?Q?KRz49lUMZGAmlcyxU+fnxHJsw9n/NoL9iJ0N9mkoEm2DS++zFaTEsEY9CbBF?= =?us-ascii?Q?EefsaW04Ig=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: 8c4c55c4-83bc-44af-0e6a-08da24057858 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Apr 2022 02:11:53.8038 (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: SQMEEOaW0Sbngayw2qiPNaucbd6P45BI7P5e4QR66ADb72j0clOQP8dloQSLa9yRiK3sM0wA2F0HJ5R+JwEf8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2147 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: Friday, April 22, 2022 01:31 > 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 h= otplug >=20 >=20 >=20 > > -----Original Message----- > > From: Wang, Haiyue > > Sent: Tuesday, April 19, 2022 9:09 PM > > To: Jeff Daly ; dev@dpdk.org > > Cc: stable@dpdk.org; Yang, Qiming > > 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: Wednesday, April 20, 2022 01:34 > > > 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 > > > > > > > > > > > > > -----Original Message----- > > > > From: Wang, Haiyue > > > > Sent: Monday, April 18, 2022 10:05 PM > > > > To: Jeff Daly ; dev@dpdk.org > > > > Cc: stable@dpdk.org; Yang, Qiming > > > > 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: 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 hotplug > > > > > > > > > > > > > > > > > > > > > -----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 links 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 an= d > > > > > > > > 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 an= d > > > > > > > > > > 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 > > > > > > > > > > > > > > > > > > > > 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? > > > > > > > > > > > > > > > > > > > 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. > > > > > > > > > > > > > > > > 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 > > > > > 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_servic= e' > > > > in your whole patch. > > > > > > > > > > still not 100%, are you suggesting that the original > > > ixgbe_dev_setup_link_thread_handler() > > > which currently is not periodic and only really calls > > > ixgbe_setup_link() be changed to be a periodic task that essentially > > > does what the patch's ixgbe_link_service() function does which would > > > only be checking whether link config is needed and if so calls > > ixgbe_setup_link() as before? > > > > > > if I'm following the code correctly, it ends up going down to > > > ixgbe_check_mac_link_generic() which looks at SDP0 (in the case of > > > needing xtalk fix) which incorrectly will set sfp_cage_full when in > > > fact the PRESENT# signal (or MOD_ABS#) is active low. the code is > > > extremely convoluted in it's effort to be smart so I may be missing > > > something, but I *believe* that what we end up with is completely > > unnecessary probing of i2c busses looking for SFPs that don't exist. e= ven > > when making it periodic, I don't think it's going to end up with workin= g code. > > > > > > I'm lost ... > > > > The 'periodic' is the service thread running mode, but the subtask is O= NLY > > called when be scheduled, like: > > > > if (!(adapter->flags & IXGBE_FLAG_NEED_LINK_CONFIG)) > > return; > > >=20 > this makes no sense. the *only* time right now when IXGBE_FLAG_NEED_LINK= _CONFIG is set is > immediately before the thread is created! there's no 'hotplug' part of t= he patch vs fixing the > 'original issue' (your words, below). the 'original issue' is that the c= ode doesn't work for hotplug > (SFP cages), so there's no breaking up the patch to fix any original issu= e first. the only issue is > that for SFP cages, the code doesn't work. No! Your code is right, but looks like you still be lost in your hotplug issue. +static void * +ixgbe_dev_service_thread_handler(void *param) +{ + struct rte_eth_dev *dev =3D (struct rte_eth_dev *)param; + struct ixgbe_hw *hw =3D + IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + uint64_t start, ticks, service_ms; + uint32_t speed; + s32 err; + bool link_up; + + while (1) { + ixgbe_sfp_service(dev); + ixgbe_link_service(dev);=20 ^ | +- 1st patch, just handle the 'ixgbe_link_service_thread_h= andler' issue. I've no words to comment again, hope this makes thing clear. >=20 > > > > > > > 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 an= d > > > > > if nothing is in the cage then the code just returns > > > > > IXGBE_SUCCESS, in which case making this task periodic is useless= . > > > > > the whole issue of hotplug is only addressed 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. > > > > > > > > > > > > > > > > > > > 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