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 9B022A0508; Thu, 14 Apr 2022 14:11:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B4AF40687; Thu, 14 Apr 2022 14:11:15 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id D793F40041; Thu, 14 Apr 2022 14:11:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649938274; x=1681474274; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=3mAAALYDR9athk2SXk+h8TzAEGqEGgAuUO40Hap/KoE=; b=a057oSflKFyrGPMy6YyYSmTlnlmVZKT28F5+/EaVg8aLFL0+8IB4ZsZ1 HiTF4ZwRl1/ErJIU1AwiOW+SQHDWo2LpX+kuSxH+Yd8aZxkfn5YkUtEtk gv2U8mt2AI38I9CIxK0B/cdP9AIrneRJj6uel3QCvjc7Gz6M67cmbY0Rx PC95P4PMb4YYRH0Rr3GfnSJpf7LKfosNZruh795ePD75fT9FvWEffKZ9n RigY45BaizGcyP7Q03wc6nhqQtyd7L0PSgk5ckupsykc29w7obPA96UFz NoLmBir6vMJPPdmxk8ds9RDiqOQjHWaWNeytkwHdutrSVhjH9WXB8BvSE Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10316"; a="323359216" X-IronPort-AV: E=Sophos;i="5.90,259,1643702400"; d="scan'208";a="323359216" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 05:11:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,259,1643702400"; d="scan'208";a="552656632" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga007.jf.intel.com with ESMTP; 14 Apr 2022 05:11:12 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 14 Apr 2022 05:11:12 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 14 Apr 2022 05:11:11 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) 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, 14 Apr 2022 05:11:11 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.169) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 14 Apr 2022 05:11:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FakZ4py4uVPrChVnR1LSUu7rYKm81IhmaY084EvzvHxBhX5LbpsQD6k2gHzpXQLw0lek35kLXY0LI/4JUbBspLMf1DXhML1mfl4n95bufOwlhvwxEZ9NrzV7ZCd0JdYBhDu6t0NdXjUkvn/jJiecWLElxgiqfKNc8n4C2MHKl0+ECQp/vn6lH/IOhtHz9Vy+7HHJDMzGoPFbgLSPaDqD1ejBB5duwvvtCE6eY65oLU3Name7RwxSQU7yfxYbjid/dxHcOuvsl15mCW6PI+/MNg5oYpuYExtdA+egwTJ0ZppwnZ6oLwAf5srpAIMjoc++woRefZEnk3uROt1XgqCQGg== 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=YyQ3V6Y+vQ1eO3v6RakRKwcz+Qq0d9vfF1wyHtc2fNM=; b=UgkPu5DXZFzi9YEa2E67VEWPzfhYUL5+CHEYP94fE5GKks62jB/syulpXeUIlkXJPzAr4ghEIgGRp0KFi8LhFn4MJeOBsREbPHIywrPG6X0pwkVEHVAOfTJCvnU2XUfJ1HySAfOmqK5RaZ3j6CC+XGWtZ4kav7VCFISaXghl7m826iiqF2f3rIukaDA/JR2o5CwfOqC0EmXPuV/fXDl+SYuiax59gRro3zD48N6lhZuCnjOc1P5u16i6ehxZOWmb/ckIielPla85clRUO6/peRtLZRv36ecHSZvLt6Ui4ThZe1h2HhffnbXNYCv6tmJqZyOMfBp5HxJMXclnq5y5IQ== 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 DM6PR11MB4427.namprd11.prod.outlook.com (2603:10b6:5:1db::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Thu, 14 Apr 2022 12:11:08 +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.020; Thu, 14 Apr 2022 12:11:08 +0000 From: "Wang, Haiyue" To: "Daly, Jeff" , "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: AQHYTpWG7ngQWSPahkCox1ZHMx0Ya6zutdTwgAAD+BCAAIFJAIAAGMUA Date: Thu, 14 Apr 2022 12:11:08 +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: 5568be2f-31ad-4ce0-987b-08da1e0fdbc1 x-ms-traffictypediagnostic: DM6PR11MB4427: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: R2587zZLaf8zoKviQyJh+I/uvrhHqknwSzuF51Hjnzh0YYDWRgnmq+3iOOSfakBR1e5E5p8kAXFNOcuyF75+yXbsXO3j6qFGJS5AAnY4rgaY6/RFdhBmXVwctKXuWmEzen6xND9gSZVE6L+AQpVcbOvcFxQUGO+qCQYlslTE2VlikD281642tyc/BDpq+syhOuaqb4C6GLDA4SK74Ug5znSvvHNh69NqNZ1Ur7tAHFPdJZ5Pd4XVWcLmQehEZ1rlRyzsOJmlnPFY/OWpll1RKMf2lfMI4sOk5KCM7AP7KZBD8iAnkz7S68+cAMd1J7VTwGwxkB3coPhBv1eeyu2a0J0znN+9WnP4nJk+R9kHUMojTgerHgP0+vO3QgJ8xpJTRnZRvnKt+bIuX4Q43B0NAAfE6F0hiFNgpxTUvDcWeeKECFrCPi3lsC8XbX1DQ4r2LDEaY/dADn+TMIvJOdixfR5SCz6qQcmqXo5OAMmNZV01TFXNuKPQb/w5becoEP1RJUUkRSKR7WU8QrGVjwnTqmAWDvuBd4BLjjEXBvDPB4cHoI2+qS6pizFfTzFIOX+K7vbGVnkwXrQ03zFY9KxbZjm3iBgKQyg361p4eeLvWY7m6fQy1ejmHenE8e/dNH1OulCgSJ7d1IqFpy/+mMGXsfIjK5SewYSBmfAsq4AfOBQYSKpNuY5jn+Gp7V8r3Sx7sk0f7p8YAUV/hnsOW5S9NA== 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)(316002)(8936002)(66476007)(76116006)(66946007)(66556008)(64756008)(7696005)(53546011)(2906002)(8676002)(86362001)(110136005)(38070700005)(4326008)(5660300002)(71200400001)(66446008)(508600001)(52536014)(26005)(33656002)(122000001)(83380400001)(38100700002)(9686003)(82960400001)(6506007)(55016003)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?0/Dxtoc0qKgJv3J78hwgujSMvR8XiDQjVIHM3CJR776S7z8n96DMfykDStzY?= =?us-ascii?Q?PQqLD85rujHHdylux+4sJcqBZMFoNX/Bv2xS0Xq66ozLdnacuJIqAWTsxiqA?= =?us-ascii?Q?6LHTi14p4/cacYNyHRvJcjxWbsphjauRVSYVm/MB3nP451JlTPTlC36woobW?= =?us-ascii?Q?+Xf4KaN2c3kFqsVjgjupTBNesrjioiE7IXMPwvZ5uIC9liL5/Q7HabaB8psV?= =?us-ascii?Q?dvSwZYW43IdRHkuPpurhKnTzf6Ap2ZeEu6b5OeJwdViPVAtD+/cNLm/M/N5t?= =?us-ascii?Q?iDqV/Zt33PIz0vEWsUojTTjxtoBvV9TGnwa23S37XhNhN8aLFLCWYx89VbdR?= =?us-ascii?Q?UX463rKrXsoXSRe/zU8dW1Gd60CrYEi+ys4UZZd1l36ku10yYmIcPUAVJDk4?= =?us-ascii?Q?YB7jqbFpvyedeDVVjsxRamTEpzvQKGebrwhCgdxEuQ7VbBuAXPpn3qqq8thE?= =?us-ascii?Q?Tva1FjLS8TCczKwx7YmfrFR/ocLyZMRW521d/slnlyzfb74IkjX0CpcRs/HD?= =?us-ascii?Q?jixklHuXPnClPXlznTLQiRh84zdYt81L8qID8SCLtS+bLpSxR19bN3Q+mG9R?= =?us-ascii?Q?Z7wKWYFiecA0MY6Ko/mbYlRMagPvTFd4HxJ6Erw5h2wQVrV2AlJRyRGE2gAg?= =?us-ascii?Q?2/emUZPkP+IdEA7li5uMpm3aMFNhykQhyq7O9sQUE2ITGG9wschVUrIQsTfo?= =?us-ascii?Q?bEMBvNRhtCiZoaF4i4LKqjovMpLJmNgkDnJvyawuRp2IBoj0oPCViLlHpnMA?= =?us-ascii?Q?xuqCk2/D74XwqhXsvL3BYbUz6wET0iuGf50cz0fSNvZErneQj+bZDtc139kj?= =?us-ascii?Q?4iGRc17FOV2I0zU5RBjj+Mde7mJel1nfEG5P2dyorzz5By2NHQRT97kup+wh?= =?us-ascii?Q?n1TmUgKzvuC9oouC3ioYEGs253H5haM6jfG5Mz6KYAIfZbHt0fhaO9IBsMsw?= =?us-ascii?Q?4oixKPoH0/XQcrnvLusnliLKk7SR5suA6uDykr6wgKmzNRNP/xVq9pjVZUZJ?= =?us-ascii?Q?VA+t6YF/xl/D6HKAb5hS4zkKL9rvAArFiKsgP+fm/nGocrkoX227mzpdvWFk?= =?us-ascii?Q?bLb+owszyJDJ7CEtuXduZwrogf6Akp8zo6c3BSpALp0yIk8k4ePg5hhYsquD?= =?us-ascii?Q?igttSgxHF+7DCmovg+P4FNU9kwgD0QmSCWcAEXresR1H8WLvslFvdn6vYnTS?= =?us-ascii?Q?UszUTag7P41sJApcm/iU+R2i3Q2U9M8uegD+NhHaOG+0Cp1IyBzAsAbSzwFm?= =?us-ascii?Q?aJbzXH1B4nrDgGg6Jo9RdX/IFijr4WzoIPfqEEhFqizNAtZ5EuVbNY06I7MI?= =?us-ascii?Q?M2n3XZESIz+hRtQ122SpJIR2skZvgs11iDK7pPMdDsjq6RN3SCTnXCLjcj/E?= =?us-ascii?Q?Q4X4FgeYnYyfTpoq8SI89fUoYuAPyBI2RnoXwZ5w1RU88KwEYU7Mpj9sEsPV?= =?us-ascii?Q?cVn8n1skFjW9HHNqGv9PPcedWRU/2z/iWN4/r4A6Usozaz3ysaZomYElNSiH?= =?us-ascii?Q?yxsQLUMMj6XvSVCjkRZ96EZTqN+xBCErzzSeo3wugm4dzu5QCzS2DsbwZLKA?= =?us-ascii?Q?5UjjszFiUZVDokX52aRgCBbSLtvBXOYr7OdntHXNhufgjXPh5tW9o8OFWMf8?= =?us-ascii?Q?7UIjKF4Z1Yq58hec/nHZqlp30XgybC3P3khgAAOiKuEeiDsswUVv+M25vFtE?= =?us-ascii?Q?RM3qgrlNNooLZMyYE4vfsMkMIIWtIYRda4mZD7KUf5o4OiPnenjFdiFscbBt?= =?us-ascii?Q?66oftzo/xA=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: 5568be2f-31ad-4ce0-987b-08da1e0fdbc1 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2022 12:11:08.5805 (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: 5SB7mp3hZrqofH2zmmm9bf7K9BbMtmP14qPwAG5dqWTib84IgiDFV4ePXQKjg13l9EIeprgzEX6hwJfzEIVc7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4427 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: 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 h= otplug >=20 >=20 >=20 > > -----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 link= s 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 speed condit= ions. > > > > > > > > For example: > > > > > > > > * If link is initially established with a 1G SFP, and later a 1G/10= G > > > > 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 ar= e > > > > 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 m= y > > comment. ;-) > > >=20 > I don't understand this reply, are you still asking to rework the patch o= r not? >=20 Different thing. 1. This var can be kept to trace the created thread. (change less code to k= eep the patch clean.) 2. Yes, two patches. > > > 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