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 3CE05A0C5C; Wed, 8 Sep 2021 18:46:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0399C40E25; Wed, 8 Sep 2021 18:46:11 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id E01A84003E for ; Wed, 8 Sep 2021 18:46:08 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10101"; a="200066510" X-IronPort-AV: E=Sophos;i="5.85,278,1624345200"; d="scan'208";a="200066510" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2021 09:46:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,278,1624345200"; d="scan'208";a="606314932" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga001.fm.intel.com with ESMTP; 08 Sep 2021 09:46:07 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 8 Sep 2021 09:46:07 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 8 Sep 2021 09:46:07 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) 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, 8 Sep 2021 09:46:07 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.102) 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; Wed, 8 Sep 2021 09:46:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PFNzlzCi6tM7YhmS9NtYeEPaa1qweNsz0GQCBaA9LvuxxSG6KXyNbFVw/tTreTwt16rqlw4nE7LVApODQ1kD5g3RzJ/NIBlChC3gZROqOTXA6Pfpzpop4k2KBVZe+clSrvuztSVicC3xGPGPFt+JUT1sufd0DKBbBAsIeT0KQdcj4+Yf1NJrg1UWYsS0dhJL9utaPy+tu8x/kIxOvo3sQRw7Tlbn6uLDNKHRn9VxMv0MAdbkysDbrQcOFaIF+zD/ng6HS9C5T9phYKosz5DeWq43ztpASZ3Wl+t1LI3XJ5koSFU4/lauKUoa+V2iMfBQiD/FZjrdn835w73j2aRyZg== 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=ty0d9A8SVYcoJBU+7u0TkUNXB+K1p0DZ/3XefCKwZaM=; b=einr5htEDSuWtNP1nNZKmBfvO8wNP2F3TuO1WsT+nqOuNNJgCerrioz7nJaSE+MDmEcpls47+3wdKKamCM4I2tkoc7PdJfUfrnY+RE7+OTXVFr9U7nnKb6/U3Zs1Vqfs5RoHrVGvxpctGp8bXQeEPwnL+d2QJjl4Iu+j9ZEmcKb4wQehNEf6FrGddn0M8saQvOPQ8E8Hw+TQIMc2B1N/6SpLLIjIvMSCjJ5kPTsJweZHMNxnFglX/6k5wnDqgK25wuFawVfhZ0SWYw/xDx2oh6zCW2nqTKubkYgZrKdleTRPZTeLXaIxo7OZbGcNKbKXTwIq0/w6x1pN4c77J0a7hQ== 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=ty0d9A8SVYcoJBU+7u0TkUNXB+K1p0DZ/3XefCKwZaM=; b=oeg6nTBjD3ty7fjRgp1kTFZhdUDjuNxUKGXO5HgxemFLduMg9utUKCJL6M5RAn9cYPCnIkqbsgwWNxaPREL2HMLjCH0F6iAr4RAqmQhTo1HkV/U+C15PJM+H+hchSplaLNJKzu1nvD+f3RjkD8gNYQdwnc8eDD8hK3gw1GUraaI= Authentication-Results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4869.namprd11.prod.outlook.com (2603:10b6:510:41::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19; Wed, 8 Sep 2021 16:46:06 +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.025; Wed, 8 Sep 2021 16:46:06 +0000 To: Jie Wang , CC: , , References: <20210826070924.308368-1-jie1x.wang@intel.com> <20210827081740.365037-1-jie1x.wang@intel.com> <20210827081740.365037-2-jie1x.wang@intel.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <19ad2d4c-1d66-5a65-ad3e-e366bb461a16@intel.com> Date: Wed, 8 Sep 2021 17:46:00 +0100 In-Reply-To: <20210827081740.365037-2-jie1x.wang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DB7PR05CA0050.eurprd05.prod.outlook.com (2603:10a6:10:2e::27) 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 DB7PR05CA0050.eurprd05.prod.outlook.com (2603:10a6:10:2e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 8 Sep 2021 16:46:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7b80828e-8060-4e88-a02d-08d972e826dc X-MS-TrafficTypeDiagnostic: PH0PR11MB4869: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Er8NU+ibq3WiNp3YRRMTiIFsC4gUTkUrqN4voa2j2KkxUihy2GD5d6shmPCMN+CXrZc8qp+DAlYe93HNB6ku4yoL3dfnamXPPFoIoLKV6oXUkbzty6KXsczbB/Y/2X1zhoj7wMUjgpKl8u+b4owf36oGubDCS5dELtJMRW+MJrhR1sSsnRS3wztqcLWxJVsn3vdttIwciPPk/CMn+dym9txiyMdutlsan89hNmjl+DB7+wOVGyeIGQZNCuPorInrkTGTgt6VwSYVWH1wI3epDnbxFr4Slp3VMGqTkQtwCRFcutN0vF2fMylWb4rw4v+75ry+qiMdxpBW37Qp6MvpPJ+XSFVL781btvABFkM5NpGlH3HS8iYvcCM3lcpAzmcqYrt3armPeEUsxg+eCHMdkxfmxJxON8OxvxU4dC6Mo4IkffxgSmj8xCj1XEsDEG2ciqESMiO9CbFfWcNbegckbe0/xJgcmZ5/kDp8A6xfDpRraAtNwEFbz1tP5JgewDeinVsb9VJsaMdcpbeVwQZIiBsDs5tiIx2QJ98OIIReOkrqIXkzqVnU4Jo2Uq+o+WKyhOuIBpD8lZjOcwO3KTbEbt8Jlp08wOMDi7hAEd7hnr506PUTi7ro56Hj8V6DWKGbx4juua2JQFo7DyLD0SEzpryk6r2+I87xFE07BK4PKjhY2Pd8P2UAd+X0ZXX9/V2EaH15IPRO+kre8AzSYlFMCA== 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)(136003)(39860400002)(366004)(376002)(346002)(396003)(44832011)(316002)(478600001)(2616005)(4326008)(31686004)(956004)(83380400001)(2906002)(26005)(36756003)(5660300002)(31696002)(8676002)(8936002)(6486002)(6666004)(66476007)(66556008)(86362001)(53546011)(38100700002)(66946007)(16576012)(186003)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SnF4RTVUdzhLcVZyY1BaZm5qK2QyM3JzT0V0YXE4MXg1aVo4d0pkelBZL1cy?= =?utf-8?B?L3lEWnJmd1FlNkZvL2FLTEZ3SzZacFJqNjJDc25helkrSHJ0OHNQZjJBN0JV?= =?utf-8?B?UWxZY2RDQTNMV0hwRXdCUDVzVkdydGxYQUhHSVNoUTB0S0RyUGF1TS9tWHl2?= =?utf-8?B?ZWJOQkR3QnQxamgwUnREOGJ0aU1paVFyTEJNeU5sbGx4cGpiN0ZMdEtoSW5O?= =?utf-8?B?TGREY24xUGR3MUVITThWODJTelRTaksvc29NdG9VdFBZamZCRU56c01kSUNE?= =?utf-8?B?aUp4Wm9EWUVOUXZiYWhNYnNaUlJGZXhqWDA4Wlg0WmhtSlZVVlI4NDBxMkFN?= =?utf-8?B?SkJ4K2VseGhjcDhtbCtMVms3VEZZVDdiMFdhVTFu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3dkcXl5UUhBY0l1Qmh5Q3ZkWUFoM3Jh?= =?utf-8?B?ekdBZm1VQThYQjJSQVhtdk9jU2VoVVpmL1NReW1pTUxlV09Mcldnd1RSTW00?= =?utf-8?B?Wk5nclVZakZHejF4RGJYbW1YbSsraEhlbm84ME8ycG9PZWJuR1BFS1UwSFRU?= =?utf-8?B?YjQrdmswMnYxd2svb1VLM2syb1BXV1NRM3NnQk0yWThSQ282S1BsVWM0U0ZD?= =?utf-8?B?enA5OXg3ZEU2cVE1bHVDa2FyQWY2NjZGd1hEVzBVMTBLK2hrckVkQlZPMnJD?= =?utf-8?B?WUZ5Sm5aS0JQMC9Jc1ppNlV1NmRhZHdtQlVlaWF2NytFSFhuTkhYOXpsQ3la?= =?utf-8?B?MWxjS05LcndGUUVIbWZXR3o4Ukl0NHFPWHVlRFl1dnBObUtHZzBhbVdsSERh?= =?utf-8?B?ckI5YVVuaThMdlRHTCtZaVFtWExWdWYxbW5YdElRZ1RvZW13WlRBamkvWWQx?= =?utf-8?Q?uoYVNXv7KZNMdwuceTju0YDSoaqUUKdjCi18AkR?= X-MS-Exchange-CrossTenant-Network-Message-Id: 7b80828e-8060-4e88-a02d-08d972e826dc X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2021 16:46:06.0852 (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: MacJbj0aHxxEG4wJ9WbtXUnV/zUk/lCON5Xf6iZ2pTaRmSWHyZo/+uFAjlICzcAh7DhL9MiVTkvTlglifNrSPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4869 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v8 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 8/27/2021 9:17 AM, Jie Wang wrote: > This patch adds a new API "rte_eth_dev_conf_info_get()" to help users get > device configuration info. > > Signed-off-by: Jie Wang > --- > lib/ethdev/rte_ethdev.c | 28 ++++++++++++++++++++++++++++ > lib/ethdev/rte_ethdev.h | 21 +++++++++++++++++++++ > lib/ethdev/version.map | 3 +++ > 3 files changed, 52 insertions(+) > Can you add a release notes update for this? > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 9d95cd11e1..bbe24af662 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -3458,6 +3458,34 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) > return 0; > } > > +int > +rte_eth_dev_conf_info_get(uint16_t port_id, > + struct rte_eth_conf *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", Can you break the line after 'ERR', to reduce the column length? > + port_id); > + return -EINVAL; > + } > + > + /* > + * Init dev_conf_info before port_id check since caller does not have > + * return status and does not know if get is successful or not. > + */ > + memset(dev_conf_info, 0, sizeof(struct rte_eth_conf)); > + I didn't get the reasoning for the memset, won't it be overwriten anyway by below 'memcpy'? > + /* copy dev->data->dev_conf to dev_conf_info */ > + memcpy(dev_conf_info, &dev->data->dev_conf, > + sizeof(struct rte_eth_conf)); > + > + 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 d2b27c351f..3c5b02a133 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -3058,6 +3058,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 contextual information of an Ethernet device. > + * 'rte_eth_dev_info_get()' is using "contextual information" but for this API can we say 'configuration'? > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param dev_conf_info > + * A pointer to a structure of type *rte_eth_dev* to be filled with > + * the contextual information of the Ethernet device. Just to make it more clear, what do you think to highlight that memory should be allocated by the caller? > + * @return > + * - (0) if successful. > + * - (-ENOTSUP) if support for dev_infos_get() does not exist for the device. I think '-ENOTSUP' is not returned by the API. > + * - (-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); > + > /** > * Retrieve the firmware version of a device. > * > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > index 44d30b05ae..40539f99f9 100644 > --- a/lib/ethdev/version.map > +++ b/lib/ethdev/version.map > @@ -249,6 +249,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_info_get; > }; > > INTERNAL { >