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 7094AA0C45; Wed, 1 Sep 2021 16:55:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B17F4013F; Wed, 1 Sep 2021 16:55:27 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id AEA8E40041 for ; Wed, 1 Sep 2021 16:55:25 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10094"; a="218490146" X-IronPort-AV: E=Sophos;i="5.84,369,1620716400"; d="scan'208";a="218490146" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2021 07:55:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,369,1620716400"; d="scan'208";a="446613967" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga002.jf.intel.com with ESMTP; 01 Sep 2021 07:55:23 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) 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.2242.12; Wed, 1 Sep 2021 07:55:23 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Wed, 1 Sep 2021 07:55:23 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Wed, 1 Sep 2021 07:55:23 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Wed, 1 Sep 2021 07:55:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XzImeMcQLw6/FfH9N5hEwlbPjW7vvGIxiUxXz5Y9vBuE/uXsYGYB0TEqsmRSPEMn9eKnPlpaxPppTAlnlsPdnGxEI99tG3pWXRLTSRak3Tc1qOn7Q1WD7PKGwJ76vbZ09byx2MBstGKPXpeRJFfJ2jHQiG4/O8AYzHpQ6oC76Qi69Pl3Imlw7GuzMnsnMbvi117C2gbWmA/wuo0xblV7QP01ECpUuBI4xlFhMoG32e7jKLrLk0NASc7OKQSvj82LAjPo9orQTqCH3gQyAT9LJeYRLWkYBnkXd9H2cWgJCxkX1JlaXcZF+Kix8foTbOOJaeIItyiiMQ0b8gAFVR1HLw== 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-SenderADCheck; bh=Vk72/tW598mmpUMuX/Qd2VXVkq7fVT0KFtlfMwOQiBQ=; b=aV1jBwlnW1GwtPHpMIytN8WRiOLBr52R200MI8fxnjNfeDS7No3gkcwMDs4+tg/sJiaMKjcRYPXC2FgtFc87u10h6f+sEbWuMFZHQqKuTu1X6uhHmfz7dw/Ql8BJMmLbLlsb62JnBKng7wLSwiatmM+QAcLRNK7y94MSvBrnCM9nmpDCmgbnvlPIwXV/6SZe36URuduq8Dlo97NA1/Fgea36yWUYYTsABBOY7zGr8ThElDGl85iMfDdP8BAluWVm0+gkrlErW5Oe+a/pMx5oK54p3RH1PbVKIDTXezl10W/nqypG3VcOAFEdkFOerGkAWZ1UfoyteK9+XorTuE+RNw== 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=Vk72/tW598mmpUMuX/Qd2VXVkq7fVT0KFtlfMwOQiBQ=; b=mBNaevyEIccGkbSCxtMMqBLOQGZFIQA0WQZ9mMtKz5niY940lpEmQPwtX8sOjD7HzJ0UxqANL1/uZA30ce7k3DFmkvXelF6iyEcembGtbyGRSLC9hvZ3ezM+1YuAMww6LDGrkQDpD0ZvKdSFAcWKClNPBihobWvriM+DHtoHkeQ= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4854.namprd11.prod.outlook.com (2603:10b6:510:35::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.24; Wed, 1 Sep 2021 14:55:20 +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.4478.020; Wed, 1 Sep 2021 14:55:20 +0000 To: Andrew Rybchenko , Ajit Khaparde , Somnath Kotur , John Daley , Hyong Youb Kim , "Beilei Xing" , Qiming Yang , Qi Zhang , Haiyue Wang , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Thomas Monjalon CC: , Viacheslav Galaktionov , "declan.doherty@intel.com" References: <20210712161747.958019-1-andrew.rybchenko@oktetlabs.ru> <20210831160625.3463129-1-andrew.rybchenko@oktetlabs.ru> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Wed, 1 Sep 2021 15:55:13 +0100 In-Reply-To: <20210831160625.3463129-1-andrew.rybchenko@oktetlabs.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DU2PR04CA0271.eurprd04.prod.outlook.com (2603:10a6:10:28c::6) 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 DU2PR04CA0271.eurprd04.prod.outlook.com (2603:10a6:10:28c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.18 via Frontend Transport; Wed, 1 Sep 2021 14:55:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99e7f59c-3329-4a33-2d7b-08d96d58848c X-MS-TrafficTypeDiagnostic: PH0PR11MB4854: 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:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LX7QeibmNgObjS46S71ykGjKQHdkon1rkXPySW8ho/aAezHHxSWd3YamdTtCZrSrSuHrIGRHQ02aFgRRTH6D0r77TseGGggMhGOogsR4j56jb3v57hmC94SFU/RhlI7CTaCWzwfVz/ubo9Ld4CllKhje0P3+RNtnTmYX5bnXjMzgDQ3dB8co7Bd0u7Zbk+O4I0nb8mxg08duDfoSH0WiNNR5sx21B0E4Z01B17WfUID49Ga9sOqxGPObUIZN5sfOKmSyfqyrYkhquq3DAGl5PGUyxb/F1EyyxC2jjYtOMPdxM1OQg3TO6VjGozdhsLJdcmPdi32s8ScJ87TdJCTkV5gaXIzoNgcqjtsDFChR/p6smqaDCvAQKj5QcCFU+/N9XzCORWPFZQ2esrXa/hc2UoWR1HPh/8Ed1aIvWkoEZKlIQH7xaZKPthoRl/IzcLO+tvF8SKK8b5UtC6tUJbx5DqhyzAwE92LIn5uHNInWmHun3dlw3++59tBUN8T1IlDsdWk2EmM1G8mJYpsph5/FnR2qOV/tTD7eLAzUYVYD/YUJxnNVac+3L8tE72KCtHA4C3epoXc5wpaUKQfXiIpFBYmVHt6JklKSjtSSNhXCvuJmWEhlhWl0j0yoU8aNqfESYlQHR4nO8C6qpawrGmZIFMMt5Mjp840lLwJFNLOC4vvjYT0gGyGQGVW4odBEpvRsxjyFWF4iSnTpHKeKSibdF9jBs74wnAjJ6QP4jyyJzDVQkUtLbnzL0/HL8fUed1h+sZZneKdn11Ztyj8vc/H81hJhvo+g4OUtiUjAodml8dxo/IQ6EIM6p1zKbleifgkT 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(66476007)(66556008)(921005)(2906002)(83380400001)(66946007)(86362001)(54906003)(6666004)(110136005)(6486002)(4326008)(186003)(36756003)(478600001)(966005)(8936002)(26005)(53546011)(2616005)(44832011)(316002)(16576012)(31686004)(5660300002)(7416002)(31696002)(8676002)(38100700002)(956004)(107886003)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SnJVeDZNYjhjRU43c3RzajJWdUJIQlNaWWxKN1N2bEphK3E0Rk9vemdqUk8w?= =?utf-8?B?bFVwZ2lTUjFEUzVuUlJyeHgyTUp1NXJPd1M4bUFFK244M2lieUQ0RmlRTDZi?= =?utf-8?B?NjhVUXZzSHVJZW95dEV5SW91dVlCT0RGSGZUaG9lVTlBVH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dkZZNTI5dG9yVHpUbEw4VFhObkE0?= =?utf-8?B?SHlzZ2dtekY2M3pOUTBFMER5WU1ialUxdUl4V3lHamJ3bHMyb3QySHBqL2tN?= =?utf-8?B?c0NaQnhuZDF1eDR3eE1HUlFPUWR1MGpNTTJPODY2QjFIQ2dsMGgyc25iMlNP?= =?utf-8?B?N09vaU02ZUJ4NnNseDBNVnI3RW1HV0JnK2g3cmlZODFObUlWZUFyRndMSHZH?= =?utf-8?B?Y0RLbWkyQlgyQ05xR3BOQ2FWSVhpcElBOVBNRXVwWlFBbENWSDc3dTgzM1Rz?= =?utf-8?B?ZDNxY1R6dkpnRVZtMWVrZGdRaWtHbGZsUjlyMURDQVQrSXlYMUlTbm5EQ1FB?= =?utf-8?B?ZmVQOEpvZnA0cE5nMXJUY09yRkhWY3FBd24rditUTU1VQjVueU1FclVKTmZJ?= =?utf-8?B?ZUZybzdpUG13aVFWbElacGxRaHFrUEU4MkFPMDc5TDlRUDhYY3VKd2FFMTJ5?= =?utf-8?B?VkRnaWRhd0g1QWJOODM4S1VLM285ZWFnL3FBUHVDcHdoYUpiMEJCeWd1aGFY?= =?utf-8?B?eWM5YVNKdmRhSXNVTnhDVnFMSUhFck5aSDUvM1RicWpVdUJXNWNFM2JHVk1V?= =?utf-8?B?clVmajVrWUV5YVQ4bkJwWnJ0R2s3aUF0YmowWm9JTEd3cCtFZ2pPYlRFcWFC?= =?utf-8?B?eVlVaXpGSmNTT294dWVzc25xMnNBSURiL1gxRm84bzUydUpHMHc4dTVxa1ha?= =?utf-8?Q?xKBa9mo182+QyIt4j+wKd/1HX4dwezkLQreG4JJ?= X-MS-Exchange-CrossTenant-Network-Message-Id: 99e7f59c-3329-4a33-2d7b-08d96d58848c X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2021 14:55:19.9448 (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: 7wItkE6xFS7185kd0UOD47aeBShzxYWNGckRnI1fO1VA0J5lttFfzr4JTG+0er4C7mjFvfhP3JL6nRJd0yRr0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4854 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4] ethdev: fix representor port ID search by name 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 8/31/2021 5:06 PM, Andrew Rybchenko wrote: > From: Viacheslav Galaktionov > > Getting a list of representors from a representor does not make sense. > Instead, a parent device should be used. > Which code is getting list of the representors? As far as I can see impacted APIs are: 'rte_eth_representor_id_get()' 'rte_eth_representor_info_get()' Which are now getting 'parent_port_id' as argument, instead of representro port id. 'rte_eth_representor_info_get()' is using 'representor_info_get()' dev_ops, which is only implemented by 'mlx5', so is this problem only valid for 'mlx5' and can it be solved within PMD implementation? > To this end, extend the rte_eth_dev_data structure to include the port ID > of the backing device for representors. > > Signed-off-by: Viacheslav Galaktionov > Signed-off-by: Andrew Rybchenko > --- > The new field is added into the hole in rte_eth_dev_data structure. > The patch does not change ABI, but extra care is required since ABI > check is disabled for the structure because of the libabigail bug [1]. > > Potentially it is bad for out-of-tree drivers which implement > representors but do not fill in a new parert_port_id field in > rte_eth_dev_data structure. Do we care? > > mlx5 changes should be reviwed by maintainers very carefully, since > we are not sure if we patch it correctly. > > [1] https://sourceware.org/bugzilla/show_bug.cgi?id=28060 > > v4: > - apply mlx5 review notes: remove fallback from generic ethdev > code and add fallback to mlx5 code to handle legacy usecase > > v3: > - fix mlx5 build breakage > > v2: > - fix mlx5 review notes > - try device port ID first before parent in order to address > backward compatibility issue > <...> > index edf96de2dc..72fefa59c2 100644 > --- a/lib/ethdev/rte_ethdev_core.h > +++ b/lib/ethdev/rte_ethdev_core.h > @@ -185,6 +185,12 @@ struct rte_eth_dev_data { > /**< Switch-specific identifier. > * Valid if RTE_ETH_DEV_REPRESENTOR in dev_flags. > */ > + uint16_t parent_port_id; Why 'parent'? Isn't this for the port that port representator represents, does it called 'parent'? Above that device mentioned as 'backing device' a few times, so would something like 'peer_port_id' better? > + /**< Port ID of the backing device. > + * This device will be used to query representor > + * info and calculate representor IDs. > + * Valid if RTE_ETH_DEV_REPRESENTOR in dev_flags. > + */ > Overall I am not feeling good about adding representor port related information withing the device data struct. I wonder if this information can be kept in the device private data. Or, it is hard to explain but can we use something like inheritance, a representor specific dev_data derived from original dev_data. We can store dev_data pointers in 'struct rte_eth_dev' but can cast it to representor specific dev_data when type is representor. struct rte_eth_dev_data_rep struct rte_eth_dev_data This brings lots of complexity though, specially in allocating/freeing this struct, not sure if it worth to the effort.