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 12E25A050A; Thu, 14 Apr 2022 04:59:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 937AD40689; Thu, 14 Apr 2022 04:59:39 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 53EAE40687; Thu, 14 Apr 2022 04:59:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649905177; x=1681441177; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=3cw6xIum8dXV5PxJjtitNMhVj++GPC06CGLWprLJp68=; b=lU4tXDBsj9l4cwZGPtp5dlWVao+w25FYgQwDJjXszZ+rgp0KZt07cthl 1gUhA8XFmVEpUwOAeXorHF60YzIVwIJQElVtFK4DPXPBTKg+xWwe+EC6E YtSiugJbYetzghmbCNte0bcNd6oMpfMgYWss3mVg6Hkdr2aK/8hvy59lT 3H8P/2b4UTm1BUwMmCWihhx0izumN+TxsWq967g0NCPARZXdIIGDPzARD JqJu9b9O3MwGK/SLZh+yZkypd72XMrCBHS9VmDSMvkYLZre8wmMUWynoD U9Jh705GCABaWol1bvY3aRXSe6tUyhi9ynlzX2hs4wAuBrNpK9KlIgXes w==; X-IronPort-AV: E=McAfee;i="6400,9594,10316"; a="242764910" X-IronPort-AV: E=Sophos;i="5.90,258,1643702400"; d="scan'208";a="242764910" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 19:59:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,258,1643702400"; d="scan'208";a="552468313" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga007.jf.intel.com with ESMTP; 13 Apr 2022 19:59:36 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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:59:35 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX610.amr.corp.intel.com (10.22.229.23) 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:59:35 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) 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:59:35 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.103) by edgegateway.intel.com (134.134.137.102) 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:59:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JA4kneFGvSwq4JIUEh/JOY3xWS0nfwd2mNXKBl1Q0T8TKJ+9t/oqIXOyxNV9jGAFrOmXcfHKxip/pZVV6N7tZe/xFG6eWCXXFeOym1JVcDWs+s7Qy7+smBh0I9jR2egJ89ZXyNH+mlxo13J9IOft1D5x9JEhVq13cFiijFfVqVA0rGQfR8Lk5ue6nrzYs3aMJ29n7DE9t21AjRG1SgNXDDJC7ogJcL6/+h1t0aaUnEHYKNZ9tSt88Zn+T9kUrv6+oC0mxqWvMwgTffRgRMJMWG4gMM7Yttz1fX2F7sYA9MvtCmkIrg4KP9zWIBcsneZW5E0hkZbQE+DAxCBETXoDLg== 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=dtJZ3NHM0dhBLsx+uwYnUibsqAHUeB38RfkzPd7thOA=; b=b2xD/2wWs6T1TTHJJSIJlJmCppsAw+Sn2FVdequYCqHlUD/veCxmxBbGw5lrKQyclT1ZevF6eO33OL6QsV0MlyKgCNxILx5q5/VehrkMa9b5m684+skp7ApsM8NTQpYpmrdn3SQ694S8iGuX16SDoYvMIO01MS6NNWxBKeCKsKM11nWjM+3wjuqK8AkScETptmJ9hQRhn1aTPeicpMQiJfE+LXAeXlISbNFaF3h+Uxe7HFID2yflj0KWiN24ygIa0Ai/gomlEA5FIhnl0wZyEjfVC3KqQ0GhivTcopaq1E8eZsqBxToUocheGaInmdtoNDS/tzKRHO9mR7eAC7xdnQ== 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 MN2PR11MB4517.namprd11.prod.outlook.com (2603:10b6:208:24e::22) 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 02:59:32 +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:59:32 +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: AQHYTpWG7ngQWSPahkCox1ZHMx0Ya6zutdTwgAAD+BA= Date: Thu, 14 Apr 2022 02:59:31 +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: a72209cc-baf2-41e4-75e4-08da1dc2ccd4 x-ms-traffictypediagnostic: MN2PR11MB4517: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: RwHaZjFxSqyzBmyPJ+oCKQfAsYVHuZEOW3m53K9CATMKhOgi5QMthQpPS74zCcdIK0FgLb3sPH5Pxv/6ow4hmqnTnDjEuClKH5DplRadR2nNo1LoQ2HOXJogj4FzaugHXIf8RjAKNfSIlyNHfeJkvN+1tmQfB94jFzn4QG/yErLwoSL9/Aqy2G2dcTs7yIU382/FGqDau705NmwN9+srMCqL99ze2EqupVtnJT1Jqwk5x5cxmOE/iB3Ru4g1Ut5s2QrUQ3Xq3tFq2hoNmuTq+bmBsLTB8uPU2bOatnwOn9j+HXcFbXhrq7u2DaWeQ1zQNU6+/sXR8nOjNzdA3Zppo8wCxKtsUTFXJ1MbR7FxuNHBN4UND+VLYsBAzD5J0v1sax7xnxhcc/JrVxivqXz3aczkn4ZDoCCS0PEDpvV9ieExVFKJpT4HEza+XBwsPpM2L+n13Y15MMiRluXge9+mpPU9fVtt674S4/gV4mKHMDWn5EAEGtpbdHfAUHlUfEPY13+c6Airnt/0Ams5vhHaDJENyM7g1n5/5sNXYLVoPY6clq2wb1PqwRVzRKCwwQ+ZH4WEWDlNQ1y0ooBRzw2c98/J7VSuKavbIqQ2Ut3WjSWLqoq4mnYn4tYW+65K29pfCMl//nxBIVi/U9Y89mGpb6iRQBpCNfu0/Vg0zJ/YXrYe4FTDax/nyZ6zv4pZdieb6PqI+fP6Lj5IQdbCckDmNQ== 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)(508600001)(52536014)(8936002)(5660300002)(6506007)(38100700002)(55016003)(122000001)(38070700005)(83380400001)(186003)(26005)(7696005)(33656002)(9686003)(86362001)(82960400001)(53546011)(2906002)(2940100002)(316002)(54906003)(110136005)(4326008)(66476007)(64756008)(66446008)(8676002)(66556008)(71200400001)(76116006)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?5iog9uNsz0R1Yj9Ljo8ibd0AJu0l3mhytpI3aNrHhJdQIxeH5dBxeR+f0PDr?= =?us-ascii?Q?CfV3yIwjad9khGs4M0wqiHCjn6v2aO5jrewUxg11wj7VbGQSrEHsLbPXxfPy?= =?us-ascii?Q?VvN0ExP5dT8UluKtSK/v8qpTpVs34WpqeplbfFev+fAYA8ymYHFITd8YICB6?= =?us-ascii?Q?nMeUPbJ/zruS5sOyYD3xwwhIbNoDPwFYZNsdhaqU1zi+W52za6wdbSveodi2?= =?us-ascii?Q?UV3XdCe0hOS1FycHoGujPZK/fzyk160tWBRLen50ukvCHicLAVMZfgDB+Tkk?= =?us-ascii?Q?fK3zugtTQNQMFT4PRHuhrscsXZyVxnZbvrd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RXKTQLd/1uRKH70JVt1IIRbdeNxpBFY3BGb8Fapjko0cTEHoiWi3p8I?= =?us-ascii?Q?OKt+3C3v6aICm8VOqrKr/EB98bBHkOw4pzg3KPply63iDdY4e9Y+6PgzxbdR?= =?us-ascii?Q?Q3MZ2+bSfNmVNp6sIl93Yt1YYy07blFJBA0KtLNKegATaxHmAPi4m53fAuxi?= =?us-ascii?Q?ci8x+5MpiEcDH5DrcfAyMBrOovlrOn6e5lY08bwl6UahUiB3wHy/c1lmO439?= =?us-ascii?Q?nexIxJR608fZh4D+XN2wW26oKfPy8fFw6l57sszUN1WFTa96xmf1lDzVGse+?= =?us-ascii?Q?/yBVAXG0MdyP7fPL+3oIT/v7y2LdRIt4R4q8d1XWj5wey5Cza4igCpHE2ODe?= =?us-ascii?Q?wXrTbw9EC4BxW3td0oEPWZh0A7H98svga+ph45SI3CJH83worWjomNhoe+F4?= =?us-ascii?Q?L+E08tha4hubzu6vezn49uXobbKLRTw9FyXgE08Ell/yXOVi2HEfVecuj2E4?= =?us-ascii?Q?vcZJ56bvoFCrEqzxjWCtcGFvlS/OKDT2iv3ZIxRdLOGx234UFgC/aotMIgL3?= =?us-ascii?Q?sYFNGVTe+g=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: a72209cc-baf2-41e4-75e4-08da1dc2ccd4 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2022 02:59:31.9308 (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: 0EwUVQl0ICyctblTcQTIqW8ONz6e+xULbnuWkpqWvrJhGEQ6oxyxpe3vQE1aUhshDLOhX9iGuiCs8fp5F6bA+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4517 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: 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 h= otplug >=20 > > -----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 hot= plug > > > > 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 a= re > > 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 t= he > > flow of the mainline kernel driver which does not have these issues. I= n > > that driver a service task runs periodically to handle these operations > > based on bit flags that have been set (usually via interrupt or userspa= ce > > 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(-) > > >=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; >=20 > No need to rename this variable,=20 Let's do link related service now, so we can keep it, I missed to add my comment. ;-) > we can separate this patch as least into > two patches: >=20 > 1st, change the thread handle 'ixgbe_dev_setup_link_thread_handler' from >=20 > run-once to as periodical, to handle the original issue. >=20 > The name 'ixgbe_dev_setup_link_thread_handler' may be not suitable now, > as it is a service thread. >=20 > We can change it to "'ixgbe_link_service_thread_handler'" to reflect the > change purpose. >=20 > 2nd, add the SFP hotplug in this patch. >=20 >=20 >=20 > > }; > > > > -- > > 2.25.1