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 701C5A0C4D; Mon, 4 Oct 2021 13:25:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 182C841333; Mon, 4 Oct 2021 13:25:48 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id CA1D341325 for ; Mon, 4 Oct 2021 13:25:46 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D89B25C0154; Mon, 4 Oct 2021 07:25:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 04 Oct 2021 07:25:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= jjwgwJHoZrUJxHNCNbzv8PJYA0UPTqWtriTe+5ACThA=; b=Pp6faz06A3xeRsbs 2xDx9cMqgh35K88E3WuKNVHHcNKpT6UEPxkzLRVrDNK9v3MLe8igMlAcb4d2tUJ8 54jrsfEYAR5qpgItyvAb8EL4iVazM8Z12VanDloWm/Bq3OXvEYfNv55NKTi37gNG Zy+YmNxQIV1uzGW0kPMvUQuOmbfcIHBVzOn3AOe03k/AOtJ1EF+GwSus5HG4Gpg4 4Nt0awU/dfxENXomJGI5nPGXxd7M67fA9/EE+2xqnvvejrgjLfkZ57UtuASRLS5a Fd1LmswCoPGDdBp5M/6tN2cMvAP80VbN7jQS+RXRCOiukf4rRRVhqgpMJuhLDF7F TU3l1g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=jjwgwJHoZrUJxHNCNbzv8PJYA0UPTqWtriTe+5ACT hA=; b=fFGkfeJJkxlemCYXfvp+7069TpGAziPBI77kLr9Y3+zZrv7+lS8qEcyjw yOYcfCypSj7VX18iCP/b+9ars75pDVUfjHNBqg+GXjUJ2RmNoJXYelHXzT66nNmY xC13xc3fZ/hgYmH306q482Lp/YdHL19qIL1dG0z763HAZADmI1A/9lTuFJWCfWQ6 LcmuE5lI/DolLgDHdqQZlArWdS1uP9QaD5Vha34dSxOiHFvtjYHIO3CJ9sYzhmfp BXHjp9Q7Odnfn9rsv6+EmCZLhE3m/d6SdaZUNGOR9NQLwlQ+sRvoaffQ+abX6JKB srrYLLrHB5Qdw9U3RT0wJXu1BQrBw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelvddgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 4 Oct 2021 07:25:42 -0400 (EDT) From: Thomas Monjalon To: "Wang, Jie1X" , Ferruh Yigit Cc: "dev@dpdk.org" , "andrew.rybchenko@oktetlabs.ru" , "Li, Xiaoyun" , "Yang, SteveX" Date: Mon, 04 Oct 2021 13:25:40 +0200 Message-ID: <3275471.FUpW0u0lPQ@thomas> In-Reply-To: <2fb0b525-8bff-5ae6-52b5-34fee03d6e87@intel.com> References: <20210827081740.365037-1-jie1x.wang@intel.com> <1981336.HCRrZqnFLi@thomas> <2fb0b525-8bff-5ae6-52b5-34fee03d6e87@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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" 04/10/2021 13:20, Ferruh Yigit: > 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. Makes sense, thanks.