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 9D93DA050A; Thu, 14 Apr 2022 04:49:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2AD9E40689; Thu, 14 Apr 2022 04:49:30 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id CAECC40687; Thu, 14 Apr 2022 04:49:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649904569; x=1681440569; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=XKv3SZrVcrWqqtjaqCv2K/4MPkWkGX7zuIefWxtLhmU=; b=Aw/fKrR81O0zKMO4H5SALTDTOhQ/nyS2rjDq8jlrZ7ELq8InFIZfNPvv H6FrzmDwFOV3/C7S7RGETIyEHrJdlfncjzmJpyZgM0xAn5oVme1CFKKan RNnH6fgB/aYr12yEo7DRAjDlPBxmysBSngJMfg+95J7WzDHSmY4WLUw75 aaJm9f5PY1WdXksjsntQubIDIq6fH7FBcv2Fg08cO/fEylhgZgNCZXp8D aWZ2jjokZb+XmHKA5Aic6HNfEgLQiZdcHxGAr9MWJCfr2XbIz83Q3UnG+ bEoxtvZdNFCF7JFRJGd7oB3+Bc5jfGImmK6Hr7sYxRtGhIJ+3NeX6s+mx g==; X-IronPort-AV: E=McAfee;i="6400,9594,10316"; a="262580305" X-IronPort-AV: E=Sophos;i="5.90,258,1643702400"; d="scan'208";a="262580305" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 19:49:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,258,1643702400"; d="scan'208";a="508224300" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga003.jf.intel.com with ESMTP; 13 Apr 2022 19:49:26 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 13 Apr 2022 19:49:26 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 13 Apr 2022 19:49:26 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) 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; Wed, 13 Apr 2022 19:49:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f4B6dKT4OcxHBbrlFaiRfnxkhB5Ae9PRVuxzZDrqKIqDyss2I1Os6v2YetGxHGXY1e+A6fZG9RV42FReYnWXTCyCf/0wTdgT8+5R2kL9dSrmCn5EDKcZf3x9B/i9u7dF7uKLNjyCrY5yZu4mVZcdaeLJ0xNwW71mhuZcuC7f/FmzbpVDPpSLXhU3JPfdXkhVs2srUzttiohnLNgCWjHhIUY3XL2bd+TSdBRdSZJL1jedgTeUds7UCMLVsFZGD7Z1qKuBKaRe0DT9CfoXMLYUx1prNLScTdZyAO1yxcUei+xmmxTZe30yeTXaoB0Uv9V4wg55ih0+6hU5REh9LLHDNg== 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=kniR17J4QdUtGd+wnNdjBprzdrKgJsc77Z4j8ZBPiJc=; b=lfUEKmXRDUripBm/ZO/50S2Fq+hJh4Z8frARy6m94YHUgtbhUdD/pumy44XEAsEOFxBZ5kNhmuPxmULY855EK/FN0v2iJQNQPAIQqp5ABZFNy/iVj3PTPKsPzaHdsHE8aPoJjGYAparbE4w4aRnmBrEEd6wLIWS4c71sGSMehYAO7Wh3GRI8fo5P8LLCrQVQd7i00IYxQhLeQNsDgJmabUF8ZW8el9N+UnbMKAnH5y+S08P45bYJHkOGx+EFeMBCC/8/Y2tx+l2rut5Q3aWNIUoCoHpkgdmLLSKr8p+gBVT+kWUcY/DC2AgSPPtMkpHeiuyIApfWlQMH28R17yZnuw== 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 DM4PR11MB5407.namprd11.prod.outlook.com (2603:10b6:5:396::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.18; Thu, 14 Apr 2022 02:49:24 +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.5144.029; Thu, 14 Apr 2022 02:49:24 +0000 From: "Wang, Haiyue" To: "Daly, Jeff" , "dev@dpdk.org" CC: "stable@dpdk.org" , Stephen Douthit 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: AQHYTpWG7ngQWSPahkCox1ZHMx0Ya6zutdTw Date: Thu, 14 Apr 2022 02:49:24 +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: <20220412174220.31195-3-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: 31906629-1887-43de-422d-08da1dc162a3 x-ms-traffictypediagnostic: DM4PR11MB5407: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: BZ0Q4uwKEfYMfryPMkuSRcGXPRAvBAnXpxzLaS4upedg/2eOIwAz+s2zY0ekoqmv+4pGygPpVj1Y/E79MelKC6WGeHNPYLPmlCskwot+Mxezeu+Odb/w2zfPnJffTZLtPJrkjiHKC5VqJQDppj/I9CXPVFZd0dv7m2NfLBR6idAh806ng5TytBFisGcvFk+1iQANNkLxx/9F4ORNJOxZhO+N7SUu7FvyElxnpt3IL2rRXQAw8y7eTBIzM1TlDG2I4d8TbSMAbw057DEiG1Wid1PIB1Pq3MXHChkvB1AW1ujjiNUeN1bb7I0kfOeoyKMCPmF1ki4kqWiXapO8B0A+2dJpvFxJR48D8G0dRhVPZLdTx8h/gnWCcT8XWaLlQxdgoa7Hnt/0WsFm2Y78klNHVTvVYyvZj7P4ApxwC2PhjjCf/Hl4K3cNR4dXgGstoK9y2sqLq2GfQO68ykgh9t1VwiCxp+fqUmk3+FVjGs6CPYSuhL+lxVEBZQWU5Ql0UQ+eo2lrvNGOq85fcpN9SYsS4Gx1iBYq7pBKTjYf5ZK5MFeNE0F29nSTAnBdJ1YCsdH6ZWwGUiLwmYrjhhQtMiyD+aGRPjBBMvMz5jfDNN7gwpU6MwAuzaFR8FMI6FGzm9wfLO9owOkpCt8n2bF9/Cr+RpeQuADhlqAzPGKGocQxygXYP1oYwKQlfh/lZmQcAgAA7iYjf3tS2QenWlT5BclIyg== 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)(38070700005)(508600001)(316002)(83380400001)(5660300002)(66946007)(66476007)(33656002)(8936002)(66556008)(64756008)(66446008)(2906002)(76116006)(4326008)(186003)(8676002)(71200400001)(54906003)(55016003)(86362001)(26005)(122000001)(9686003)(38100700002)(82960400001)(7696005)(6506007)(110136005)(53546011); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?VDNA5Rsvesx+WC2lm+rg3azc8nriuDdtgTp8sm3G5TGpn54dJRxvyDQbuSyK?= =?us-ascii?Q?/ub2Euv1KLpnPjga+fNcEDvb6X0HOqSRcj0V4hqDSgvUS4zm/kdYiSuMCnVk?= =?us-ascii?Q?4iLgaafyAoL/Lae6BM94pFa3LRifZu9H5rNtopFicVDchmEczNWj0U85r1tD?= =?us-ascii?Q?3mnmf6LfUqntyYcMhemCTRZCvk3bsKLQDdgfNPKdA5BXocCxxey8LirLFlEz?= =?us-ascii?Q?uYAUkzulHYWEX3J1iEne73+QTXO01TpURAMuQoEeHsfqcGLwyAtkK6hL+v3H?= =?us-ascii?Q?xvDDhASWzfwJUAQeB3IoLGfmRNwDmMgQyt1T0a16q88cNOyFqZ0F1GfmeeAZ?= =?us-ascii?Q?CDYt2S844bHxffWTLFyyOHd8fqAAnH8hsU/XCBkjSpXEEWYfmtLvvXWcze78?= =?us-ascii?Q?Lpup8yYEx9yr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BUTa?= =?us-ascii?Q?Ee2dJrTkG4de3zsjjHnzs7buE9sLeeC0UAFCyLvsDAcVvDUNtJ1m/AMQNXNg?= =?us-ascii?Q?Pv/Sr6c0YeisDkwOhj8TwMPV9hIURTSMw1Nur+1NCpWxeAb/7iP8BuefypsZ?= =?us-ascii?Q?JXtWI6EzQyzgxUiJvAZMfT1uZQciPrhhmEbnr1eEN3WyG8jIeTpjBX6SOAQy?= =?us-ascii?Q?JZTLe3j/JMIze4MXsUzGXhXWg0+DVbClq3T4ZsNKOF03DtqB7k19AV/FTGgr?= =?us-ascii?Q?RWVV5qzPOZRP/Hg2uSb9itLNWEe0WNjwrQyQiO+r1LKcJ9eecre3klvZ17sn?= =?us-ascii?Q?EuqtFIwnEvwoDWqGYNGdkqMQRir7zkiFXhFRFCawBvutcbP0QT/lgk3CS7CZ?= =?us-ascii?Q?14aAPl7M5laene6IXRGpjtvswZDRcDXLAJ2tJ3x42PcjmF6MPJrBLBX8/b7W?= =?us-ascii?Q?dGy0BHkBUA=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: 31906629-1887-43de-422d-08da1dc162a3 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2022 02:49:24.6481 (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: lXChk/TJQ+qMWRX4hfBTRF/lxablOAObxgBdwXmgQKzJzm+FUtedidfmpEcbilSLQ4RrC7Cfilpj1DoEEUU/2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5407 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: Wednesday, April 13, 2022 01:42 > To: dev@dpdk.org > Cc: stable@dpdk.org; Stephen Douthit ; Wang, Ha= iyue > Subject: [PATCH v6 2/2] net/ixgbe: Fix SFP detection and linking on hotpl= ug >=20 > 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. >=20 > For example: >=20 > * 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. >=20 > * 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. >=20 > 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. >=20 > Fixes: af75078fece ("first public release") > Cc: stable@dpdk.org >=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(-) >=20 >=20 > 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, 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. > }; >=20 > -- > 2.25.1