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 4EDCEA00BE for ; Wed, 20 Apr 2022 03:09:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14F19410FB; Wed, 20 Apr 2022 03:09:36 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id C5CD240687; Wed, 20 Apr 2022 03:09:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650416973; x=1681952973; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=zrHohaQHniJcGlCZsHX17BHel9vx/tqj20vgCW38O8g=; b=AIyx21FDg34qZSUWsrTrb9JKGyrVch051tu/pX5gUI75G+d1v2X5cy7b lofpaOmf8TJs4SBiONjfhWotNgwyJdphGA65vkAPZ6ZVqjP3sOJH2iY+h n4JvTyHLELQ13AovMY0ARDGF+udU5gb4qTSskvC2sGiqtkDU+6e3PdkEj EZ2J9IaVl29OHEEbK33oD47SMNlAHYiaT9uIcVUcd5i54akkzsuzXHieA /bGcbc7ABa/Lzw5fvlhvVde0lXplXXcMd/+YjniUSenCQ7a1UJ/SismKY UYhIvdPRksSBHi0PphZxusXBETLm4cpb9Z/BL4JCrsFuZUfy2PQSQ2KCR g==; X-IronPort-AV: E=McAfee;i="6400,9594,10322"; a="243842338" X-IronPort-AV: E=Sophos;i="5.90,274,1643702400"; d="scan'208";a="243842338" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2022 18:09:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,274,1643702400"; d="scan'208";a="561912601" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga007.fm.intel.com with ESMTP; 19 Apr 2022 18:09:31 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) 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; Tue, 19 Apr 2022 18:09:30 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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; Tue, 19 Apr 2022 18:09:30 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 19 Apr 2022 18:09:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WUvtbRaGp50Hn949nfJBdq1/o5kbbDvimstzv071k80XKzWdIFfTLzbTlbBzdbYRqjZCSm6xXiNRx4L5qb36LY2h8FEpSMt7yVqgaazf1wyQ+b1xR8M47NovlFJTmlzMu4YtCt0QJaKlpqwYAP1eVHRlWmzeo+UIzJOhQ4PvipmiGGYaETcqRp28ortoQr0lYEN2bjMOSFzDmSLSrzuQRTHCg5STawFDn/Mvh+a/Jl0MKa23T3TN1yT3jRrZrdCPaeMIRkl2sL1/Oyy/CQWGqq3XcE/6OmwxCwX6PGAot1IVhPTZ1JnDwLVCO5E6NY2vLANymzIEi9Yiu7grQvDKSQ== 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=XEVRF1PBhj37jl4GE1speu5Fm+QZXQ1mw6PvDj32MlI=; b=CRzj2V9k336ymld1VKo0EsEjbYr2VlXXMoSt+JGoiQOQWXEfcGvdLBpzCSSDuRYe5bEtIcGJf8DIVmAhHbDQvImvTLzAoFOOjyo6irSEHAlRZ6Et7f7lxyLfv++TYjjW3jWo/uHMSnfmAU8METUdDa3yckWQ+vU5KEtmE/BqkSU2b7hgVbJdwlZX9cMg8tH7RBnX2dGdsDfBhsqIO+h1Ge4B0BTTI6Swug0jLf8GSYlPH8a2tTFybhv598S8VFuXrhkg+tQ3xBS30jeamR7jDNhtXtPX+oPS40rWW7M3yEy/CXd8hY1uiIyJt0i8Dhh7mxQuDgQz00Vfgs19cnjSuw== 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 DM6PR11MB4345.namprd11.prod.outlook.com (2603:10b6:5:202::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Wed, 20 Apr 2022 01:09:27 +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.025; Wed, 20 Apr 2022 01:09:27 +0000 From: "Wang, Haiyue" To: "Daly, Jeff" , "dev@dpdk.org" CC: "stable@dpdk.org" , "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: AQHYTpWG7ngQWSPahkCox1ZHMx0Ya6zutdTwgAAD+BCAAIFJAIAAGMUAgAbswgCAAER2YIABBPuAgAB9ACA= Date: Wed, 20 Apr 2022 01:09:27 +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: 0d380c23-4f64-49c7-323a-08da226a6a97 x-ms-traffictypediagnostic: DM6PR11MB4345: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: 6YoIGnltLfmw3/YOJXyFyiieuqmaJwI05aCCTktctKBhBYSkvw/d2BxXZ1vRs6NCwFE3xVc4JFRJqjAunXPwoq8ole3FALiMFvm9ymVgyf/jLjzVO8r/FXC6t/vzUwgPXO6cro9fj8yTZkOQZnD3Mru4zIShmV3LZYx/YJnD9r2Y+8zpAHRLVJCotd5VaX046yiMKRbh349EiHnnSQlmL90J7KqAzcKG0uwTNfvStSe4kqzE0lduK2ZmfNGgJVgFerIeEb6cSyVkCorP97k94TqaJaHFFH0m1skI7z9bVL7iA6BalwqMXcu8chJcQgX3AeBSLDnSEJxgjyXwYbWqiEq0A0Ac2OPVBDGYqaIN5UZjKnOBmTEwSJullu4PUKSViWLSow+kn9Oq/H3em6Q+emC+6Yq3yPxX8Irz2+8C8rigZnrCXM2tR5Y3lxQPAJLd2R2s6EckvAH5+JBD03Nw13h/IcNz+EpL/rMTLAKIFr3TXZqglJhbC8c4Meb/BC4O5y7hh+GQXIG63xulTIWa6cjyH5jDYs1hjTu5SShGZxj13C12RvOb9aCg83cUFV9E+IyosWZNsbbOUL5/GHci/5ojLpeT9ykZFRkPhb0FZXJ8usiaWNc1cGf6dwc58joyb7z1GiU/7jgh+8G1/U4Luwnl44wQQNy4rXweUVyC/ODbMRaB6plQPT380qOkBzlYPr8WeoBcGRR6g988BELKVA== 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)(66446008)(8936002)(26005)(107886003)(186003)(66556008)(52536014)(4326008)(66946007)(76116006)(83380400001)(33656002)(53546011)(6506007)(7696005)(2906002)(8676002)(64756008)(38070700005)(55016003)(54906003)(9686003)(5660300002)(71200400001)(66476007)(38100700002)(82960400001)(122000001)(86362001)(316002)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9LSVLYR3prPN7ZXq9AiWHMeT9cmojRVscUpDwnSzu0N2J3j1dSQnd6BH7Cf+?= =?us-ascii?Q?Z6MHv09E7Nk/AWt4T2aqn+Yvy2ARCanhZA9QZSiNddisVLgDOcB5RGKyUnNv?= =?us-ascii?Q?q8v4kTQi1YqsLKwdXIKsDHNfiiZtBqMYQs8oBCpzwpBaulDVcoBi8ISoQAm1?= =?us-ascii?Q?RZh1mkEKNc65c55D3XsxMyo2pseczlOiZdSY+zK59i/BXmHwT8NSA3m67t87?= =?us-ascii?Q?2heDFmRYgZ7pE77fqbW4Y+G6AC9sZ3oEOr+xWYg7X77wfwN3vSN2n4G4f/sQ?= =?us-ascii?Q?DlGP/yvJFMLx0ppE3C37EMaHtMmEU+BCCUGAQqZvKM1aywNI3ipJjiNCnaHa?= =?us-ascii?Q?CIvQFiJ9R925egl6ydKPi0etwAf40Q2mxcxDgpLQOAnkB0tJPMobbJ5UaafL?= =?us-ascii?Q?VFE0WjC43ZLKsP9sAtkK6yXayKSYGic+zifNwxYMP4M7yRBvRFwM+MUlZNru?= =?us-ascii?Q?cOZvvmyp9oeECM4JDh1sGHxXIj5k8/szJRP8eXaNfFJQd8i90ApYposgUiKM?= =?us-ascii?Q?9E25vO6HShbXRDDnEilvSuI3jCuoq7XMTO4sViPoNoxYBT6dQkZHuURgVODm?= =?us-ascii?Q?Z3yH+d+Fw+/09fC3mVyrcav55Bku4KIBQB0mLGfaarB1T1bCjf0jt0nXguop?= =?us-ascii?Q?GWayFIwCdYYbwIudZxvqoRmw29yjpGhl5FKEW+O+7IQ8B0Y0D+b7UECfLqrT?= =?us-ascii?Q?ELgCQBPtF4w3cmxENnAd6OyIXW+XTRoWl09tpjoC7zoXNRBNze6K6D2sKX4v?= =?us-ascii?Q?GNvKbZjJ8wCXFyMEoe256W55/szhqGzrMpoyBzTqK4ceHYc2lgSIe64FBkFL?= =?us-ascii?Q?HV/5bjKDr1Hpiti5mgV3+zxvl3m6zLVrMPq6CJv13cUDxwNj2bf3CT9zAwPT?= =?us-ascii?Q?cYNfN9VMX6K2dlPRmzVBgmdUBQgFvXIJ+MMMExvtoNngv9X2Eebi+z1Rm57h?= =?us-ascii?Q?ZJ/pP61zjl6vFpqR3ukTYGAbyiiz76AQ6SbFqebu1L9Sqdi/kR+21k3he/s6?= =?us-ascii?Q?QPgAL2IXnubLWpTpRLeJHtaTucvW4Hz8PnR3Hph4wTPYAeyzjZ/uzH9HDkIe?= =?us-ascii?Q?OJQmk3PuEQ49mPyFwlUx13z53zU4FswuNODB6rMifF+mA2xKlDgHDfWQsdJZ?= =?us-ascii?Q?CwP8N93l3f3pFcfAsZ8H2xJfpKrv7j4o21sbECP95Dmabt88XEBrI4olAt+p?= =?us-ascii?Q?V03MGoRkBeehdopiuzB/hZa4kg5nnaUiMnRbPRs/eliDyvGWuIkzXtrpqJLo?= =?us-ascii?Q?pt+WGNuhITvI1ry0NV88lzhSDdudXI50fKFv+XkvduYZvo+XRS1AbRCmyZ4F?= =?us-ascii?Q?FZ3VxcEpF4WSqnYjrVR5yK+nd1USYayfKXUwEzim0URuaLwBvSsTcvTXnZhS?= =?us-ascii?Q?7rABoJh8KqmekvSCtz/fG1XN74pu1iJpp/4ETRzVmm/VF11DV39E5RrBfsoi?= =?us-ascii?Q?Rc9bxDpsQWTZpmp7d4TmGNVhf35HVMS9MZmprbv+1zhkNaMU8lA1Gk4FXCwc?= =?us-ascii?Q?5IqWg6k5TQ1b3b7mScsrBGhA6g7ZaEnznw+q2bAK8ssN9h6XpsL9UgKZe/SA?= =?us-ascii?Q?MdLPdRzE7xlZs67L3nI44YxyDcmsTYO0qaZ1TnipkOv/rR9oVT1QNWswccCq?= =?us-ascii?Q?Ll5hhJqT4Wr0VpBf5WXOVkjM/XnR8BUM9mDSRIVeaV//dS+MRtok9pnMDIu2?= =?us-ascii?Q?teZPNPvx+ms/BsNmKSAzdsQt+CJTaC4YdOam4vezycIKtoeaTwW6OIip11W4?= =?us-ascii?Q?uX4WHVgdFw=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: 0d380c23-4f64-49c7-323a-08da226a6a97 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2022 01:09:27.5580 (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: K2pr8mkJgmqnrJgM1BjkQ5vdjSXoTafHLFhfG2HqTddZtDl6Y6BFv7rGHUhb31gbnz/tKKQtKMMAlTH0vN7T3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4345 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 > -----Original Message----- > From: Jeff Daly > Sent: Wednesday, April 20, 2022 01:34 > To: Wang, Haiyue ; dev@dpdk.org > Cc: stable@dpdk.org; Yang, Qiming > 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: Monday, April 18, 2022 10:05 PM > > To: Jeff Daly ; dev@dpdk.org > > Cc: stable@dpdk.org; Yang, Qiming > > 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: Jeff Daly > > > Sent: Tuesday, April 19, 2022 05:55 > > > To: Wang, Haiyue ; dev@dpdk.org > > > Cc: stable@dpdk.org > > > Subject: RE: [PATCH v6 2/2] net/ixgbe: Fix SFP detection and linking > > > on hotplug > > > > > > > > > > > > > -----Original Message----- > > > > From: Wang, Haiyue > > > > Sent: Thursday, April 14, 2022 8:11 AM > > > > To: Jeff Daly ; dev@dpdk.org > > > > Cc: stable@dpdk.org > > > > Subject: RE: [PATCH v6 2/2] net/ixgbe: Fix SFP detection and linkin= g > > > > on hotplug > > > > > > > > Caution: This is an external email. Please take care when clicking > > > > links or opening attachments. > > > > > > > > > > > > > -----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 hotplug > > > > > > > > > > > > > > > > > > > > > -----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 links 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 > > > > 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 userspac= e > > > > > > > > request), and then get cleared once the requested subtask h= as > > 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 my comment. ;-) > > > > > > > > > > > > > > > > I don't understand this reply, are you still asking to rework the > > > > > patch or > > > > not? > > > > > > > > > > > > > Different thing. > > > > > > > > 1. This var can be kept to trace the created thread. (change less c= ode to > > keep > > > > the patch clean.) > > > > 2. Yes, two patches. > > > > > > > > > > ok, I guess I'm just being thick-headed here, but I still don't > > > understand why you are saying it should be split into > > > 2 patches. if I understand *what* you are asking, you're saying make > > > the original thread periodic to continuously > > > > Well, ... > > > > Your patch merges the original 'ixgbe_setup_link' task into one, this w= ill > > make us hard to review the whole design. So what I said > > is: firstly, let's change the thread to a service thread to handle the > > 'ixgbe_setup_link' subtask firstly. Which is 'ixgbe_link_service' > > in your whole patch. > > >=20 > still not 100%, are you suggesting that the original ixgbe_dev_setup_link= _thread_handler() > which currently is not periodic and only really calls ixgbe_setup_link() = be changed to be a > periodic task that essentially does what the patch's ixgbe_link_service()= function does which > would only be checking whether link config is needed and if so calls ixgb= e_setup_link() as > before? >=20 > if I'm following the code correctly, it ends up going down to ixgbe_check= _mac_link_generic() > which looks at SDP0 (in the case of needing xtalk fix) which incorrectly = will set sfp_cage_full > when in fact the PRESENT# signal (or MOD_ABS#) is active low. the code i= s extremely convoluted > in it's effort to be smart so I may be missing something, but I *believe*= that what we end up > with is completely unnecessary probing of i2c busses looking for SFPs tha= t don't exist. even when > making it periodic, I don't think it's going to end up with working code. I'm lost ... The 'periodic' is the service thread running mode, but the subtask is ONLY called when be scheduled, like: if (!(adapter->flags & IXGBE_FLAG_NEED_LINK_CONFIG)) return; >=20 > > Small patch is good for us to review, and try to do one thing. > > > > Hope this time, I can make myself clear. ;-) > > > > > do ixgbe_link_setup() ? I believe the problem with the setup is that > > > the sfp_type is only detected once at initialization time and if > > > nothing is in the cage then the code just returns IXGBE_SUCCESS, in > > > which case making this task periodic is useless. the whole issue of > > > hotplug is only addressed by the entire patch which > > > 1) makes the > > > task periodic, 2) changes the actions of the task to look for whether > > > the cage has something in it and whether its been changed and needs t= o > > > be configured again. > > > > > > > > > > > > > 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