diff options
| author | Bruce Richardson <[email protected]> | 2024-10-07 12:49:05 +0100 |
|---|---|---|
| committer | Ferruh Yigit <[email protected]> | 2024-10-08 01:04:06 +0200 |
| commit | 5d49af626c829c465d36dd482ae17abc347f1929 (patch) | |
| tree | a2bca68553673dbd80afa75d6a7f4091cf0af41b /lib/ethdev | |
| parent | d7918d19d25ecfbac7326a28e8ff30c60662e4d7 (diff) | |
ethdev: make TM node add parameters constant
The function to add a new scheduling node in rte_tm should not (and
does not) modify the actual node parameters passed in via struct
pointer. We should guarantee this by marking the parameter pointer as
const. This allows SW to create multiple scheduling nodes 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.c | 2 | ||||
| -rw-r--r-- | lib/ethdev/rte_tm.h | 2 | ||||
| -rw-r--r-- | lib/ethdev/rte_tm_driver.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index d594fe0049..74e6f4d610 100644 --- a/lib/ethdev/rte_tm.c +++ b/lib/ethdev/rte_tm.c @@ -286,7 +286,7 @@ int rte_tm_node_add(uint16_t port_id, uint32_t priority, uint32_t weight, uint32_t level_id, - struct rte_tm_node_params *params, + const struct rte_tm_node_params *params, 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 07028c9b36..c52acd1b4f 100644 --- a/lib/ethdev/rte_tm.h +++ b/lib/ethdev/rte_tm.h @@ -1596,7 +1596,7 @@ rte_tm_node_add(uint16_t port_id, uint32_t priority, uint32_t weight, uint32_t level_id, - struct rte_tm_node_params *params, + const struct rte_tm_node_params *params, struct rte_tm_error *error); /** diff --git a/lib/ethdev/rte_tm_driver.h b/lib/ethdev/rte_tm_driver.h index 45290fb3fd..25d688516b 100644 --- a/lib/ethdev/rte_tm_driver.h +++ b/lib/ethdev/rte_tm_driver.h @@ -101,7 +101,7 @@ typedef int (*rte_tm_node_add_t)(struct rte_eth_dev *dev, uint32_t priority, uint32_t weight, uint32_t level_id, - struct rte_tm_node_params *params, + const struct rte_tm_node_params *params, struct rte_tm_error *error); /** @internal Traffic manager node delete */ |
