Hi,

> -----Original Message-----
> From: Richardson, Bruce <bruce.richard...@intel.com>
> Sent: Tuesday, August 6, 2024 11:24 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richard...@intel.com>; Nithin Dabilpuram
> <ndabilpu...@marvell.com>; Kiran Kumar K <kirankum...@marvell.com>;
> Sunil Kumar Kori <sk...@marvell.com>; Satha Rao
> <skotesh...@marvell.com>; Harman Kalra <hka...@marvell.com>; Hemant
> Agrawal <hemant.agra...@nxp.com>; Sachin Saxena
> <sachin.sax...@nxp.com>; Jie Hai <haij...@huawei.com>; Yisen Zhuang
> <yisen.zhu...@huawei.com>; Wu, Jingjing <jingjing...@intel.com>; Xu,
> Rosen <rosen...@intel.com>; Liron Himi <lir...@marvell.com>; Jiawen Wu
> <jiawe...@trustnetic.com>; Jian Wang <jianw...@trustnetic.com>;
> Dumitrescu, Cristian <cristian.dumitre...@intel.com>; Thomas Monjalon
> <tho...@monjalon.net>; Ferruh Yigit <ferruh.yi...@amd.com>; Andrew
> Rybchenko <andrew.rybche...@oktetlabs.ru>
> Subject: [PATCH 3/4] 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 <bruce.richard...@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 20a0ed0467..eec01bb037 100644
> --- a/drivers/net/ipn3ke/ipn3ke_tm.c
> +++ b/drivers/net/ipn3ke/ipn3ke_tm.c
> @@ -722,7 +722,7 @@ ipn3ke_tm_node_capabilities_get(struct
> rte_eth_dev *dev,  }
> 
>  static int
> -ipn3ke_tm_shaper_parame_trans(struct rte_tm_shaper_params *profile,
> +ipn3ke_tm_shaper_parame_trans(const struct rte_tm_shaper_params
> +*profile,
>       struct ipn3ke_tm_shaper_profile *local_profile,
>       const struct ipn3ke_tm_shaper_params_range_type *ref_data)
> { @@ -747,7 +747,7 @@ ipn3ke_tm_shaper_parame_trans(struct
> rte_tm_shaper_params *profile,
> 
>  static int
>  ipn3ke_tm_shaper_profile_add(struct rte_eth_dev *dev,
> -     uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile,
> +     uint32_t shaper_profile_id, const struct rte_tm_shaper_params
> +*profile,
>       struct rte_tm_error *error)
>  {
>       struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(dev); diff --
>  /** @internal Traffic manager shaper profile delete */
> --
> 2.43.0

Reviewed-by: Rosen Xu <rosen...@intel.com>

Reply via email to