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 D210CA0547; Wed, 29 Sep 2021 18:28:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 647C6410EA; Wed, 29 Sep 2021 18:28:39 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id DFBDB410E5; Wed, 29 Sep 2021 18:28:36 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10122"; a="288637757" X-IronPort-AV: E=Sophos;i="5.85,332,1624345200"; d="scan'208";a="288637757" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2021 09:28:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,332,1624345200"; d="scan'208";a="655553155" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga005.jf.intel.com with ESMTP; 29 Sep 2021 09:28:35 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 29 Sep 2021 09:28:33 -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.2242.12 via Frontend Transport; Wed, 29 Sep 2021 09:28:33 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) 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.2242.12; Wed, 29 Sep 2021 09:28:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n/l293QKS83dmkKYf9bBzVvrjy5Rx9/B7Nd86PF2kt6XuCQ5ynt9Y/rHrPSw0t+7oTgS1Zfyg04017Yu3kwVv7urpjnoU9RL9hN+sLffN/o3/r49dsNHgxQPHF7bOXxgRSDnOEKdyky4X0zRRIJlnLJLSkO0BluXFQXEjc8hdUr53DwuJ9zO/mQKwYsxTFVw2oIytIDvf7zjuNMmiFkmWyKcuabH7Kku1I9t9cwi9YCGWk4eaLpWfYdzvmnu6kaZw+cA7M276A39f/uq5uBMFxL2dg2uzr2q2uYVChwNyrHTaqxE04GcYIbtxtUmnK2SbOTpAOjrXxgzUpzwWRFelw== 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; bh=EAXnsaQDiAVqY4OiazbCdHCKPp+El99pdvkO2HRKkcQ=; b=RmzRkaXaqeuylzOolqBl5uJ01B8eUcKIYzHT49YIhH6m+ZelQeXOxF8I7F4dGAXH1QJqIJyEoh+Q7qcEtVC3p6o5hXZcQg4q3YlhOIlU+xCDiH29ndVfqJNyNxx/d90mlu18aJ0EeCyIqIqQoqihMOgz8lxS+2C4Jf0BceIZtBtAIfCtEHAQjatVZHxDqjDMWA7GBUOOm+cJPOKzBdQccpMgPB6y5z8eSFsTCMNCdx3z3KwegOCoAdJgsvp1bm8IbOJ5maAIJjAKGqHN3Spfj798qXIeMOtvclEfOiGo7ep8Fq4In6IqHAFCyv1vN8QA6GO1bG1tX+WyVteJ2BvxNw== 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=EAXnsaQDiAVqY4OiazbCdHCKPp+El99pdvkO2HRKkcQ=; b=XPbmsHISUwIImKyt3kCMKNccasIT0Kg3o7l0xherNx4pmjnKG+3y4Uv18WqBZzOru+8hV1k6RfPE+QlVIo5B1K1wE+4839AE7hBoAJMwv0wHTwKSK7TFIgJBzLbw82qbeePIBPwRaI+tnOeLjIvOlMPYZLWhY/PNSl190/S1Ovo= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4776.namprd11.prod.outlook.com (2603:10b6:510:30::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Wed, 29 Sep 2021 16:28:31 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc%5]) with mapi id 15.20.4544.021; Wed, 29 Sep 2021 16:28:31 +0000 To: , Bruce Richardson , Konstantin Ananyev , Jingjing Wu , Beilei Xing CC: , References: <20210928033753.1955674-1-dapengx.yu@intel.com> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Wed, 29 Sep 2021 17:28:25 +0100 In-Reply-To: <20210928033753.1955674-1-dapengx.yu@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DB3PR08CA0013.eurprd08.prod.outlook.com (2603:10a6:8::26) 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 DB3PR08CA0013.eurprd08.prod.outlook.com (2603:10a6:8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.13 via Frontend Transport; Wed, 29 Sep 2021 16:28:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 35b6bcc4-f7ed-474b-faf5-08d983662ccc X-MS-TrafficTypeDiagnostic: PH0PR11MB4776: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8OUsnqYoYD2lAISt/FtuhWvBPvniCQqN3OrERQsKqwJNZKU+GZy8SaaHOpbTAlKTFZvl5NO/hoSlJ9/xBhpVdc9EqDUQsMXebUNVbSAa8WfD4negxWGuN0/X3jMjQ8SpcSZQ7rmR0nyo87MZYNKNKmCbMw08OzkoJ3fLr8Qzq4ibj3gdviix1WGA5hG/jeSyAmbL6toP91mc+KJuwbt8Ql/rOhQN1T4e29BFN0G5baaulKEmdxX/wIPSovLsYDJBPiTkdFms62Vj7pVroDmpQNrDM3yWPbTvuRdij6VmLGOnw4B/eRVtxi9kwZwCTavAi5GBSOQlU3Ri4CQ9hY6FjEYokOH3hPc3h01OEDGwhs3T0Pp7TOjXkb19W/a9oA035o3qrKXrMpAs2sVdNHt/xjUp1HgxXHRu2GsllsjB/5IreVpAI92gy9oW5vMxBqsfax+ssl4dYxOe+01t6WhmcxMGPZfGrxSEj6ZFMxp4VpFgplDWPpPqgKuqTEH7VVKTW4/EWZagTaVJfCMTbmUqMcHqfYVk/62AWhSo/vBrooF/VJthp/N9vjVqqWrkrSgejuHoar8MaoH4+uCgV+AhCQlIdk2AgGVSHsmIDFx2G6Sl1BrhF0B5VK7K4HJimeGcwqYqRk1w+NR/02TlvjLumeYUjSPXSXVpwB8lbL98ejuebkOxsC+DtPuVqcqAv12m4X42igz4XHmuoj6kvD6+GQ== 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:(4636009)(366004)(44832011)(31686004)(450100002)(4326008)(956004)(83380400001)(2616005)(38100700002)(66946007)(66556008)(6666004)(6636002)(66476007)(508600001)(31696002)(86362001)(53546011)(8676002)(2906002)(5660300002)(26005)(110136005)(36756003)(8936002)(186003)(6486002)(316002)(16576012)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dWdoajJxSmFwZFhSVG9HUXlybmUvRWw2UTFFSXdvSTFSZ3R0M3N0ZEpCZklY?= =?utf-8?B?cnhjdFl1MHdzZWQ3N2dsa1hXd1lxRkFOQ3YxY3ZUK1ZKbUlsd3BnYzEwVEpC?= =?utf-8?B?b05vcG53SWJpYUFpM3h4Y0tsbUZvbmNjNGNZVUZSTXdRTkJINE54dDhybElJ?= =?utf-8?B?TWdPcjcwdlJqWklFVlEweGYxUC81VFpyYkdiUlA3b056cUcxbmxvdzlzTmRw?= =?utf-8?B?b2VVL1hReENGWmFmdWlxTHNlZEE2dS92cklnc0lOU3Z1ZjdXTDNCNkNYTHVm?= =?utf-8?B?cU1DWVpOaGJSOVh1TEMwZzNEUHBTcTFQSmNFOGhUVFFLRHpLeFV5b2pWeFJM?= =?utf-8?B?RmtOdHg5eW5iYUJ2dlNBVWh2czVxR09VY2JVRGZjdzRHa3pNbWxFQTM4M2tv?= =?utf-8?B?RDcvY0dvRjA4NGJlWjYvbmNxTUdkRmcvYlJNUzFsZEptbmZRYWd5N0ZvdE8w?= =?utf-8?B?NVJyQ1FaK2UvbkpsQzY4RVdqOXFuZmhTbVJ0ekllaEtBampEY2hlMzhJc2lF?= =?utf-8?B?QnVxc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2hXWlcrQTZ1?= =?utf-8?B?aTNoVTExT0lvWTd2Z0NFZjJXeW5DZkYvamlqY0t4dGZoc0R3Y3VUTW9MSVBv?= =?utf-8?B?Y0dPcHpTVGcyaW1KUTl4Z1E3d0ZqOHFoYUpTdG1KS05Qemd6OFpXVnlmbUIv?= =?utf-8?B?Tm1JUXdJYWtzdjVVNmRjaVZiQnNRUkFaSDQ5U083ZXdxSWp3MGN6N3RYZTNv?= =?utf-8?B?Rkk2eVFxQkVsZlJPNnRQUjRSOStsRUk5a210VWJCSDhtL0dzMU44aGxmc0ly?= =?utf-8?B?TkdUUHZBaTRUSEdTL0I5cjNibU9GWlBkVkpMZzlNODlVbW4wb0kwcmFsQVhO?= =?utf-8?Q?/jgpm3P7ljvTb4byShj9lZjE4ng1nxUbh3Q3l35?= X-MS-Exchange-CrossTenant-Network-Message-Id: 35b6bcc4-f7ed-474b-faf5-08d983662ccc X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2021 16:28:31.4405 (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: FV9xRMaeaAS3UQPfPXrVZZvDXbtpL3z3gJ2CO18rFyjMM4Ba3IzhzTE+gdeozbLVJyXhMHopMxyNtC2dJflGOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4776 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] net/iavf: fix multi-process shared data 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 9/28/2021 4:37 AM, dapengx.yu@intel.com wrote: > From: Dapeng Yu > > When the iavf_adapter instance is not initialized completedly in the > primary process, the secondary process accesses its "rte_eth_dev" > member, it causes secondary process crash. > > This patch replaces adapter->eth_dev with rte_eth_devices[port_id] in > the data paths where rte_eth_dev instance is accessed. > > Fixes: f978c1c9b3b5 ("net/iavf: add RSS hash parsing in AVX path") > Fixes: 9c9aa0040344 ("net/iavf: add offload path for Rx AVX512 flex descriptor") > Fixes: 63660ea3ee0b ("net/iavf: add RSS hash parsing in SSE path") > Cc: stable@dpdk.org > > Signed-off-by: Dapeng Yu > --- > drivers/net/iavf/iavf_rxtx_vec_avx2.c | 5 +++-- > drivers/net/iavf/iavf_rxtx_vec_avx512.c | 5 +++-- > drivers/net/iavf/iavf_rxtx_vec_sse.c | 3 ++- > 3 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx2.c b/drivers/net/iavf/iavf_rxtx_vec_avx2.c > index 475070e036..59b086ade5 100644 > --- a/drivers/net/iavf/iavf_rxtx_vec_avx2.c > +++ b/drivers/net/iavf/iavf_rxtx_vec_avx2.c > @@ -525,6 +525,7 @@ _iavf_recv_raw_pkts_vec_avx2_flex_rxd(struct iavf_rx_queue *rxq, > #define IAVF_DESCS_PER_LOOP_AVX 8 > > const uint32_t *type_table = rxq->vsi->adapter->ptype_tbl; > + struct rte_eth_dev *dev = &rte_eth_devices[rxq->port_id]; > It is not good idea to access global variable directly from the driver. The problem definition is correct, eth_dev is unique per process, so it can't be saved to a shared struct. But here I assume real intention is to be able to access PMD specific data from queue struct, for this what about storing 'rte_eth_dev_data' in the 'iavf_rx_queue', this should sove the problem without accessing the global variable.