From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Yang, Qiming" <qiming.yang@intel.com>,
"Wu, Wenjun1" <wenjun1.wu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH v2 2/3] net/ice: refactor tm config data structure
Date: Fri, 5 Jan 2024 08:37:37 +0000 [thread overview]
Message-ID: <DM4PR11MB5994034C9F29732FC7546A62D7662@DM4PR11MB5994.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20240105141120.384681-3-qi.z.zhang@intel.com>
> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Friday, January 5, 2024 10:11 PM
> To: Yang, Qiming <qiming.yang@intel.com>; Wu, Wenjun1
> <wenjun1.wu@intel.com>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: [PATCH v2 2/3] net/ice: refactor tm config data structure
>
> Simplified struct ice_tm_conf by removing per level node list.
>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
> drivers/net/ice/ice_ethdev.h | 5 +-
> drivers/net/ice/ice_tm.c | 210 +++++++++++++++--------------------
> 2 files changed, 88 insertions(+), 127 deletions(-)
>
> diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index
> ae22c29ffc..008a7a23b9 100644
> --- a/drivers/net/ice/ice_ethdev.h
> +++ b/drivers/net/ice/ice_ethdev.h
> @@ -472,6 +472,7 @@ struct ice_tm_node {
> uint32_t id;
> uint32_t priority;
> uint32_t weight;
> + uint32_t level;
> uint32_t reference_count;
> struct ice_tm_node *parent;
> struct ice_tm_node **children;
> @@ -492,10 +493,6 @@ enum ice_tm_node_type { struct ice_tm_conf {
> struct ice_shaper_profile_list shaper_profile_list;
> struct ice_tm_node *root; /* root node - port */
> - struct ice_tm_node_list qgroup_list; /* node list for all the queue
> groups */
> - struct ice_tm_node_list queue_list; /* node list for all the queues */
> - uint32_t nb_qgroup_node;
> - uint32_t nb_queue_node;
> bool committed;
> bool clear_on_fail;
> };
> diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c index
> 7ae68c683b..7c662f8a85 100644
> --- a/drivers/net/ice/ice_tm.c
> +++ b/drivers/net/ice/ice_tm.c
> @@ -43,66 +43,30 @@ ice_tm_conf_init(struct rte_eth_dev *dev)
> /* initialize node configuration */
> TAILQ_INIT(&pf->tm_conf.shaper_profile_list);
> pf->tm_conf.root = NULL;
> - TAILQ_INIT(&pf->tm_conf.qgroup_list);
> - TAILQ_INIT(&pf->tm_conf.queue_list);
> - pf->tm_conf.nb_qgroup_node = 0;
> - pf->tm_conf.nb_queue_node = 0;
> pf->tm_conf.committed = false;
> pf->tm_conf.clear_on_fail = false;
> }
>
> -void
> -ice_tm_conf_uninit(struct rte_eth_dev *dev)
> +static void free_node(struct ice_tm_node *root)
> {
> - struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data-
> >dev_private);
> - struct ice_tm_node *tm_node;
> + uint32_t i;
>
> - /* clear node configuration */
> - while ((tm_node = TAILQ_FIRST(&pf->tm_conf.queue_list))) {
> - TAILQ_REMOVE(&pf->tm_conf.queue_list, tm_node, node);
> - rte_free(tm_node);
> - }
> - pf->tm_conf.nb_queue_node = 0;
> - while ((tm_node = TAILQ_FIRST(&pf->tm_conf.qgroup_list))) {
> - TAILQ_REMOVE(&pf->tm_conf.qgroup_list, tm_node, node);
> - rte_free(tm_node);
> - }
> - pf->tm_conf.nb_qgroup_node = 0;
> - if (pf->tm_conf.root) {
> - rte_free(pf->tm_conf.root);
> - pf->tm_conf.root = NULL;
> - }
> + if (root == NULL)
> + return;
> +
> + for (i = 0; i < root->reference_count; i++)
> + free_node(root->children[i]);
> +
> + rte_free(root);
The memory of point array for children should also be freed.
rte_free(root->children)
As the patch has been acked, I will squash the fix when merging the patch.
next prev parent reply other threads:[~2024-01-05 8:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-05 13:59 [PATCH 0/3] net/ice: simplified to 3 layer Tx scheduler Qi Zhang
2024-01-05 13:59 ` [PATCH 1/3] net/ice: hide port and TC layer in Tx sched tree Qi Zhang
2024-01-05 13:59 ` [PATCH 2/3] net/ice: refactor tm config data struture Qi Zhang
2024-01-05 13:59 ` [PATCH 3/3] doc: update ice document for qos Qi Zhang
2024-01-05 14:11 ` [PATCH v2 0/3] net/ice: simplified to 3 layer Tx scheduler Qi Zhang
2024-01-05 8:10 ` Wu, Wenjun1
2024-01-05 14:11 ` [PATCH v2 1/3] net/ice: hide port and TC layer in Tx sched tree Qi Zhang
2024-01-05 14:11 ` [PATCH v2 2/3] net/ice: refactor tm config data structure Qi Zhang
2024-01-05 8:37 ` Zhang, Qi Z [this message]
2024-01-09 2:50 ` Wu, Wenjun1
2024-01-05 14:11 ` [PATCH v2 3/3] doc: update ice document for qos Qi Zhang
2024-01-05 21:12 ` [PATCH v3 0/3] net/ice: simplified to 3 layer Tx scheduler Qi Zhang
2024-01-05 21:12 ` [PATCH v3 1/3] net/ice: hide port and TC layer in Tx sched tree Qi Zhang
2024-01-05 21:12 ` [PATCH v3 2/3] net/ice: refactor tm config data structure Qi Zhang
2024-01-05 21:12 ` [PATCH v3 3/3] doc: update ice document for qos Qi Zhang
2024-01-08 20:21 ` [PATCH v4 0/3] simplified to 3 layer Tx scheduler Qi Zhang
2024-01-08 20:21 ` [PATCH v4 1/3] net/ice: hide port and TC layer in Tx sched tree Qi Zhang
2024-01-08 20:21 ` [PATCH v4 2/3] net/ice: refactor tm config data structure Qi Zhang
2024-01-09 4:51 ` Wu, Wenjun1
2024-01-08 20:21 ` [PATCH v4 3/3] doc: update ice document for qos Qi Zhang
2024-01-09 5:30 ` [PATCH v4 0/3] simplified to 3 layer Tx scheduler Zhang, Qi Z
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=DM4PR11MB5994034C9F29732FC7546A62D7662@DM4PR11MB5994.namprd11.prod.outlook.com \
--to=qi.z.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=qiming.yang@intel.com \
--cc=wenjun1.wu@intel.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).