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 D7E6D42D8D; Thu, 29 Jun 2023 16:20:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C948940EDB; Thu, 29 Jun 2023 16:20:34 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2086.outbound.protection.outlook.com [40.107.243.86]) by mails.dpdk.org (Postfix) with ESMTP id 56A72406B7; Thu, 29 Jun 2023 16:20:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hZ+ON5w2RmMGWbeIUCcvGW1xEV0HNVZsxMQUENuh2uTaE4kQubM6TsQ1MwjOxZuS05z01ApPBYk1wa+501/X5pOGRt8Yhq8xwdqytkcVN6atRs2obrmk7eP3AS9ljsyz64Oo6jjMsORNIYUN77K1DN1m0OHmY/P3V1kmnA48KtseOoYLgfXDEd2Mgkdw9LCZ+PUM4M22xYNAXowJYuXR6ivseBd+ZkP+GnMaKXkdy2xqI9nvtln15CVs+TqcdQB9c25VxnmBI0iXvlzBPObJkqSKLVjhh1lK4Ey7+yFoBjsbpZ2LTEDIva01tpTVlg1Gdn25xRGIFW6jfDQfa8LxcA== 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=EII0x5bgpyYOd2W1OMl/T9EoCLoDfGRxvn/SE4KJAKY=; b=WJaboebmWkkyB4RdKlyfs+rgrgcrrsjbSzC8dP5od83MCSG968lWgQX5JeQgUbaC4fd/fwGjW9OTQBY7kEb/jMgtQj3QlXMm5E0sPJUE0j/J5/j86kFC8igmkw/SPj+1v0vl6CAxkS3NoKvatBfQXKE0Zp2A5Cj14iUh2+oFLLXxNRll1fnXGVNnnRPdEudRLEZCpc+F6ivkkiPfIGsnIKHzCMWDZ17FG+0MI9VNzYmoMNNEDEjNLnQ9ixhDkrEl1nFCYyisWxO6AcQlwowHff7WcoPi5u6jGo0qVKMpReF5Jp5UdFruydM2ag0Ilar4pWEGZhrdroaLctVQIh2HYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EII0x5bgpyYOd2W1OMl/T9EoCLoDfGRxvn/SE4KJAKY=; b=KTzuOs9SgmubykR0KEtTXoUBMNiuzPiJyQYHDtaQwUeQnO1TbfuWJubW3S0fhmL17MSGRA2qPKUD4qS5xcLhYc2aAv2wRxFdgNnruMYyLMDDUsdOhRuSAW9WuVY5yQGcxkFbHKKfmILmVEUBWklps/HkmFlIJM/b5fsFPB1xaTg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by DS7PR12MB8084.namprd12.prod.outlook.com (2603:10b6:8:ef::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.15; Thu, 29 Jun 2023 14:20:31 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::16e3:326c:5c2a:be42]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::16e3:326c:5c2a:be42%3]) with mapi id 15.20.6544.012; Thu, 29 Jun 2023 14:20:30 +0000 Message-ID: Date: Thu, 29 Jun 2023 15:20:26 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Content-Language: en-US To: Jiawen Wu , dev@dpdk.org Cc: stable@dpdk.org References: <20230629100735.297306-1-jiawenwu@trustnetic.com> From: Ferruh Yigit Subject: Re: [PATCH] net/txgbe: fix blocking system events In-Reply-To: <20230629100735.297306-1-jiawenwu@trustnetic.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PR1PR01CA0035.eurprd01.prod.exchangelabs.com (2603:10a6:102::48) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DS7PR12MB8084:EE_ X-MS-Office365-Filtering-Correlation-Id: 99147265-fa1c-4da9-e22d-08db78abfe44 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DcKhCqdNm3mM06LR6yGZWvQbh5T+vi8jgkLyxsl0KwLIDyiKVDPYp07OLe0tmFaQpqBSfkO3Ywl5cBzATbj7S/hxmtRtvif1nKm4hP2drQOo89nJFCSSDgzwx80cVObyGjZ5IBQSTkTqIoV+5aA7KnG5LyjhG7cWobkwHlipyJH7JYlNiBAoS8IDIs4Meu5k5gvoLO01SnR0o4YqEGE2I6PsSOOvdl0uvWszYLN2Mpxui1yw0XUPnABjZPmus8jBFeI0Qfq1t9p1uytRxHxqYQkpEdJyFbEctF7mHZ9AaflpVFyHiq6sAZfndMxUTu9xXaKHKbY2uuYOntAvIIcxTvjjnoMjd3Huykpr2AIePk9wlAYT1onM3sZtREBrYo/kNObQPJ3Rs2Z/owY7bCqv4rlYSt7g0cbskXqix3e39ZV5la499cgUbPscZPJ48waBcK6qh98FSzvDD0+LPEFGkFspY2yC8heqWqUPxcdDGGWQFqqej6KQCcOOZMH8XO82isyXGS3lWYqStsigdS84JO2CputMe//QwzmUYj5vAfynftfF490HaiWa1HF2HsxvrwNy40hRr+VxU5GQoxGdjxLtEoRCod/5SFpp11N1GsP44pL3e3is6O0hV9Uu5G7oEHwtQDfNsOB6VVK08NWZBw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(136003)(346002)(39860400002)(366004)(396003)(376002)(451199021)(6486002)(38100700002)(53546011)(6666004)(2616005)(83380400001)(6506007)(26005)(186003)(6512007)(41300700001)(31696002)(86362001)(316002)(2906002)(36756003)(66556008)(66476007)(66946007)(31686004)(4326008)(44832011)(5660300002)(8676002)(8936002)(478600001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MGFhTXZFVHY2MUlSd1V6UmFSN2lMMmlQaEJlMGgwM3BuWlc2dkdoTW01cmFr?= =?utf-8?B?M2VyeGVIemNuUEtZRTBSTUNvY1BSM2xUa2ZQY1d0TWVIWS92aUdQUUpRdE9X?= =?utf-8?B?My81WUNMbUd0RWx3YURRcUxsUUx2V3dwNFN0ZmtMVTZFdkptbkhvRjdhWDFV?= =?utf-8?B?QUlZcXBzTm9hK3BZamVvSVZOL1d4M2t2N0RvQnpuYVZ4UGxRY29mUmUzK3Jo?= =?utf-8?B?T0MyMmIyY1NTSDNCQUdzamR5V3h6cGU2YmZQVGM5TjFxUGowU2ZqeUF5Umk0?= =?utf-8?B?bFU1LzNMY3JJWkZkcWIxNCtzdXN1M1pyMWh2a0JmZ3lkck1zdmg3MWVxcG54?= =?utf-8?B?VTZBWXFlRU5ObUEvUW0yUXNhVCtDbUdqT3hSZ21Ydk5FVmxHangxMHo5RE9h?= =?utf-8?B?L0xFVldEK3JZazFmSk12WlcvZzJ3WVJ1Y0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.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2023 14:20:30.6241 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AeSgShxsmhd6UBg/srETMNVr0LzLTdhRzZkaTUibV3yxYhgPzlbQXaOBJZmurmBP X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8084 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 On 6/29/2023 11:07 AM, Jiawen Wu wrote: > Refer to commit 819d0d1d57f1 ("net/ixgbe: fix blocking system events"). > Fix the same issue as ixgbe. > Can you please describe the problem in this commit log, it is OK to keep reference to the ixgbe too, but better to describe problem here. > Replace rte alarm thread with an independent thread. > > Fixes: 0c061eadec59 ("net/txgbe: add link status change") > Cc: stable@dpdk.org > > Signed-off-by: Jiawen Wu <...> > +static uint32_t > +txgbe_dev_setup_link_thread_handler(void *param) > +{ > + struct rte_eth_dev *dev = (struct rte_eth_dev *)param; > + struct txgbe_hw *hw = TXGBE_DEV_HW(dev); > + struct txgbe_interrupt *intr = TXGBE_DEV_INTR(dev); > + struct txgbe_adapter *ad = TXGBE_DEV_ADAPTER(dev); > + u32 speed; > + bool autoneg = false; > + > + rte_thread_detach(rte_thread_self()); > + speed = hw->phy.autoneg_advertised; > + if (!speed) > + hw->mac.get_link_capabilities(hw, &speed, &autoneg); > + > + hw->mac.setup_link(hw, speed, true); > + > + intr->flags &= ~TXGBE_FLAG_NEED_LINK_CONFIG; > + __atomic_clear(&ad->link_thread_running, __ATOMIC_SEQ_CST); > + return 0; > +} > + 'txgbe_dev_setup_link_alarm_handler()' and above new 'txgbe_dev_setup_link_thread_handler()' are smilar and share common code, what do you think to extract common code to a function?