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 BE893A034F; Fri, 8 Oct 2021 14:10:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B21F640DDD; Fri, 8 Oct 2021 14:10:54 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 80D934068E for ; Fri, 8 Oct 2021 14:10:52 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="226394197" X-IronPort-AV: E=Sophos;i="5.85,357,1624345200"; d="scan'208";a="226394197" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2021 05:10:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,357,1624345200"; d="scan'208";a="624718982" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga001.fm.intel.com with ESMTP; 08 Oct 2021 05:10:51 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) 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; Fri, 8 Oct 2021 05:10:50 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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 via Frontend Transport; Fri, 8 Oct 2021 05:10:50 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.174) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Fri, 8 Oct 2021 05:10:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ATmE1WsnlK4HI5nBVjjlooLPTj3fu2Qu0GOmthmEj30AyJDy22Hacx7tEx0QmBPJGg1OUrfTGaWY2lr3hLLjcLDua1T8JdfdIzJaebV3aIN099nyGMCjCFABnObd852rRRClB2jSr7PYq41IllZOiyhxdmrHkDXC2GrZZr/I6IrCtug4enMzESyAPuKqZvmCzE4J8EoYWL0DZHFR4KL/7hVv+T1diNjRLUv17hhOliCF3tEsNimyPT668vac8gCN1ay7gBzV+K0GsrEVqnXJef0UsrBvGvCS6QshbssgkFtJYkd5LrKsrBkT2zNfY5KVLttF3olzE6mcEZTFDFah8g== 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=3D1oG+yPptKl57z/f0x2tXLbkk5JIG3X4LtAqQOKY+c=; b=MclhEG0G+oqkpvoO8wrNDNwle215daagHYRJRlMYYQ3YKbhkxAUiVujPrjJxXrp0jOb5jOhrQjw1BFY+5t4zxm3+JbVai0LOkEvIgxw1cpB1vcT9TuDt/eCIQSuFPyL2Jg/HY6dxTJ6BlsbvB/ym2DQss6XJDRdmQNN/AmCsbN2x/lKTtv50OcofLxM0YH5qZfINNLjIhDw8wOE5dAP1jtzFaU9Q7ZnMwDhqnxvt7tHcHGA93mc8faKjH7JEWn37zLQwPac0ack2MME5uaJU8xd/oulGoFjOdA76goJLv+aISC2ZSGaGAgjMkNevmRl8BCkksf1x4Uaog38YmyYr8Q== 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=3D1oG+yPptKl57z/f0x2tXLbkk5JIG3X4LtAqQOKY+c=; b=UO/AGBmn0+BIHd6JboRhHjugsI6khSU3c/ifSipuKUBm30d40icGguWBWfuo6MkLqe3p39jK6peuCazWOk8lePMD+OehS7PJJ4WtMDIaU6pqK9eqLLWUQcCl6kSwIgk7dmFbuQc/y8jUH/HF2uVscOXnUXCUYmuYLrCULUzQKsc= 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 PH0PR11MB5127.namprd11.prod.outlook.com (2603:10b6:510:3c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Fri, 8 Oct 2021 12:10:49 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%5]) with mapi id 15.20.4587.022; Fri, 8 Oct 2021 12:10:49 +0000 Message-ID: <403c4b21-3c12-4415-bf12-f336257a3cd3@intel.com> Date: Fri, 8 Oct 2021 13:10:43 +0100 Content-Language: en-US To: Jie Wang , CC: , , , References: <20210926092055.495322-1-jie1x.wang@intel.com> <20211008034111.14121-1-jie1x.wang@intel.com> <20211008034111.14121-2-jie1x.wang@intel.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20211008034111.14121-2-jie1x.wang@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB6PR0601CA0040.eurprd06.prod.outlook.com (2603:10a6:4:17::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 DB6PR0601CA0040.eurprd06.prod.outlook.com (2603:10a6:4:17::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15 via Frontend Transport; Fri, 8 Oct 2021 12:10:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1298e280-aaae-4fe6-58c8-08d98a54aa6d X-MS-TrafficTypeDiagnostic: PH0PR11MB5127: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QdacQqlkerR7LXqiz4yAlpmO2l6GzzRMpBWN8MtNw6mBwUr1RdrwMZyRHdBZwNKhjNIjBJ/vHO7dP4BXXfPytpdk9YVw69r3pBG05QokK4DSRv06J3uPWJHKrOn7uGXtR9ytqmqCfqOmOCcc0fsfJR++K16QIPw0P+FJfMWGUqRl30aLz5hGffJNfh9ds8xyVtJGiK8l/9rzMPyy5Xv0tgKglymaqpqskYoLDtcrwTUJxKNhue3XvlxVhllsY7cL6tRpjvaYRq7sLEiE9NrY/3DwXXWnGfCz2OIz8rmOveOphM4pZD7WBbgxlnxNs+QST/wGi0s+670E8KJx8gYvnbEAE8BvsbswZJiK3QSmUETXCKpPOmMYKufTcUfRsjAkpxqeXsacP9lotc8VTVqhw826ZjCXuSFpGQcRGRoWocjQXLKrZ0yX1BzTAhuxMIiE5k32i1P7wOHROVS4Q85e4Aivj3dripGqPb0FLH3LUo8jKJ4e2uTqwag4y3W3AW0JTpL/em6I2U4Qp+q/7KvoTHGtk+caUTD2oh+4kBeZUpApn/F1pNEq9GX97Mimai2p/Lef0bb7sW9J42rP+yRg/4EsoCfRlLry4KDYSNgL0FYV4wsCTwC+zaaOtc7EC9Xfs5nh14ecU9h74/Z6o/gn0b5W8lIdRD/IE2d+9btgpIEe3l/4w1Oy113t3k1PaG8PfCXUPJY5aJt1bNukB6FjJQ== 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)(8676002)(66946007)(8936002)(4326008)(66556008)(26005)(186003)(956004)(6486002)(6666004)(66476007)(2616005)(44832011)(316002)(5660300002)(2906002)(31686004)(36756003)(53546011)(107886003)(31696002)(86362001)(83380400001)(38100700002)(16576012)(508600001)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RnFCdVNaM2EvT0lqRnRMRnRRek5BbCtxZW9WS3ExQnJOcVh2QUxMZkx4dHBt?= =?utf-8?B?MGh1NjBiMXI4NlVLRENlb1hOa1RTbkFWd1MwN2cxMzBtNzN6TjB6cnJCUnhT?= =?utf-8?B?ZzhpYkJJaEtZKzRkU2hyT2lUOGZPRXZIMHZNUlp5V2NTVXJWR1ZIc0hxTVh6?= =?utf-8?B?ZE5rTzZyQjJ0QU1TYTV1cU8vdDRwaGlNL2EyTCtsbnR1bzJZWVAxL1lPeWtJ?= =?utf-8?B?aysySWRWSVMyQ2ZwTnhwQ0NRaGVaaEZZcUtDclVVVTV4RGovUEJsdGpxemxZ?= =?utf-8?B?c3cxWjVuQkVqTXU4N2htbWNZdFFWQkp5bGhiNlNmOWZjZi9ndlRSOXFBUlNW?= =?utf-8?B?d21YN2duOHFZTCtkb1I1U1pBQityTWpBaDl1eUdZbU5aZWlQTlpnQmVZa01x?= =?utf-8?B?OWF0NTM2SG9YTjVZWW94cmpLejluY1d4QXVaM1d5T2U4R05FNXN4K3B0NDJF?= =?utf-8?B?WDNwTzhLWit2Nk4vVDVJM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RFdiUXo1NjlKd3p4YmFKTGhINDlNQ28rbityY090aVUySmVaNTZ3bjVDQVpi?= =?utf-8?B?UlkvUE4rYXU0eC9YeDlwT0FWVGZzdGhNWWdJbEF3WWJyQWFXalRZbG9kODY4?= =?utf-8?B?MGVNaTB1SzJiMVIwM2ZwdXhvYTlleno3RDVhd2l5K1hnRXVXYVhYL2hKVVRI?= =?utf-8?B?eVdrRnJOVnhWUjY0cjFoajQwNkpIVjQ3WmQvVVV4S0tRSVNXNGVGL0xrQVJl?= =?utf-8?B?dTdXajZycDdiN2twYXdPclFPZU5LeXlRZ1ZraHlCKzlZVGJzNnpvWUlqcG1B?= =?utf-8?B?cWFPRGJocW5WelFYcWcvdG0wYk1McHc5d2NWcW1pbE9SNi9wenFwZzlOWisx?= =?utf-8?Q?gAFwiuyYyrbhyEswHiSdf8bUDvgx0Y7jDvXWDm4?= X-MS-Exchange-CrossTenant-Network-Message-Id: 1298e280-aaae-4fe6-58c8-08d98a54aa6d X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2021 12:10:49.5314 (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: lj5YH/WUdDLOonY6y1cFeQ5DyO6QIAiJaluDqEr1ImirADbmEcMJkGuVEyJnCKw0Jx15W6tfcUZYAH7iDZd02A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5127 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v10 1/2] 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 10/8/2021 4:41 AM, Jie Wang wrote: > The driver may change offloads info into dev->data->dev_conf > in dev_configure which may cause port->dev_conf and port->rx_conf > contain outdated values. > > This patch adds a new API "rte_eth_dev_conf_get()" to help users > get device configuration info. > Not sure about "configuration info", what about just 'configuration'? Is 'info' providing additional benefit? > Add information about the new API in release notes. > > Signed-off-by: Jie Wang > --- > doc/guides/rel_notes/release_21_11.rst | 5 +++++ > lib/ethdev/rte_ethdev.c | 23 +++++++++++++++++++++++ > lib/ethdev/rte_ethdev.h | 21 +++++++++++++++++++++ > lib/ethdev/version.map | 3 +++ > 4 files changed, 52 insertions(+) > > diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst > index f099b1cca2..c16cc83fd1 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -129,6 +129,11 @@ New Features > * Added tests to validate packets hard expiry. > * Added tests to verify tunnel header verification in IPsec inbound. > > +* **Added support for users get device configuration.** > + > + * Added an API which can help users get device configuration. > + The declarations for the API's can be found in ``rte_ethdev.h``. > + Can you please clarify that support is for ethdev? Also as location of the update in the file, can you please check the section comment, on where to place this update? > > Removed Items > ------------- > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index daf5ca9242..ddbe34e276 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -3457,6 +3457,29 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) > return 0; > } > > +int > +rte_eth_dev_conf_get(uint16_t port_id, > + struct rte_eth_conf *dev_conf_info) Lines can be merged into single line. And again what about 'dev_conf' as variable name, instead of 'dev_conf_info'? > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + dev = &rte_eth_devices[port_id]; > + > + if (dev_conf_info == NULL) { > + RTE_ETHDEV_LOG(ERR, > + "Cannot get ethdev port %u configuration info to NULL\n", again, can we drop 'info'? > + port_id); > + return -EINVAL; > + } > + > + /* copy dev->data->dev_conf to dev_conf_info */ This comment is not adding more info, almost same with line below. > + memcpy(dev_conf_info, &dev->data->dev_conf, > + sizeof(struct rte_eth_conf)); Can merge the lines? > + > + return 0; > +} > + > int > rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, > uint32_t *ptypes, int num) > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index afdc53b674..2934b904ea 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -3082,6 +3082,27 @@ int rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr); > */ > int rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info); > > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Retrieve the configuration of an Ethernet device. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param dev_conf_info what about dropping 'info' in the declaration too? > + * 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_get(uint16_t port_id, > + struct rte_eth_conf *dev_conf_info); > + Can merge the lines? > /** > * Retrieve the firmware version of a device. > * > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > index 904bce6ea1..06f1d8da48 100644 > --- a/lib/ethdev/version.map > +++ b/lib/ethdev/version.map > @@ -247,6 +247,9 @@ EXPERIMENTAL { > rte_mtr_meter_policy_delete; > rte_mtr_meter_policy_update; > rte_mtr_meter_policy_validate; > + > + # added in 21.11 > + rte_eth_dev_conf_get; > }; > > INTERNAL { >