diff --git a/backport-ethdev-add-API-to-get-device-configuration.patch b/backport-ethdev-add-API-to-get-device-configuration.patch new file mode 100644 index 0000000000000000000000000000000000000000..db3ab63316231af85426787c1677a9216939986d --- /dev/null +++ b/backport-ethdev-add-API-to-get-device-configuration.patch @@ -0,0 +1,95 @@ +From 632be32735107a09672a897b6123b8dc4d15b6ae Mon Sep 17 00:00:00 2001 +From: Jie Wang +Date: Thu, 14 Oct 2021 18:31:23 +0800 +Subject: [PATCH] ethdev: add API to get device configuration + +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 +Reviewed-by: Ferruh Yigit +Conflict: mv ethdev dir to librte_ethdev; move version.map to rte_ethdev_version.map; remove the modify of release_21_11.rst +Reference: https://github.com/DPDK/dpdk/commit/632be32735107a09672a897b6123b8dc4d15b6ae + +--- + lib/librte_ethdev/rte_ethdev.c | 20 ++++++++++++++++++++ + lib/librte_ethdev/rte_ethdev.h | 18 ++++++++++++++++++ + lib/librte_ethdev/rte_ethdev_version.map | 1 + + 3 files changed, 39 insertions(+) + +diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c +index 6e9cb24..8d99d40 100644 +--- a/lib/librte_ethdev/rte_ethdev.c ++++ b/lib/librte_ethdev/rte_ethdev.c +@@ -3001,6 +3001,26 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) + return 0; + } + ++int ++rte_eth_dev_conf_get(uint16_t port_id, struct rte_eth_conf *dev_conf) ++{ ++ struct rte_eth_dev *dev; ++ ++ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); ++ dev = &rte_eth_devices[port_id]; ++ ++ if (dev_conf == NULL) { ++ RTE_ETHDEV_LOG(ERR, ++ "Cannot get ethdev port %u configuration to NULL\n", ++ port_id); ++ return -EINVAL; ++ } ++ ++ memcpy(dev_conf, &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/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h +index 18a9def..02ba09e 100644 +--- a/lib/librte_ethdev/rte_ethdev.h ++++ b/lib/librte_ethdev/rte_ethdev.h +@@ -2562,6 +2562,24 @@ 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 ++ * Location for Ethernet device configuration to be filled in. ++ * @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. + * +diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map +index a7dacf2..78cd812 100644 +--- a/lib/librte_ethdev/rte_ethdev_version.map ++++ b/lib/librte_ethdev/rte_ethdev_version.map +@@ -227,4 +227,5 @@ EXPERIMENTAL { + rte_flow_dynf_metadata_mask; + rte_flow_dynf_metadata_register; + rte_eth_dev_set_ptypes; ++ rte_eth_dev_conf_get; + }; +-- +2.30.0 + diff --git a/dpdk.spec b/dpdk.spec index 6c007b93ee90880a071f823e355a45f0fc71dd32..007d1984cc3624d60c905c560e5cad15c970b88c 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -1,6 +1,6 @@ Name: dpdk Version: 19.11 -Release: 32 +Release: 33 Packager: packaging@6wind.com URL: http://dpdk.org %global source_version 19.11 @@ -74,7 +74,7 @@ Patch6018: backport-change-state-machine-to-defaulted.patch Patch6019: backport-fix-dead-loop-on-RSS-RETA-update.patch Patch6020: backport-fix-LACP-system-address-check.patch Patch6021: backport-fix-promiscuous-and-allmulticast-state.patch - +Patch6022: backport-ethdev-add-API-to-get-device-configuration.patch Summary: Data Plane Development Kit core Group: System Environment/Libraries @@ -240,6 +240,9 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko /usr/sbin/depmod %changelog +* Sat Dec 9 2023 wuchangye - 19.11-33 +- backport ethdev add API to get device configuration + * Mon Sep 25 2023 zhujunhao - 19.11-32 - backport bond patch