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 53237A0C47; Tue, 12 Oct 2021 07:50:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D6C454067C; Tue, 12 Oct 2021 07:50:57 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 608234003C for ; Tue, 12 Oct 2021 07:50:56 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id DD2827F530; Tue, 12 Oct 2021 08:50:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru DD2827F530 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1634017855; bh=rTdkYL1kwJVgrpMr1WMXR1xtWhLZiBKWRCvSEkhYh3A=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=da9vd80xqaO4QcgZDPNShtoHeSlV9YqnWPhclaBQ7HPZlXfQsYn7SlqmM0ge7Dm6L rQ3fqxsqytLwc9h0LBOgCr5YkwJibSyq1a5GOVgVp6A1nInY6Xjc/ohFh8KR7wwpA3 yPOL/ejcwdVedrnaIXeZjpS4j3SgR6UZUInLnbVU= To: Jie Wang , dev@dpdk.org Cc: ferruh.yigit@intel.com, thomas@monjalon.net, xiaoyun.li@intel.com, stevex.yang@intel.com References: <20211011180111.99281-1-jie1x.wang@intel.com> <20211012025417.134866-1-jie1x.wang@intel.com> <20211012025417.134866-2-jie1x.wang@intel.com> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <882628fb-645d-5210-6da0-9c070accff25@oktetlabs.ru> Date: Tue, 12 Oct 2021 08:50:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211012025417.134866-2-jie1x.wang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v12 1/2] ethdev: add an API to get device configuration 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/12/21 5:54 AM, Jie Wang wrote: > The driver may change offloads info into dev->data->dev_conf > in dev_configure which may cause apps use outdated values. > > Add a new API to get actual device configuration. > > Signed-off-by: Jie Wang Acked-by: Andrew Rybchenko [snip] > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index 6d80514ba7..7b5d5fb379 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -3052,6 +3052,26 @@ 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 > + * A pointer to a structure to be filled with the configuration of > + * the Ethernet device. > + * Location for Ethernet device configuration to be filled in. IMHO just the second sentence is sufficient. > + * @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); > + > /** > * Retrieve the firmware version of a device. > * [snip]