From: "Xu, Rosen" <rosen.xu@intel.com>
To: "Richardson, Bruce" <bruce.richardson@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Rao <skoteshwar@marvell.com>,
Harman Kalra <hkalra@marvell.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>,
Sachin Saxena <sachin.saxena@nxp.com>,
Jie Hai <haijie1@huawei.com>,
Yisen Zhuang <yisen.zhuang@huawei.com>,
"Wu, Jingjing" <jingjing.wu@intel.com>,
Liron Himi <lironh@marvell.com>,
Jiawen Wu <jiawenwu@trustnetic.com>,
Jian Wang <jianwang@trustnetic.com>,
"Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>,
Thomas Monjalon <thomas@monjalon.net>,
Ferruh Yigit <ferruh.yigit@amd.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: RE: [PATCH 3/4] ethdev: make TM shaper parameters constant
Date: Wed, 7 Aug 2024 07:29:10 +0000 [thread overview]
Message-ID: <DM4PR11MB7757FDC339D9B823B9E1003689B82@DM4PR11MB7757.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20240806152417.3649745-4-bruce.richardson@intel.com>
Hi,
> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson@intel.com>
> Sent: Tuesday, August 6, 2024 11:24 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Nithin Dabilpuram
> <ndabilpuram@marvell.com>; Kiran Kumar K <kirankumark@marvell.com>;
> Sunil Kumar Kori <skori@marvell.com>; Satha Rao
> <skoteshwar@marvell.com>; Harman Kalra <hkalra@marvell.com>; Hemant
> Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> <sachin.saxena@nxp.com>; Jie Hai <haijie1@huawei.com>; Yisen Zhuang
> <yisen.zhuang@huawei.com>; Wu, Jingjing <jingjing.wu@intel.com>; Xu,
> Rosen <rosen.xu@intel.com>; Liron Himi <lironh@marvell.com>; Jiawen Wu
> <jiawenwu@trustnetic.com>; Jian Wang <jianwang@trustnetic.com>;
> Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Thomas Monjalon
> <thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@amd.com>; Andrew
> Rybchenko <andrew.rybchenko@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.richardson@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.xu@intel.com>
next prev parent reply other threads:[~2024-08-07 7:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 15:24 [PATCH 0/4] improve rte_tm APIs Bruce Richardson
2024-08-06 15:24 ` [PATCH 1/4] ethdev: make parameters to TM node add fn constant Bruce Richardson
2024-08-07 7:27 ` Xu, Rosen
2024-09-22 16:10 ` Ferruh Yigit
2024-08-06 15:24 ` [PATCH 2/4] ethdev: make parameters to TM profile " Bruce Richardson
2024-08-07 7:27 ` Xu, Rosen
2024-09-22 16:11 ` Ferruh Yigit
2024-08-06 15:24 ` [PATCH 3/4] ethdev: make TM shaper parameters constant Bruce Richardson
2024-08-07 7:29 ` Xu, Rosen [this message]
2024-09-22 16:11 ` Ferruh Yigit
2024-08-06 15:24 ` [PATCH 4/4] ethdev: add traffic manager query function Bruce Richardson
2024-09-22 16:26 ` Ferruh Yigit
2024-10-07 11:04 ` Bruce Richardson
2024-10-08 10:56 ` Bruce Richardson
2024-10-07 11:49 ` [PATCH v2 0/3] make struct parameters constant in rte_tm APIs Bruce Richardson
2024-10-07 11:49 ` [PATCH v2 1/3] ethdev: make parameters to TM node add fn constant Bruce Richardson
2024-10-07 11:49 ` [PATCH v2 2/3] ethdev: make parameters to TM profile " Bruce Richardson
2024-10-07 11:49 ` [PATCH v2 3/3] ethdev: make TM shaper parameters constant Bruce Richardson
2024-10-07 15:22 ` [PATCH v2 0/3] make struct parameters constant in rte_tm APIs Stephen Hemminger
2024-10-08 0:38 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM4PR11MB7757FDC339D9B823B9E1003689B82@DM4PR11MB7757.namprd11.prod.outlook.com \
--to=rosen.xu@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=bruce.richardson@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=haijie1@huawei.com \
--cc=hemant.agrawal@nxp.com \
--cc=hkalra@marvell.com \
--cc=jianwang@trustnetic.com \
--cc=jiawenwu@trustnetic.com \
--cc=jingjing.wu@intel.com \
--cc=kirankumark@marvell.com \
--cc=lironh@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=sachin.saxena@nxp.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.com \
--cc=thomas@monjalon.net \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).