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 088BDA0C41; Wed, 25 Aug 2021 22:08:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9B104013F; Wed, 25 Aug 2021 22:08:05 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 986054003D for ; Wed, 25 Aug 2021 22:08:03 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10087"; a="197842445" X-IronPort-AV: E=Sophos;i="5.84,351,1620716400"; d="scan'208";a="197842445" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2021 13:07:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,351,1620716400"; d="scan'208";a="686464171" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga005.fm.intel.com with ESMTP; 25 Aug 2021 13:07:52 -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.10; Wed, 25 Aug 2021 13:07:52 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.10 via Frontend Transport; Wed, 25 Aug 2021 13:07:52 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.173) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Wed, 25 Aug 2021 13:07:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mw06uTTAS2+jQtLBNT0n5e2s4LFtPYr2CkstIBi1wcsNTdHVJv6A7Qhv2xfQvU1pnlrIFjyeMdsqbkMsyuFV4maC1jhRnU1j+yrj8sKRitPwKDy/6Xt5vsgaMVdGkTuwXnKfjFbAl1aorITXLm/m0b+ARzDMP93O5IryxY/wyNKQ1UJgcf0H8dMkPn7BMXYJtWbIHLz/QYsmyWNlNYzBvvQPvSOwZCfT6Rjvxrvczf5CiP0w2qatWYtFJvShdyJHmrC9DKYDiYSz23HKArgQz6fKE/09wV/h6W2uxKosCD+Lg0mVN6wSw+QO2tKf5vi/PpWXgVzfrqqb89XMHtsLyw== 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=5vochkOlykaKR9ZXIynMjHmTbd5bJBetobQxNbzUBOc=; b=jXUzASRm1p2fjaatIQ4/KnJxoFk/SYMapILmWFMg81vWaskzo1vx+DRrU143m4W1DYSkI/fT2v2b5YWpHlSVaJDYZCdanucSjSPw1A6dMo5MpslQtxPXW16feZa3IynSZlxfAvxWfzoNmKYATzckFnFrHrS/kSpuZtIROpojskUZwclOlQaDHQQH5Df4dZElrRIgm7ILMdlNWYmM48VVFpTU03/SQEDvHLO5LyeLlMznKjqwCt/PuK0eb6Qe4b31Q+8k9oW+v/uX8H8jhpAHbgvHogWt8BVCU/zaE4QRm87UzIjQ2LhzJWnIGDDB/wILmy13WlBd3TzE6XlCkrDebQ== 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=5vochkOlykaKR9ZXIynMjHmTbd5bJBetobQxNbzUBOc=; b=VH3BFg97hfaG5qGpAE4a9YNzt4eUWGDDp7z16ntrMoOvEAZelUUq/DVeXvch7g3+3KHd5ciHN1MActsPrx+gtPef1ZSUeEpf1tykimqcFM/cT+I/cKbf0b7k4I3n6Zs8eA5AaX7aSQATbUudsRxUKjMCUYPMdoawt7nxk4IWte8= 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 PH0PR11MB5080.namprd11.prod.outlook.com (2603:10b6:510:3f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.22; Wed, 25 Aug 2021 20:07:50 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::2979:70ca:38a:dbaf]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::2979:70ca:38a:dbaf%6]) with mapi id 15.20.4436.027; Wed, 25 Aug 2021 20:07:50 +0000 To: Jie Wang , CC: , , References: <20210817173832.54228-1-jie1x.wang@intel.com> <20210824181929.142691-1-jie1x.wang@intel.com> <20210824181929.142691-2-jie1x.wang@intel.com> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Wed, 25 Aug 2021 21:07:44 +0100 In-Reply-To: <20210824181929.142691-2-jie1x.wang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DB7PR03CA0090.eurprd03.prod.outlook.com (2603:10a6:10:72::31) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.206] (37.228.236.146) by DB7PR03CA0090.eurprd03.prod.outlook.com (2603:10a6:10:72::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Wed, 25 Aug 2021 20:07:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea1959f4-9b6a-436a-819f-08d9680403fe X-MS-TrafficTypeDiagnostic: PH0PR11MB5080: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0Edka3sCBm87EDApUp7BLy7AMEAT7+J+Zjffhn95QqksECBVuPZd0pOHNX9qdr8Ies43LSsYB8/ukXa/4+7NHg1nygvDs3PNiHfOs//RQE5h6tXtjHK19s8LNipsu0yKWo1hJj4RnKXlNJoqBlvjueEtP1EZL2W/160S5sIzoqhSAbYxZmVXN6dsbCQV4WkETYJT/NNg/hItGXY9x3x8dZ6WW1Q1ocFkjl0x4cg+K0Mod9BVrl3HIVswImhv8bQc8Yw0rwIi8Hwxrl24q8YqAvIKWb45IaTVQYF/SBTcV4tBaZOpdXHrwCAdBL4tukcNq4FD5gwrjKLC9brjNR4s79mS5vlbIc2ZuLBZNldEaKnirG22HiyILEFoUdaA1wniG2mvexY50bfj8IAtjh058p4yOly4eEemrY0TzK8lFEkX0xt7zC8YJhpC0HnH0oTF72VyH7C6mmTmo8qr/mzaHPQ8bLdDaoGWMlAH5Le1Tpha0iSmUDsSQXZ3oYw71DYo4XRw4xbZEwS40vGQ5CDD0nGibNcqqLeprxCOM2AeGP/IyvrOnZ9xNDgjvHOQtj3xZRY010eCFhoy60WQHsbX4MErnXdpqU/5jFmeOaDYvOZPYTaBzFQw/9xoTWLjRRRVHUgQ/YqlxaihRkeFYFxCpjouj1TbZpKcEyomXtiZmOgUw/ZzIJvP16ptt5iCgWywD2Z14ptWiDOV78coiAggQQ== 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)(346002)(366004)(376002)(136003)(39860400002)(396003)(6486002)(86362001)(66946007)(53546011)(8676002)(26005)(66556008)(66476007)(316002)(5660300002)(31686004)(478600001)(8936002)(44832011)(36756003)(4326008)(83380400001)(2906002)(16576012)(31696002)(2616005)(956004)(38100700002)(6666004)(186003)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?U2IvaWl0L3F0OHVidDJEUTJMOXRjZXFzTVFjbVRpUU5pOHdLTTFSekk2bkJp?= =?utf-8?B?Q1BRaVZMdFlJM0tONm53SFRVdjVHUjZvT1JwS05ycmg4bXBMbkNVOStIekRT?= =?utf-8?B?MVc4d013d0ZSVnFRRjBmV0luSldQR3AxSGQvd24xUTdsc3l3c3N3d3VtQ3FY?= =?utf-8?B?THV5dkozdnFHWVVSczNFYW1yd2ZUMDkrVHZoaTlVTFhJbi8yQWRYUzRkV1Bz?= =?utf-8?B?V3AvcmEyTUM0UlA3Ti9IblpYUm1OdWtCclJudDFTS2FPZFJxVXg0a2JHUzZh?= =?utf-8?B?MVJCS0dYK2hJLzZqQXp6V0NhQkh2M3hKTVMzMFRZNzFmd2FZL3JTYlVZYzRy?= =?utf-8?B?d2oweHhFeU9NNkNpeVFtTlhlcUdkRzYrRzUrZkhCd2xZQkViT2ZleE11RFpC?= =?utf-8?B?dHNyY1lZQWdLcjc4UEZBdURLRmo2MkFlNHIyQ1VQd1kyalRObHc4MDA4R0J6?= =?utf-8?B?VzBhL2Rtb1NtTDhXY3FPOTVGaEdRd0RWMzlDVHpza05yaER6MHJIVjVEMFND?= =?utf-8?B?T21GVW1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3Unhz?= =?utf-8?B?cXBrQk5MMHltNHJoaHUxRXV4SWlMZTRLeGt4N2M3RUI2aUF3ZHhxaHROZ3Vi?= =?utf-8?B?WmpMVjR3WEN0SjJodFp6ZkR1SSsrYWU0WHAyaFh4MEFjcHdHNGVzeHZyTTh4?= =?utf-8?B?V205MzZSMXVZT2ZIZGs1WjN1UEpyV3ptb2Zva0dzU0VGYkNyRGxYNkdIRDhI?= =?utf-8?B?V0o2SnU1VzBlV3Z4eDNtaUdJY3V0MDNObWNIVWRjUFlKNnQ5VTdHMkRaWmoz?= =?utf-8?B?MzgvUWFzbDZzT3VRWU1IallCZHdxOXVmdnhRYTVmZVE1eHFZbk4xUVhvSjNE?= =?utf-8?Q?BI5yKM7ry/GZ8GaFTov55ROLS4zhVwQjscCeQjF?= X-MS-Exchange-CrossTenant-Network-Message-Id: ea1959f4-9b6a-436a-819f-08d9680403fe X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 20:07:50.7148 (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: qnwx7PAgToWijj3QxrKdjzJNMPrO7ifG/3vsxqFmyYJlmL1EdlZy0vGmC+gWgoPS4aeZqYlwl4aqqhqvD5MKIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5080 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v6 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/24/2021 7:19 PM, Jie Wang wrote: > This patch adds a new API "rte_eth_dev_conf_info_get()" to help testpmd get > device configuration info. > > Signed-off-by: Jie Wang > --- > lib/ethdev/rte_ethdev.c | 27 +++++++++++++++++++++++++++ > lib/ethdev/rte_ethdev.h | 26 ++++++++++++++++++++++++++ > lib/ethdev/version.map | 3 +++ > 3 files changed, 56 insertions(+) > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 9d95cd11e1..74184099a1 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -3458,6 +3458,33 @@ 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_dev_conf_info *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 config info to NULL\n", > + 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_dev_conf_info)); > + > + dev_conf_info->rx_offloads = dev->data->dev_conf.rxmode.offloads; > + dev_conf_info->tx_offloads = dev->data->dev_conf.txmode.offloads; > + > + 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..70a2db550f 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -1587,6 +1587,15 @@ struct rte_eth_dev_info { > void *reserved_ptrs[2]; /**< Reserved for future fields */ > }; > > +/** > + * Ethernet device configuration information structure. > + * Used to retrieve information about configured device. > + */ > +struct rte_eth_dev_conf_info { > + uint64_t rx_offloads; /**rxmode offloads */ > + uint64_t tx_offloads; /**txmode offloads */ > +}; My concern is if we need to extend this struct later, when application wants to get more current config from the dpdk layer, it will cause ABI break and will need to wait next LTS. And as this struct grow, it will be kind of duplication of the 'struct rte_eth_conf'. What do you think to reuse 'struct rte_eth_conf' in this API, to cover future needs? > + > /** > * RX/TX queue states > */ > @@ -3058,6 +3067,23 @@ 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); > > +/** > + * Retrieve the contextual information 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_dev_conf_info* to be filled with > + * the contextual information of the Ethernet device. > + * @return > + * - (0) if successful. > + * - (-ENOTSUP) if support for dev_infos_get() does not exist for the device. > + * - (-ENODEV) if *port_id* invalid. > + * - (-EINVAL) if bad parameter. > + */ > +int rte_eth_dev_conf_info_get(uint16_t port_id, > + struct rte_eth_dev_conf_info *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 { >