Re: [dpdk-dev] [PATCH v9 1/3] ethdev: add an API to get device configuration info
From: Wang, Jie1X <hidden>
Date: 2021-09-27 07:21:46
-----Original Message----- From: Thomas Monjalon <redacted> Sent: Monday, September 27, 2021 2:19 PM To: Wang, Jie1X <redacted> Cc: dev@dpdk.org; Yigit, Ferruh <redacted>; andrew.rybchenko@oktetlabs.ru; Li, Xiaoyun [off-list ref]; Yang, SteveX [off-list ref] Subject: Re: [PATCH v9 1/3] ethdev: add an API to get device configuration info 26/09/2021 11:20, Jie Wang:quoted
This patch adds a new API "rte_eth_dev_conf_info_get()" to help users get device configuration info. Cc: stable@dpdk.orgNo we don't backport new features.
Ok, I'll remove 'Cc: stable@dpdk.org'.
quoted
Signed-off-by: Jie Wang <redacted>[...]quoted
+ * 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.