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 53013A0352 for ; Mon, 7 Feb 2022 17:07:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 27BA1410EA; Mon, 7 Feb 2022 17:07:29 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id C13EE410EA; Mon, 7 Feb 2022 17:07:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644250047; x=1675786047; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=rBw+HvP6oH3Q8zTPSm52yTtYIrDoH+RepfMt34h6Tak=; b=LxIIL6IptlXUkzhSStrMG/qwACgkvSMwQMuZZawtMsB9e3VADrcOqjlk QFgF045crdSGanSSak12UDTH90P8GWdt5c+Q+YBZVTXy1WuWP/IZbIQLE x0u6jdFjaXK88thBbx1359+InQkZLIFtdcIrNCsco0TDqyZencaI8Gus/ Sd9O96wm8SbeidWH6H3Ct2TJ8FngPKulOoGywUDvDeCYEz5V/LjIukR8a swlhF03jr6KqERPHKO1ukLoY5uKndBm9DxiCSKtaSGDfR48TJJxQM2rGA hQbPHCyaiBxoYB0N8wrB6T/PnYSs4Wr/kH+WrcWg0XoyanI32z9jJlW1k w==; X-IronPort-AV: E=McAfee;i="6200,9189,10250"; a="312042823" X-IronPort-AV: E=Sophos;i="5.88,350,1635231600"; d="scan'208";a="312042823" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 08:07:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,350,1635231600"; d="scan'208";a="772822521" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga005.fm.intel.com with ESMTP; 07 Feb 2022 08:07:25 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.20; Mon, 7 Feb 2022 08:07:25 -0800 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 7 Feb 2022 08:07:24 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.20 via Frontend Transport; Mon, 7 Feb 2022 08:07:24 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) 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.20; Mon, 7 Feb 2022 08:07:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DQ6fvVMYos9pZLfxw4jvjUMp7nyGMKqfjWe39oynA/k1LuyVyhoUBC9KpijKhCsSv8E42CRQk6xWeW6xNFqNqgWSGR4UOHO7QqbC5OpuhT+o9k2nNyfzBCQwvU0ia8LtxKncNfENXhj3vSLMclHEWq8dBtV60Sa473XbBnfCvkNHt+OJJNUYbTIT2sfOCuEuudVjVRTQQ6Oz7CS6vr1Hdn7+8+SZpDJalsZEw6FV6qxau+43RnI6OhtXl/CUnHJmj1cvWzr7/Oja96XI0mqj/01nt14NGd7svEl/DCs/3f3L3Jz5r2MWiV2OjY1lp7vaWiDOLCNN0yDm9S6xXQhs3w== 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=RZUkR7MRassnBO2RFEjRLga0XIbyChZwTbjOBTtZ1uE=; b=iwsdKof2MYf1vwws1NAfCbdYTm6d4Or7D/KFG5kOl7OZGOz1CaxqQPyFSUL3kBWv8qcMEWS9zCHY56ZAV8a4Ykrzrn81gg596IcMV3GQWl1LiF0GAArXdi1FZS0yxHR59AKm+CWrRULOpP0i9p6RFE7II6ZeUssWBWVAEUOOx1GMCt3yWFEH2ILCjGv4vofB+L3ZrGV3vlBYBqZNUxRy8iM6U1IQeiW6CvlZ9f67gvsWhu4zOEfn9p6AO7N53gHvlzHNpJh5DlRD5EpWkhAUop18wiOy1wAU8yNUB3r183rtiDxMxbSnqbdw96Cq8oRsA/EwTX2st/qAoggyR5e7BQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by CO1PR11MB4850.namprd11.prod.outlook.com (2603:10b6:303:9c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.11; Mon, 7 Feb 2022 16:07:22 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e%7]) with mapi id 15.20.4951.019; Mon, 7 Feb 2022 16:07:22 +0000 Message-ID: <3d0e5ca3-92e8-f30d-40c1-0a353fd5a5b4@intel.com> Date: Mon, 7 Feb 2022 16:07:15 +0000 Subject: Re: [PATCH v2 5/7] net/ixgbe: Fix SFP detection and linking on hotplug Content-Language: en-US To: Stephen Douthit , Haiyue Wang CC: , , References: <20211206221922.644187-1-stephend@silicom-usa.com> <20211206221922.644187-6-stephend@silicom-usa.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20211206221922.644187-6-stephend@silicom-usa.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0038.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ac::6) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0cdfba24-b9af-4db1-a4ad-08d9ea53ec3e X-MS-TrafficTypeDiagnostic: CO1PR11MB4850:EE_ X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jlIv/eMhZ/TtmRK2t5lNFKyP5G7BuA3icDSxwX/aJkA7O0a9pUWrHoHSIiXmAWZuqsk9C0imPDE/q1bFtwbchKw4wq+3SQoZxq6wqYtlkJTJNa3NmA5swQcmxw2nI6d0shspFeEUdRNKS+0S7H4KqYWItOaGO9nTmH+bhvJvS4MbNyWlRa/quvq4mcqv481xNlCs0Nc2xA3Jf0kS4cXdEb006UcNn2AeGSTOk+3xfx3KIjP4SXNFBWbl1qzP8ErkAB/7oGBvW/AqZtDEij7W46m5OgbjbPR0DnbcUP9Qp1NbGlkjqDvQCZxaImD3kecTvYFffukJBPFBiQ3mQ9w9A98iLCc9VeSIRZYeC2jwHrG1ZTgcJnrYiskCVjGWJPVkYdI/2s/W3uHVYdfTb6iJqpQWxOf+on+G2rJdxkGAOIyHc5nTPcyVAP+uPOSrRQ2XbgOHkQwi1aKk5AQDdbqH4qTgVRvmU7aShK0OgfRsOAD2aSMjvaFqoLY6atiI6yn/d1RsjB9m+rBc4dlCXltUuxVESj1NmtNgKayvHrNXTxaFagU9dWfi538fxEULcmYnzfLRM8wnZv1ArgHpyN/6cjXmzUAbR5ejS3/Xg+CB9pcrPyb/d9ViJaoJm/gp2xA7p/E2XkC69dJo0l0jIMX+wTddzxDoBRu+ivyPuoYMU1hUoHdT3Ped41uT2je5oc6Hu3zc31k9P/foCF7voJqOag== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(31686004)(83380400001)(31696002)(66556008)(66476007)(44832011)(5660300002)(66946007)(186003)(2616005)(26005)(2906002)(38100700002)(36756003)(82960400001)(6636002)(6486002)(6666004)(6506007)(6512007)(110136005)(4326008)(316002)(86362001)(8676002)(8936002)(55236004)(508600001)(53546011)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ekovWDVqY3FybkNWVFpBajg2MmM3M2lqTkxrTFU4TXBtRkhUN3pPeUNyb1Bi?= =?utf-8?B?NGxGR2JmNk44TWxyWmthbHhXM3BNNFpYaUZzcnRIeHQrdkNmbFFYSlB6azF6?= =?utf-8?B?d1Zib3RkN3poOWdMSHF5K09udEZDUzhyTGhWR3Q1dUlVNDVPb1NtY1RrZEZr?= =?utf-8?B?S2hwU1JyZGIyOERYYTU5bnQ2U0ZZenQzU2RGemRZR0h2YVo5bnZzK2c1Wkt3?= =?utf-8?B?ajBURkhnUUtYZGZWR3dlTGtFNUE1UGdFVXNGUXJmZVJIa2Fkd3huN0V6M1JO?= =?utf-8?B?ajdxVVlpSFFsb2NJNnh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=?utf-8?B?aWJNRTNQcUxYZlNqcDZHZWM4cUlCYU95ZmtoU0hLbDBldVl3SzFOUGNkaVJM?= =?utf-8?Q?fhLP50ILXcx/VAFKKkCt3bA=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0cdfba24-b9af-4db1-a4ad-08d9ea53ec3e X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2022 16:07:21.9629 (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: l8ckg3Ge4nC28TCkLulqWVKxsP1Tqw3XPfhRkzhJgeyEN4Mv19+BEUA0y1vH5utg6EJeNTtturGACyZChngUJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4850 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 12/6/2021 10:19 PM, Stephen Douthit wrote: > 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 > --- > drivers/net/ixgbe/base/ixgbe_type.h | 2 + > drivers/net/ixgbe/ixgbe_ethdev.c | 349 +++++++++++++++++----------- > drivers/net/ixgbe/ixgbe_ethdev.h | 18 +- > 3 files changed, 224 insertions(+), 145 deletions(-) > > diff --git a/drivers/net/ixgbe/base/ixgbe_type.h b/drivers/net/ixgbe/base/ixgbe_type.h > index b7eec45635..c23257aa4c 100644 > --- a/drivers/net/ixgbe/base/ixgbe_type.h > +++ b/drivers/net/ixgbe/base/ixgbe_type.h > @@ -45,6 +45,8 @@ > > #include "ixgbe_osdep.h" > > +#define BIT(a) (1UL << (a)) > + There is already RTE_BIT64/RTE_BIT32 macros in DPDK, they can be used in PMD instead of defining its own.