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 BE845A0C41; Thu, 4 Nov 2021 15:22:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A649A4276E; Thu, 4 Nov 2021 15:22:35 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 0773E4276D for ; Thu, 4 Nov 2021 15:22:32 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10157"; a="231560256" X-IronPort-AV: E=Sophos;i="5.87,209,1631602800"; d="scan'208";a="231560256" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2021 07:22:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,209,1631602800"; d="scan'208";a="532280707" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga001.jf.intel.com with ESMTP; 04 Nov 2021 07:22:30 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 4 Nov 2021 07:22:29 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 4 Nov 2021 07:22:29 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.42) 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.2242.12; Thu, 4 Nov 2021 07:22:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HrlisdEuD/1oXTmffAqmdkK+ItrUFXqpbnkgj9TbvcuPc1qVmkPG48NIJcBPvY5tTuSK0DvRjs4r4KVsFQAtnA4jOBstAqiUhgGgyAPb/WFWpJT65ylmg2zirFpM8hGEK90fIguwyoHv89UY1xSRG3Lzl0IFnzTczxOQvRerDIBbQQJEP7Ta8sxiGu4xhfpHehFMURpaDjMsXLt/k+3K0yt1PaYBcy+xiTuoEUahyrDiXHzG0CU531CE0sPCDQ1/YxQrLXTylOsd5fqJygvf+G7DdmRCB4dUsdRSQwxdfgqwAm8MQ1f2Y9xXQC9rnxBI3u09DaabTKCaVjAt3hYPPg== 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=7KM4yurWuOwEL4evVOk193B3b6smdhvm7SKo+hJvvyc=; b=QDSgi3eXIrHTelS7ur1j7UGKyp4K+UBPK0VRNHO8ui824vD5+k4QOwMO+Q1yGnKDehOtwSZ9jGd8t06N2yM1Ux2JMygMWxcMuQjlGtyQP18sz094pI/BcX5LMtrOQmo59DBBdByFMtfwSS520wTGtVfQ1+R/tiSifpdR+HCn8qtt7HzpPZOXWHGqTBijt2/wH0FoY0yYs7jpYpNDzIQnCO9aZshimzVsKm9g7j22BTbluS+cSo1Tr+WVISSkSTTkBnTqgZ2QAD3mlWG1gBA8XFPibj8EXDnPQw9F8iU1Bq6LtsV0tUjKJpL6ExwNlWx4/J9LHOCR0+8jEB58m/qnXA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7KM4yurWuOwEL4evVOk193B3b6smdhvm7SKo+hJvvyc=; b=u31kT9r0zuGoEp1umQvi28Fg87Qt1U7SCqfCdqyDvMtlkMy/oU8ODBi4i22T8+sipLUo1VEYSrsTJdVsgm9Ee0aeZfohKbqQ1Kbx22KEEID/LFSIvnpApD3BJv7cleCWioPC94yLT1aJCmGGDr9PR9dUIrhx/DRJie1/gVx8L5Y= Authentication-Results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4903.namprd11.prod.outlook.com (2603:10b6:510:36::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Thu, 4 Nov 2021 14:22:28 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%7]) with mapi id 15.20.4669.011; Thu, 4 Nov 2021 14:22:28 +0000 Message-ID: <98d4c133-28e4-785d-b8df-8dab6c64f361@intel.com> Date: Thu, 4 Nov 2021 14:22:22 +0000 Content-Language: en-US To: "Min Hu (Connor)" , CC: References: <20211102013829.42345-1-humin29@huawei.com> <20211102013829.42345-3-humin29@huawei.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20211102013829.42345-3-humin29@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0346.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18d::9) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by LO4P123CA0346.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Thu, 4 Nov 2021 14:22:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93da94fd-984c-4d14-56d4-08d99f9e8766 X-MS-TrafficTypeDiagnostic: PH0PR11MB4903: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lgm/K9nzsSwTqWl8c4egSG5/5KOFXocmyQcSC3+39/pmm8ih9yDjmhUNONd0tbMpE6486f2CJfr7SCYfQeLnSIl8/mZIzzYWYDtzQ9MRekrpMeWwIlQpDQHpDX8j2qsxalknCtRpgMG/EpGlSDS3paj/hffAnzrthoxrw/iYkXQCOfixx4TeVbF/6fUSFdR0BGyE6s/djy8Nh5sxeLXYFzH5g7VmrWvAR1uFaHlgL9Wmyb3fmksLz0Wr/9EwWzAIMQpKMJWqwd2LDoQ+x+wwqBr8QwCDKqyEYnwZeFNalSd9OhMwSlJbr4G5w7bmuRBCKoYlWNNFcZuixEt0WDB2Xxa9YCY/VV1QF+Erlmbeb3b3lLdwTx+95Cg1Pj6KsUJlEgrrQQD7poJhn73/EuZuvmD/D+r/vsAZTp2V+gPOBckDGmQDqsaYsnJwApIJbrKPTBdahLr7F3thW+iWv4XXynUOUCL9Xq4QFiIIJyb7cxh6gbsTbxMtgaoTSQU4G2f9S5MOvmkzJruMZzlW3Px9eKFOYqtuN2NjIy/6p89NxuwGoTeGNRPLEB+LuD166MIAA6g8g2Q2zD5mpr8Q0sq6n3BYsQeWGPWcmPMSJTFYf8jftkedidLQrTnuWmZJjCnJG93bV3mO4fUobQuZpgIqjI30wb5hgeMaVNMvSwj2LRHCbBfURYInLVsLzVPLMS2tsc8taNjQAVcAsN42YZ3FRg== 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:(366004)(86362001)(956004)(508600001)(2906002)(53546011)(8936002)(66476007)(66946007)(38100700002)(2616005)(66556008)(8676002)(44832011)(82960400001)(83380400001)(36756003)(26005)(5660300002)(31696002)(16576012)(4326008)(31686004)(6486002)(316002)(186003)(6666004)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MVg0REI3OFlPTnFNUjRrOVF6cFRyKzhhQzZuVDZtS0laSmtzV1p2US9FUk9p?= =?utf-8?B?V3J3WnVQcHpuS2d5OU0ra2xBSmc3UzhIUWpPRkdnZ1owTW5HRFBzejZBcU5R?= =?utf-8?B?MGZ2QlpwTFhQbHQxUndCUnVJOUJuSC9oQlU5R29JSndLZUVzT3MyYTJDWmVn?= =?utf-8?B?QnpzZklyYzlRcG5sMlo2ams1bnNPUWtReTRXTGEvL1VTRGZQMDE0YkE4c2Rw?= =?utf-8?B?NnNXZnc1QmRkK0tseWU5dU9KUUI3aFQ1aXlZaFp0YWl3THhIcmFDMll2RzFQ?= =?utf-8?B?SklyTEV5MEpiR0hCVE9DbUxqeVFyL2tOODhxTlNvL2VtU2k4WkJscWw1aE5I?= =?utf-8?B?eTdxZUIwL2RaMnlPR3JLL0xlbW9zZDA4d1RSdTdXYlE1WWEzcEJzWDk1bkhS?= =?utf-8?B?UTQ3bDZXZHlnMFJzRVZqeDFZYU9xUnV6WGF6eEhaWlA0Z2FqYVFsV2dxaTBW?= =?utf-8?B?MDFtSEhOdUdXOXNyTlM2ZkVGUjlVMHFaWExXYk1i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jandxaWhmR2hQcDlWWWNpUG9vbDJvOUNSaisyZlJ5MjlJ?= =?utf-8?B?QmVNWVZnd3BhcG5nSkdhSFo3aFpvNUk1a1NKZVVZWHFFVlJQeDhrQXRrenVq?= =?utf-8?B?ZWJWMmV1aCszSWxYS2kremVKZkNkTzkxVEpPZ2ZYa2VWT2tiRjZqeDMwUGlP?= =?utf-8?B?ZGR6eGNMQU8ydm1VRU1QS0c4VUpweHJCelB5Z1QxZSsveWZ5em13VEVkSmRr?= =?utf-8?B?eDc4UnRYZjBVakswSFd1YjBxMGhDOHk3QUJHbTNNcDl2MzJvODMyMGxMdTFz?= =?utf-8?B?MGRwaUtodkIyL0pyWXRSRnNRczdxaUI1YWxScFRxOUtOUTlRU0t0anI2dlJz?= =?utf-8?B?eUZvM3ByZlZmUXliWDZScU16blF4dDBXWXJncXVjZGN2bDR6eUxkU2pLd3hM?= =?utf-8?B?cks4QmlPYnF0UzdLbWpHYWJVc3VDc1ZHckNRRWlkUEVTclFobVkwNkM5dDl6?= =?utf-8?B?R1VYVzczL1ZJRzA0OCtrbDBiRVZyNUliMFFzcjNzc2Urd0VWNGQwbHN1ZFR5?= =?utf-8?B?MkVaVUFLWHlDNG50NU9wbm9jR0wvbjk1VEFjTVRrZGZvbG8vUzA1RE81MGk4?= =?utf-8?B?U0FNSzYvY0U1eC8zeUIycXpUMzdkR3d1bnp0QTJONVo1akp6K2NFU28vbXhy?= =?utf-8?B?b3ludXg4ZHVFUkxNeGNObEg3SzBXdmxBT1d5RWJJN25hbCtUMDdyMDlsOTdV?= =?utf-8?B?SUVQUFZFTjEvdlBhRVJ6ejh6QU5nZDgwZWNOaHZJOEVNSnNMdjRsMGI2TkRQ?= =?utf-8?Q?soXdunYHnuctvJ8Js+LIjWA=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 93da94fd-984c-4d14-56d4-08d99f9e8766 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2021 14:22:28.0143 (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: shM/dvgO4zO0zAkmxev7E5YSDdyTI2WY1WZD6xs6NafhmkrgoQQagKXrJvVUCW7LrNXtZURX2jNSw3oChziKmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4903 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 2/4] net/hns3: fix MP action register and unregister 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 Sender: "dev" On 11/2/2021 1:38 AM, Min Hu (Connor) wrote: > From: Huisong Li > > The multi-process has the following problems: > 1) After a port in primary process is closed, the mp action of the process > is unregistered. which will cause that other device in the primary > process cannot respond to requests from secondary processes. > 2) Because variable "hns3_inited" is set to true without returning an > initial value, the mp action cannot be registered again after it is > unregistered. > 3) The mp action of primary and secondary process need to be registered > only once regardless of port numbers in the process. That's what > variable "hns3_inited" does. But the variable is difficult to > understand. > > This patch adds a hns3_process_local_data structure to resolve above > problems. > > Fixes: 9570b1fdbdad ("net/hns3: check multi-process action register result") > Fixes: 23d4b61fee5d ("net/hns3: support multiple process") > > Signed-off-by: Huisong Li > Signed-off-by: Min Hu (Connor) <...> > @@ -12,7 +12,8 @@ > #include "hns3_rxtx.h" > #include "hns3_mp.h" > > -static bool hns3_inited; > +/* local data for primary or secondary process. */ > +struct hns3_process_local_data process_data; > I was here to complain about non-static global variable that doesn't have driver namespace ('hns3_'), but I can see later patches are converting this variable to a static global, so I guess it is OK to have it temporarily.