summaryrefslogtreecommitdiff
path: root/lib/ethdev
diff options
context:
space:
mode:
authorBruce Richardson <[email protected]>2024-10-07 12:49:07 +0100
committerFerruh Yigit <[email protected]>2024-10-08 01:04:32 +0200
commit3953323852dfe399c0e6bdf2d35f88005b8a2135 (patch)
tree7dbe06fe56d139ba4e4a60402367d690227b3cb5 /lib/ethdev
parent5d96356688da2f79a62a48025a017c77e90d6232 (diff)
ethdev: make TM shaper parameters constant
The function to add a new shaper 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 d221b1e553..3eb98e618a 100644
--- a/lib/ethdev/rte_tm.c
+++ b/lib/ethdev/rte_tm.c
@@ -218,7 +218,7 @@ int rte_tm_shared_wred_context_delete(uint16_t port_id,
/* Add shaper profile */
int rte_tm_shaper_profile_add(uint16_t port_id,
uint32_t shaper_profile_id,
- struct rte_tm_shaper_params *profile,
+ const struct rte_tm_shaper_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 f6f3f6a8d4..e5da9b8323 100644
--- a/lib/ethdev/rte_tm.h
+++ b/lib/ethdev/rte_tm.h
@@ -1449,7 +1449,7 @@ rte_tm_shared_wred_context_delete(uint16_t port_id,
int
rte_tm_shaper_profile_add(uint16_t port_id,
uint32_t shaper_profile_id,
- struct rte_tm_shaper_params *profile,
+ const struct rte_tm_shaper_params *profile,
struct rte_tm_error *error);
/**
diff --git a/lib/ethdev/rte_tm_driver.h b/lib/ethdev/rte_tm_driver.h
index b6ecf1bd4d..6c2618c0d8 100644
--- a/lib/ethdev/rte_tm_driver.h
+++ b/lib/ethdev/rte_tm_driver.h
@@ -75,7 +75,7 @@ typedef int (*rte_tm_shared_wred_context_delete_t)(
/** @internal Traffic manager shaper profile add */
typedef int (*rte_tm_shaper_profile_add_t)(struct rte_eth_dev *dev,
uint32_t shaper_profile_id,
- struct rte_tm_shaper_params *profile,
+ const struct rte_tm_shaper_params *profile,
struct rte_tm_error *error);
/** @internal Traffic manager shaper profile delete */