[PATCH 1/4] ethdev: make parameters to TM node add fn constant
Xu, Rosen
rosen.xu at intel.com
Wed Aug 7 09:27:14 CEST 2024
Hi,
> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson at intel.com>
> Sent: Tuesday, August 6, 2024 11:24 PM
> To: dev at dpdk.org
> Cc: Richardson, Bruce <bruce.richardson at intel.com>; Nithin Dabilpuram
> <ndabilpuram at marvell.com>; Kiran Kumar K <kirankumark at marvell.com>;
> Sunil Kumar Kori <skori at marvell.com>; Satha Rao
> <skoteshwar at marvell.com>; Harman Kalra <hkalra at marvell.com>; Hemant
> Agrawal <hemant.agrawal at nxp.com>; Sachin Saxena
> <sachin.saxena at nxp.com>; Jie Hai <haijie1 at huawei.com>; Yisen Zhuang
> <yisen.zhuang at huawei.com>; Wu, Jingjing <jingjing.wu at intel.com>; Xu,
> Rosen <rosen.xu at intel.com>; Jiawen Wu <jiawenwu at trustnetic.com>; Jian
> Wang <jianwang at trustnetic.com>; Dumitrescu, Cristian
> <cristian.dumitrescu at intel.com>; Thomas Monjalon
> <thomas at monjalon.net>; Ferruh Yigit <ferruh.yigit at amd.com>; Andrew
> Rybchenko <andrew.rybchenko at oktetlabs.ru>
> Subject: [PATCH 1/4] ethdev: make parameters to TM node add fn 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 <bruce.richardson at intel.com>
> ---
> drivers/net/ipn3ke/ipn3ke_tm.c | 4 ++--
> diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c
> b/drivers/net/ipn3ke/ipn3ke_tm.c index 0260227900..cffe1fdaa4 100644
> --- a/drivers/net/ipn3ke/ipn3ke_tm.c
> +++ b/drivers/net/ipn3ke/ipn3ke_tm.c
> @@ -1010,7 +1010,7 @@ ipn3ke_tm_tdrop_profile_delete(struct
> rte_eth_dev *dev, static int
> ipn3ke_tm_node_add_check_parameter(uint32_t tm_id,
> uint32_t node_id, uint32_t parent_node_id, uint32_t priority,
> - uint32_t weight, uint32_t level_id, struct rte_tm_node_params
> *params,
> + uint32_t weight, uint32_t level_id, const struct rte_tm_node_params
> +*params,
> struct rte_tm_error *error)
> {
> uint32_t level_of_node_id;
> @@ -1168,7 +1168,7 @@ ipn3ke_tm_node_add_check_mount(uint32_t
> tm_id, static int ipn3ke_tm_node_add(struct rte_eth_dev *dev,
> uint32_t node_id, uint32_t parent_node_id, uint32_t priority,
> - uint32_t weight, uint32_t level_id, struct rte_tm_node_params
> *params,
> + uint32_t weight, uint32_t level_id, const struct rte_tm_node_params
> +*params,
> struct rte_tm_error *error)
> {
> struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(dev); diff --
> /** @internal Traffic manager node delete */
> --
> 2.43.0
Reviewed-by: Rosen Xu <rosen.xu at intel.com>
More information about the dev
mailing list