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 1E204A0C4C; Mon, 4 Oct 2021 13:22:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA3EC4133D; Mon, 4 Oct 2021 13:22:11 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 8D35E4133A for ; Mon, 4 Oct 2021 13:22:09 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="206195418" X-IronPort-AV: E=Sophos;i="5.85,345,1624345200"; d="scan'208";a="206195418" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 04:20:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,345,1624345200"; d="scan'208";a="711156281" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga006.fm.intel.com with ESMTP; 04 Oct 2021 04:20:20 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 4 Oct 2021 04:20:20 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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 via Frontend Transport; Mon, 4 Oct 2021 04:20:20 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 4 Oct 2021 04:20:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zx+Ijps/mjhjhQpI9/TQf28g4s3u+0I4eVW2ohrf19c5lhU9gg4YsTq2IH2cAtv6fKgcWkyVm8OPpOh6lYX7WN2IgoW/vfq53Ww2CLlFs6NAEFllzDp9OHFa76LZlGAUGz/3DUoikxTT9/03PIybI7eEWWwdU5viEILoRNGtvP4QswMAPEffHEww0fxsQE4AWvvEnQTMQWw4AFtqYH3NrOGMRPemY2JJNOLtQADc+QphdCaO5g6HrfGWeacOWBzc++7AfXT17Z6VzPNs6e1GttaETyWqEiK2FbCTolNx2AiPGT0db2R24NY9CqdYCMhTa5+ZQHNF5A/NETl5JMcQQw== 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=zKTgggVxzVByWPPWvPM74Mmhi5spqIv9wmdlO6yn7iU=; b=oUoXyDZLUmyfujtfNpSnl+94lGLYjGyhEabtsA4v+GT4Atb1vAQg7cJ9rYUzSEINiE+KdAsqfKwbioIeLDN3raCxnKugzufUEnehgePM5Xr3MOcJjLZn/gEYXq3/OGEfnFtZYgqgSd158SxBRUH1xfayyK91F08xIFu6dd2gCndH2B+BzZEasQarYGsUjB2f391LBChxPoqFPmj0va1xNRSJieRiIS9EIlep13UdfllEi/BMFj+zWTeGU8RSL3XcWtLn9lJJ07Tw+rSk3NDYT1wEd3l5kfYotSlzI1lDZtL138zP4lHAB4Hrg5Wj01rYnhwgPdhR0GH8+1/AiVnqKw== 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=zKTgggVxzVByWPPWvPM74Mmhi5spqIv9wmdlO6yn7iU=; b=sWFIYpq3Uf7W9+A5O7v4k+XOzud9QmxfaR13qhJMkbTxpXPBO4kHv00lA4T05ZvM6qWzuVt9HDhPe475l5LUkr1i1WRHKyV4fjNr+nrgdscGfOQhPzaJ4lwYuTaOfsYRnh/pQ5AwTjn1/wDc2rUwol0+bbRR1MzngA+dkQq6fi4= 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 PH0PR11MB5159.namprd11.prod.outlook.com (2603:10b6:510:3c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.17; Mon, 4 Oct 2021 11:20:19 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc%4]) with mapi id 15.20.4566.022; Mon, 4 Oct 2021 11:20:19 +0000 To: Thomas Monjalon , "Wang, Jie1X" CC: "dev@dpdk.org" , "andrew.rybchenko@oktetlabs.ru" , "Li, Xiaoyun" , "Yang, SteveX" References: <20210827081740.365037-1-jie1x.wang@intel.com> <2103588.zk1eQJicq0@thomas> <1981336.HCRrZqnFLi@thomas> From: Ferruh Yigit X-User: ferruhy Message-ID: <2fb0b525-8bff-5ae6-52b5-34fee03d6e87@intel.com> Date: Mon, 4 Oct 2021 12:20:12 +0100 In-Reply-To: <1981336.HCRrZqnFLi@thomas> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DBBPR09CA0032.eurprd09.prod.outlook.com (2603:10a6:10:d4::20) 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 DBBPR09CA0032.eurprd09.prod.outlook.com (2603:10a6:10:d4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Mon, 4 Oct 2021 11:20:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f4eb1994-8732-4dd9-bf3d-08d98728f2df X-MS-TrafficTypeDiagnostic: PH0PR11MB5159: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UB3kxruBSomD+ae8ebUveJG1H9InLGNQncz9+yC2tEdnJI+SKr+F/b/8VlOvyzbhhQr5UVaiwCDVFixPXDzGz8UxOpcKP7NrjQ+tFtDoW4YU5UaYcLghSvssE7AS1RryfEsHZM/1HPv4h6qnQd1K9pSBc6+oZ6Iz1auzaQV2U1V/cTEDF1MOQebhL5ziXwCs11I6gMXCvlHNXDNSBBrj+9iF0KeiJi7fgb2rZ8flvLqr6giHojVKtfHFUNk60/tkPpPkTx75XN6R9MswHOmQ6nrJFefcI7E8qyRpIfzfWnKU4VsJoM+FCkgvMWBQXtgTTCDsTR1U8dfaeP3OG45z4vgdkf3MRnKqL/3/fqVXRkmncxRip7qMqs/SmyABBJ9YPIOtXvfmen3Nu5TQ+LxQiQgPC8ETjfZxj7Jo6NLfBH77CelEmz7vBcGR52uFqyyC/kriy175v8YL8hKnC7eLojdpWXxz7nUHkvxbAIIw3d/SJeg6HopWhDYSCCbZku+mKby/bbfAPv05aVAGOuJOk7qPoE3jVhAXrSYgKEHf+3yFbXMMjQP1LDOKS9zRLe2IsYDEbxOZyhTxTFt+QqUMjsipXmqJWo+hqDmIrTGj3zNc+5wkoE5x55/c6zwfHB08IMaO8bhL+6pJMedff0VikXIa75MIkg2fcyg3TFwHvOJflXwsVKPstfhTfUyIPtWB7xF2QPJoWwftcDFaNqTyIw== 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)(8936002)(316002)(38100700002)(54906003)(16576012)(66476007)(66556008)(5660300002)(107886003)(53546011)(8676002)(110136005)(36756003)(66946007)(6666004)(44832011)(83380400001)(31686004)(186003)(6636002)(956004)(2616005)(4326008)(2906002)(86362001)(31696002)(26005)(6486002)(508600001)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cUxqdUl4WkJKUkp6aXR0TUFDSjRrTFk3YXZualRnQTlnV2xld3E0Z3VoOWNu?= =?utf-8?B?VnFRd2xqMlhzQlp2VzRvL1BBL1ZCTHg0NVlyS1RTR3pNYmhZZmpmd09laXBZ?= =?utf-8?B?UkdYOXNnTnVScUlaS0Y3TEIwUGJ3YVhqN2ZiRnFXajVHaExDVXVEZnVaL1pQ?= =?utf-8?B?YVJvamsvYnVRV1RSQ0I4QUNVTm43eGZ0aWZjakc4dHVONUZNMVNScmlEZU9p?= =?utf-8?B?cS9qdVBMd2M5cnlQYjVUeEw5K2NNRHZPNTJURjVJMlpHVmo0YW4xbHo5Y3Vw?= =?utf-8?B?bzVJRjM5OW56UGIwZCtYcFBDa1hHUDhlanRhbjFTbFZiTXpOS1F5Zkh2Mmhi?= =?utf-8?B?eFI4NmtMS3Y5RjIzbjZvbnBTYXhDSGJsaVpqOHpRWm5pOWcybzkyZndUbEVN?= =?utf-8?B?Q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dt?= =?utf-8?B?VnlxN0JkbitEdjdOekpFNlI1c25wRktPRjZYdTNCNnVzakNPTHRwMVhiYlNC?= =?utf-8?B?em5WNHhGNmFMUmUzM25zWlV3NHZJSEpvUEZNSVAvTUNVK0tSUURnaWo3MDFo?= =?utf-8?B?VjR4T0V4QjF3dndWSjRNNE16WnozMEVFSlFRdW55ODRUU3ZnMFZpUDR6RUtD?= =?utf-8?B?cXhZaDd2Mm1yRTB3K0RVM0Q3ODJzSXdrLy8xWGlwRXZmdTkzR0doMU15MG1N?= =?utf-8?B?bHJiL21vazZIMkVNQU9kMHljT3Y3MDk0eDJYc1FDVkYrUCsvaEdjajJHd05D?= =?utf-8?B?Sy84SzBKN2dWcXRVdGNIcC9iaTRCdTIrSDVQNklGeHREMjlrdFRPSVpkbURS?= =?utf-8?B?ekVGY3ROTXN0TERSTllLSzRlTUNQT2NCWG9xNEV1bDR4bWRLczhLc0NFTkgz?= =?utf-8?Q?RhH8CjbI8WFrsbXJkNYIsLE8FsK/LBYscSIZyCX?= X-MS-Exchange-CrossTenant-Network-Message-Id: f4eb1994-8732-4dd9-bf3d-08d98728f2df X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2021 11:20:19.4270 (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: 3hK3bSbztY3xEvucWcGnubDo718W41NCA4p15IApR7Onsb5qFYDBwiXk29s0m5jiMFnSZe93uoMYzNHAEhK/aw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5159 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v9 1/3] ethdev: add an API to get device configuration info 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/27/2021 8:56 AM, Thomas Monjalon wrote: > 27/09/2021 09:21, Wang, Jie1X: >> From: Thomas Monjalon >>> 26/09/2021 11:20, Jie Wang: >>>> This patch adds a new API "rte_eth_dev_conf_info_get()" to help users >>>> get device configuration info. >>> [...] >>>> + * Retrieve the configuration of an Ethernet device. >>>> + * >>>> + * @param port_id >>>> + * The port identifier of the Ethernet device. >>>> + * @param dev_conf_info >>>> + * A pointer to a structure of type *rte_eth_conf* to be filled with >>>> + * the configuration of the Ethernet device. >>>> + * And the memory of the structure should be allocated by the caller. >>>> + * @return >>>> + * - (0) if successful. >>>> + * - (-ENODEV) if *port_id* invalid. >>>> + * - (-EINVAL) if bad parameter. >>>> + */ >>>> +__rte_experimental >>>> +int rte_eth_dev_conf_info_get(uint16_t port_id, >>>> + struct rte_eth_conf *dev_conf_info); >>> >>> It does not make sense to me. >>> rte_eth_conf is passed by the app to rte_eth_dev_configure. >>> Why the app would need to get the same info back? >>> >>> >> >> In rte_eth_dev_configure, dev->data->dev_conf copies the info from port->dev_conf, and then the driver updates it. It doesn't same as port->dev_conf. >> We need to get the updated device configuration. > > OK I see. > Please update the commit log to explain this. > Also either an application needs to keep copy of the configuration (like testpmd does), or won't have any way to know device configuration details. And for the apps that keeps the configuration, it has a risk that application copy and device copy of the configuration diverged, as Jie mentioned. I think it makes sense to have a way to get the configuration from device, small applications can rely on it without keeping a copy of a config at all. And for testpmd, we have aligned with Xiaoyun to rely on the device configuration more, in a way: - When to display a config, use device copy as much as possible - Use app copy of config to accumulate user config change requests to apply them later, sync app config with device config after config applied.