summaryrefslogtreecommitdiff
path: root/lib/ethdev
diff options
context:
space:
mode:
authorBruce Richardson <[email protected]>2024-10-07 12:49:06 +0100
committerFerruh Yigit <[email protected]>2024-10-08 01:04:26 +0200
commit5d96356688da2f79a62a48025a017c77e90d6232 (patch)
treeeab0b4042b96714d1902b1c272dc31043f40718d /lib/ethdev
parent5d49af626c829c465d36dd482ae17abc347f1929 (diff)
ethdev: make TM profile add parameters constant
The function to add a new profile in rte_tm should not (and does not) modify the profile parameters passed in via struct pointer. We should guarantee this by marking the parameter pointer as const. This allows SW to create multiple profiles using the same parameter struct without having to reset it each time. Signed-off-by: Bruce Richardson <[email protected]> Reviewed-by: Rosen Xu <[email protected]> Acked-by: Ferruh Yigit <[email protected]> Acked-by: Stephen Hemminger <[email protected]>
Diffstat (limited to 'lib/ethdev')
-rw-r--r--lib/ethdev/rte_tm.c2
-rw-r--r--lib/ethdev/rte_tm.h2
-rw-r--r--lib/ethdev/rte_tm_driver.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c
index 74e6f4d610..d221b1e553 100644
--- a/lib/ethdev/rte_tm.c
+++ b/lib/ethdev/rte_tm.c
@@ -153,7 +153,7 @@ int rte_tm_node_capabilities_get(uint16_t port_id,
/* Add WRED profile */
int rte_tm_wred_profile_add(uint16_t port_id,
uint32_t wred_profile_id,
- struct rte_tm_wred_params *profile,
+ const struct rte_tm_wred_params *profile,
struct rte_tm_error *error)
{
struct rte_eth_dev *dev = &rte_eth_devices[port_id];
diff --git a/lib/ethdev/rte_tm.h b/lib/ethdev/rte_tm.h
index c52acd1b4f..f6f3f6a8d4 100644
--- a/lib/ethdev/rte_tm.h
+++ b/lib/ethdev/rte_tm.h
@@ -1347,7 +1347,7 @@ rte_tm_node_capabilities_get(uint16_t port_id,
int
rte_tm_wred_profile_add(uint16_t port_id,
uint32_t wred_profile_id,
- struct rte_tm_wred_params *profile,
+ const struct rte_tm_wred_params *profile,
struct rte_tm_error *error);
/**
diff --git a/lib/ethdev/rte_tm_driver.h b/lib/ethdev/rte_tm_driver.h
index 25d688516b..b6ecf1bd4d 100644
--- a/lib/ethdev/rte_tm_driver.h
+++ b/lib/ethdev/rte_tm_driver.h
@@ -51,7 +51,7 @@ typedef int (*rte_tm_node_capabilities_get_t)(struct rte_eth_dev *dev,
/** @internal Traffic manager WRED profile add */
typedef int (*rte_tm_wred_profile_add_t)(struct rte_eth_dev *dev,
uint32_t wred_profile_id,
- struct rte_tm_wred_params *profile,
+ const struct rte_tm_wred_params *profile,
struct rte_tm_error *error);
/** @internal Traffic manager WRED profile delete */