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 429B6A0C41; Thu, 30 Sep 2021 12:57:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9DD7410E5; Thu, 30 Sep 2021 12:57:21 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 0C9BC40DDA; Thu, 30 Sep 2021 12:57:19 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10122"; a="288815401" X-IronPort-AV: E=Sophos;i="5.85,336,1624345200"; d="scan'208";a="288815401" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2021 03:57:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,336,1624345200"; d="scan'208";a="708963935" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga005.fm.intel.com with ESMTP; 30 Sep 2021 03:57:18 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 30 Sep 2021 03:57:18 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 30 Sep 2021 03:57:18 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) 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, 30 Sep 2021 03:57:18 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106) 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; Thu, 30 Sep 2021 03:57:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FJx1h4TyAycS/4MQjfSiMEXgIgvgjpNmDFPwJZCveAgxbnUb2MOBR4IVgUIwT1Sy17+5P9Y+VEdWe6MjVeSSFkXlN/VS1V+WYkoEA64cqgphMib2mfrG7HzFVbZFcLPyblCYPEniUzXjvNIfLV8wuC+daAunbT5UQMd4XsApNF4yxIZpuW6wFxkF6DdT9o9YFi+sAg3lNnqVwtqzLf1YDuGHCufJ+gJAXfVgWaFuXcoZlgbhmWNLbB7MAS70p9M59MCxN0GG5O0dPmjBlmKJX3n/ibgwAZZzUr9tq+U0DZ1d0D4WGtPDlmDQ9JqlMEYgMQAzQswWvtM2F7Pt/7KABw== 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=r7Xt6+0Sj1icTY3J1h8t/KaBgpFIcXudjqxo95vhLqo=; b=k21exoX1AAX2Wk2UTMTYAS+C3T0qdvQrkb8o9tFka3uSh/K6rk6WW9BVRbAsQci1L3Lt3NIqJxVpPoC4ycHmuJNEsPg8Csq46XCTpllDIEG0L1RX9VIujaqsFtVTnthH2gr4alQ3x2+tyzKqcqjIZYbRzglzeg8h5L2LT18EuxGC8O9MfBDq6EdUU6KqFKyg/gjAh60d/mNW4z0Yb6sVZmqlrV0oxzU+15EbeCib2JxmTzqsD/fimy/oOSysBCuJyzP88jFWyEaxbKzSQUM8dXv1N1FKqGxJFwTg638wrx48+a/tmxsYOTNjQEFz9D/Q8ThiUmNFMokFB416W8G0Hw== 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=r7Xt6+0Sj1icTY3J1h8t/KaBgpFIcXudjqxo95vhLqo=; b=bgte+hzYoSqqy4sZPxUtA2UHaILSGdKghoecRm/kryRnXcLXLbbdanzzuNwhTyQJiGjNe0HBiHrqITlMlhKRF20FoTJMIkKoMXVVWJYVkMzhM0Jikt+hcG2VO6m21wT7HHgGvlnGeoT7zIj+Tdzrcj+sg3KFEEgYSq6q6UjdFBE= 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 PH0PR11MB5045.namprd11.prod.outlook.com (2603:10b6:510:3f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14; Thu, 30 Sep 2021 10:57:14 +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; Thu, 30 Sep 2021 10:57:14 +0000 To: "Yu, DapengX" , "Richardson, Bruce" , "Ananyev, Konstantin" , "Wu, Jingjing" , "Xing, Beilei" CC: "dev@dpdk.org" , "stable@dpdk.org" References: <20210928033753.1955674-1-dapengx.yu@intel.com> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Thu, 30 Sep 2021 11:57:08 +0100 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DU2PR04CA0342.eurprd04.prod.outlook.com (2603:10a6:10:2b4::21) 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 DU2PR04CA0342.eurprd04.prod.outlook.com (2603:10a6:10:2b4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 10:57:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 846281b3-c958-4f23-c58b-08d984010f9f X-MS-TrafficTypeDiagnostic: PH0PR11MB5045: 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:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zGv5Lmza0O/p2g09yie8BJSUxVo8e3dxjaSccboHoWQgSyRP4CI+Lz+263eK3y4s2TZ/qmfA+AaWZtKAPhS6ifF5G4Ss3CYUxZV6JfGj/JHl9xLvJoalXVSERsYuXT9rWzF4mZGWOepkWFZBAOObNr2wnWZKpvgTiYne2pvLVIiYHZ9BRrYRNjNjHR3KM+5wXfL//rBAFkSOv3pxewjKS9tOfMTuwj11GggmLB2JEKAIQ55MeF7MkfdIkw4bDHw1yDRzHTdZ8PWhjzO40CJ4oJfQOF05pp/ax1UMEae9ISt6uXCB0AFjxdT508gcdAjcUS2XpAcWkZ5Q7Zna/4QI5VCSMHFBHnvXgGt5iB4R6bEOEbHMvGYzbHk2Tu5+HyealhClW/u0Dq6nxT/SZhm8L4Lb6Tq6REK9zDaGOIMLB/ToMmmT9CrGVqhOH1NfaBoY+r/c9Csqn6tNQd86+QtL7ijpbf6GrLY5DuEE/7dxzMsbMr82OyySPwmi0z+WbsBpC3emxBIgqOQ8V8AC3g0MaeDCRdgj+gCR+Yw/mOJVT0LV9O0oL1P5qyg5PkarKyALH3e5EmT5uBEPb5HtT6NX8VP4kVngqeZ+4XqDqYJ755MDOKn2W5AXJXxxY966olQA5CJp17Sqw6fpMKXyRZmm9XVrapBki19otmMp5eanqcQuxAlmppROyHzHWIVFaGEbgXKGWFGuoTTlyoI8744DSwHF0pyfzP4D4YgsylP+NS0= 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)(83380400001)(36756003)(316002)(66946007)(66556008)(2616005)(66476007)(956004)(31696002)(450100002)(6636002)(110136005)(16576012)(4326008)(6666004)(508600001)(53546011)(86362001)(2906002)(186003)(8936002)(921005)(6486002)(26005)(38100700002)(5660300002)(31686004)(44832011)(8676002)(54906003)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QjYranNWSk4rT3JQRy93UjF6M1puY3FvUWJMYjMwS3J0OG84dUxOaU9SNzc0?= =?utf-8?B?d2NXUDhjM1pRa0J5bTNoOHczMG9Ob2UwMFRpd2pWVFF0RStuYnE5K3NRc281?= =?utf-8?B?U1NTTm5mNmc5OW1QbSt4bTlDYjM3ZGFnUEVPZWJSMndOYjlaVVIvMVlXY2NO?= =?utf-8?B?d1doTWR3amFzUkhRRHFSYW1ZUnBWd2ppUWJVN3JvZmVDaUNONnJMOFgzWmhn?= =?utf-8?B?TVVLazVlSHZ0SDVFbGZsODJpZ0VIdk5NZjF0U2JHQ1dJTC8yOWVZc3gxRURz?= =?utf-8?B?Nyt6MFgwU01POFlDbzlCYnZDM0thQjc4L09KZi96V2xZUUllRzdXc0pla24x?= =?utf-8?B?OGpoKzFLT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U?= =?utf-8?B?RXl3cVVDZUlnZnhlVHU5ZUdSbW9zRk5uU3J4ZndxaGZZdEhkWnlaZlErYVM4?= =?utf-8?B?eGhId1FhK2IzZzgrRGt5Y2lPTHc3MHNSVDJHUlUvRkh4UmpLSERmMmtacmsv?= =?utf-8?B?aEYvd05WWlNrdVpWd0hDZlNRdGU1M0czQ2RQYmxieVFuQXp1aXlROWNFUmF2?= =?utf-8?B?dW0rYWY3YkJEbEkrOEM0RFZVN2J6bktjenNodC9SR254RUlkMGlKdzJwRDNE?= =?utf-8?B?cjg5QkVuajhnSTJweU9pMXAvZ3h4aDVCTGFmOTllUG1tUDhNOThjQVN6Snc3?= =?utf-8?B?c2xsM0I3bWpvSDlpV3VJeVQ4SmFBc3kvalo3ekNiblhyOVZDdzBXcWdmQytD?= =?utf-8?B?MnQ3Ynd3UzdYN1NoMzFUaDZFOGp4V3ZIRmtFRHZtRnhqTlgzVlliZTJsV0t4?= =?utf-8?B?UEFpeFpwQ1J5QXdRbFQ3dEt5M2ZROWI3bFNHQlV5eG5ETzZiaDFOeU9zSjhS?= =?utf-8?Q?NisgW1G0dNhn7wEsDjrUO96CQqTKlw/Ies3OSoF?= X-MS-Exchange-CrossTenant-Network-Message-Id: 846281b3-c958-4f23-c58b-08d984010f9f X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 10:57:14.3181 (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: gdQTwTPR0GeZDTfMcv/hgUb5jkLxqO5fPfjCtF06B4eQsXg1QBc/nwUGFI4hwqpCB3SD30ke7THhtLXWdturoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5045 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/30/2021 10:11 AM, Yu, DapengX wrote: > > >> -----Original Message----- >> From: Yigit, Ferruh >> Sent: Thursday, September 30, 2021 12:28 AM >> To: Yu, DapengX ; Richardson, Bruce >> ; Ananyev, Konstantin >> ; Wu, Jingjing ; >> Xing, Beilei >> Cc: dev@dpdk.org; stable@dpdk.org >> Subject: Re: [dpdk-stable] [PATCH] net/iavf: fix multi-process shared data >> >> 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. > In "lib/ethdev/rte_ethdev.h", the global variable rte_eth_devices is used. > So I think use it in a PMD should be also acceptable since it is just read. It is expected for ehtdev APIs to access the array. Application knows only port_id, ethdev layer converts this port_id to device struct by accessing the global array, and drivers should be able to operate only with its device. > rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, > struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) > { > struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > >> >> 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. > > The intention is to read the offload properties of device configuration, so it not > queue specific or PMD specific. It is already in public data structure. > If it is stored in 'iavf_rx_queue' again, the data will be duplicate. > I can see the intention. This is more design concern, you can access to that data structure doesn't mean you should. You will just store the pointer of the 'data', is it duplication?