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 21D50A0506; Wed, 13 Apr 2022 04:46:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A32494069D; Wed, 13 Apr 2022 04:46:57 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id C2EF84068B; Wed, 13 Apr 2022 04:46:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649818015; x=1681354015; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=w45pD/zUMe6znsfrYnGvRFWn2rAGM7Wpl87VKaG1FpM=; b=WnlK5Z/biKpQCSwzdlafy7T/3C7hd/7ZtC7x0yz0sN9xirjxVOmg81yI 13TzYDmNRhgMA/hdF5/8jOB5t906mg9qgywi5rhnhfAKHpA24Gy51tBkV GnR2X1zOfMFHVC4wUDyEVRDjuNmTuxiGSZjHOED+0N1+KpffFsqNr7KsE k7E+Q74Fj2BNrfei7BmTZ9TqG6CNKB0rbXjuluo60kWilzPyxrfeWNf9e A+nEDOVTP/457fK0sCH1/axWFLfPUCvphmCml9gKSchXJ53ReHvpkCZfi zqrmjYFoV6yqWJUkWN/KuYBSz+8QhkR+h7WchO2G+zf7+fhckxOY4BoG3 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10315"; a="260152458" X-IronPort-AV: E=Sophos;i="5.90,255,1643702400"; d="scan'208";a="260152458" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2022 19:46:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,255,1643702400"; d="scan'208";a="590587046" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga001.jf.intel.com with ESMTP; 12 Apr 2022 19:46:53 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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; Tue, 12 Apr 2022 19:46:52 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) 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; Tue, 12 Apr 2022 19:46:52 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 12 Apr 2022 19:46:52 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.103) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 12 Apr 2022 19:46:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jR7asKqSPu+bK0u8GzRpGwmCLNoaeM37qHnPK2I+mTIXDeDoBEFoTRaUf9XmyJtGIjqpUZvdR32hnPDOuGiwcTGHEj6eT7JkScYP8vV8e9TKB8X37xA/7EpiX0yOm7rcvfEq7Y5DJ6JqqdxiG8n3YV80nIUMU2N2xWJ72G6JsXC/tZgbDlUktqVM0hIJauMvWqwYQSp0NGYMLgJ1IupKZYye/KCDPukp854VR7iJnkamVPGzoYB8KMbTsc4isKgSG/o4hSuu4iIiYoA6HMYyF0f6E90HTCHaOIvs9KGEMNpDuuU9SvZklBNOElIwfDJ8miYi0CjPfUy5UcM6L/s6iw== 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=5tXweEVRwMSoATZ8l1pIrMztKuZTDkPrA2rzqb5/YGY=; b=HVU4P/veFo1AqjQAAe6IKU2AjNxqVh19p/Fq3EIn4v39fGP3+TrmJ/Fxq0w+DaTIh3i5UnPf7QREhFgFkpDPH2iuGZczytjgIDHbTrUoaNQpKbhitYG1D8JWsD2hj447mBB/3VJEydJ3j/b2HGuQp2LFjIOv1u/18ZyjgYpuyjKMIKbnuo1FYDkbpmBkQaGo1YiJWOYKqO1YMfOS38sigkX+IYXYwn4t3Qv+LBdj0SZevoiQGyqktbIpWrK8tUJ5IUaXlvCECOtSDJdkfE8gLJztJF3BsMixMecc4LGTQZOvq1UqBoSZdVklv6/I83KeiCthofzDxu2WelPh8k0GZg== 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 SA2PR11MB4779.namprd11.prod.outlook.com (2603:10b6:806:11a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.18; Wed, 13 Apr 2022 02:46:50 +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; Wed, 13 Apr 2022 02:46:50 +0000 From: "Wang, Haiyue" To: "Daly, Jeff" , "dev@dpdk.org" CC: "stable@dpdk.org" , Stephen Douthit , "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: AQHYTpWG7ngQWSPahkCox1ZHMx0Ya6ztIqNA Date: Wed, 13 Apr 2022 02:46:50 +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: 519116ae-47b2-4b51-1f84-08da1cf7dc5c x-ms-traffictypediagnostic: SA2PR11MB4779: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: fA0K0bPHygbDN2m1+wIsenM0oixd+fTm/ixtuByaCNXB5M0CB1JKEvJUCsstioeohdz1x4TU8V7t3fAZ+V9veBd7G5KDx4tMYmCVEIT339btyJPOHQJBNl7s81VUpPCgvnq1LUyA6oQDlOCVi3PfBaU0n8VdA+GyDkEbFIuJhKgH3eJQI1aGTgjun4YiawJ9ctxydf6VxVuMXZSOtEpZ//ZAag6apcN533mtHSrsneoLI3aN38QfOZU9U6MmtW/KXUhT2i5s/OztPOAFEt3PBztRGUmQ1CLglv1OUPF/HlrJ31kR4OZfUfTyIWPblgSw8myK5uSVkTreb8LCT0zF9j8Xbj5cDNaXBur+DTwAYirUvFFE1cUAeqOIgwxqaFzR+ENODbn01lXBQDu0s9d/chB6G95vO0jlYvUDZqTw2PUJvncA/410Vyl6doqaK7GTUVXCXOgG1AJCURVDJ/X8qZ5QrLJHHLBaShIR7EQAiT9KDBeymYJyqli1eMVXt0lidjSH0bI59NlFSQ6fotMMA4j7sld2DDK+3jWFuCOIL8DUTdE6gTtx91demKQMqDlAW3iArIFHa0OH/16g5b5mfT/mXDJ//wDFsua4NLzs87+VBq5AmOOJjjHAfPpMlQmaZlkXak3DvZvDRagU3FxcysfB7rS6uT1xnhMWjYC0F3/cj0yv4lg9VajQrFLDSeg2FGc88rQ7OzKDCxUBqX6kTg== 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)(82960400001)(6506007)(86362001)(53546011)(508600001)(9686003)(107886003)(33656002)(8936002)(5660300002)(52536014)(4326008)(66446008)(186003)(122000001)(2906002)(76116006)(64756008)(38100700002)(38070700005)(54906003)(83380400001)(110136005)(26005)(66476007)(66946007)(66556008)(8676002)(316002)(7696005)(71200400001)(55016003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rbiJcaRyUW/W8UeNUZt00Dr10qyVwj0G7SCvHe3rYSmBeXKf4BDcQR5jxJmJ?= =?us-ascii?Q?foYAFyUGblm1SHgOhLchFZn5+BuwLGi41jphfhEQWQjdmN/F/SONQd4k6Z1p?= =?us-ascii?Q?xTWDJcNotOE/FYps3WA3TTMKRAt6e6qamEtC128Em7+GnfLiKI2cJsOQz2Td?= =?us-ascii?Q?Fd+UjjImS7pEE6crkMuAfh5KRN3hnvpb0OfBDiTm6FjBG5pATyFROBUzR63k?= =?us-ascii?Q?NJYmWq7ti4RqxYJChME9ckr2v95ig68ET1I1tRugdd+qDw7/hMpbEx7VL5O/?= =?us-ascii?Q?OB1xhY5lHQ8bRWuf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?= =?us-ascii?Q?XXhinQQC6eGcSTkr2o6ZbpALqD4w2bw/G8iTOrFNheVVtpODJu9WoZBIcf9N?= =?us-ascii?Q?2ZrFAArn4IhNM5bloJCMM6VFMjHOYTdAg8yRXDxL3hPKdkg82CBhPyWtE2mU?= =?us-ascii?Q?yR9sXCe2nDuTeKEkGFMqWXtMwbcpy6FvcNesn1JtBHQ3ZCeHiVTilb1QMS3x?= =?us-ascii?Q?TOIrTp6axJvr6m3pKbFEUGJFYt7Y0e1q1cHB2WuI9eEhcy/+5q8I6sHYaUMi?= =?us-ascii?Q?l9cIqeVQCsxSsVm20bHaFZ85BXMVLpLkrZjvP94yx0+M3lX1fjFfuv8wjySs?= =?us-ascii?Q?p85HP6MkrjotVtmzrEmjGlvj6v5rp0+YXQq5hwvlzmhw+Mx8vh5BWIImsYSC?= =?us-ascii?Q?mgHcUMxHbJJnVHQSCotFqlkmgbYnlzB0cLKxdLr2anteF3Wtl9W7lUyUhcy2?= =?us-ascii?Q?BPknYG70CKCw6/3juGRgjsv5KiHevbZXph7wOPMP9TtoX1FiAYvyt8X4kNiR?= =?us-ascii?Q?zgUBEvoditQ3oCm4N8AjLvt5sg4NYMHMF8qr2R1sy7/YRqB2usbqJEGq9YE8?= =?us-ascii?Q?ANs1FUyN/w=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: 519116ae-47b2-4b51-1f84-08da1cf7dc5c X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Apr 2022 02:46:50.4777 (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: 9USigH3TTGEGYRtZ5LOVDWWylyo6BCa0sw9y4BedhE7/Z15zY6GfAFJeY2woC9DqYo6yS2I02CEPSD7UmBPL9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4779 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 So BIG change for new platform, DON'T CC to stable! > 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 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_e= thdev.c > index f31bbb7895..9e720eee47 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -236,9 +236,6 @@ static int ixgbe_dev_interrupt_get_status(struct rte_= eth_dev *dev); > static int ixgbe_dev_interrupt_action(struct rte_eth_dev *dev); > static void ixgbe_dev_interrupt_handler(void *param); > static void ixgbe_dev_interrupt_delayed_handler(void *param); > -static void *ixgbe_dev_setup_link_thread_handler(void *param); > -static int ixgbe_dev_wait_setup_link_complete(struct rte_eth_dev *dev, > - uint32_t timeout_ms); >=20 > + /* TODO - Even for platforms where ixgbe_check_sfp_cage() gives a clear > + * status result, if there's no interrupts, or no interrupt for the SFP > + * cage present pin, even if other interrupts exist, then we still need > + * to poll here to set the flag. > + */ > +#ifndef RTE_EXEC_ENV_FREEBSD > + struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > + struct rte_intr_handle *intr_handle =3D pci_dev->intr_handle; > + if (rte_intr_allow_others(intr_handle)) { > + /* check if lsc interrupt is enabled */ > + if (dev->data->dev_conf.intr_conf.lsc) > + have_int =3D true; > + /* Check for loss of SFP */ > + /* TODO - For platforms that don't have this flag, do we need to set > + * NEED_SFP_SETUP on LSC if we're a SFP platform? > + */ > + if (hw->mac.type =3D=3D ixgbe_mac_X550EM_a && > + (eicr & IXGBE_EICR_GPI_SDP0_X550EM_a)) > + intr->flags |=3D IXGBE_FLAG_NEED_SFP_SETUP; > + > return 0; > } TODO ? > -- > 2.25.1