From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 12AFC43839; Fri, 5 Jan 2024 09:37:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 86035402C7; Fri, 5 Jan 2024 09:37:49 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 038B9402AC for ; Fri, 5 Jan 2024 09:37:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704443868; x=1735979868; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=522ly8YFc9otA7Z9wiOLN4aAFyqK8TuWU0v6XaWyluY=; b=d4MI9lM6Ylp+4tZgLnZXH+9lcsiso1IowFBw1oAZv4r/HMmoab4Nric7 ndtNr6GvkNzUXKOoNgD6oemPQ4vm88AgGiPedyhajVXHKL6nV5bi4lB9p 4XMNcJaqEDA1O7OaCzr4CynFdr64PuVOxH3rpS6PmxY7tjAuH94yiYRgD t9lBPipzOn9mNcZPX12KaAjYRV24JAhNsx7OqNtTazxTf5zOwUnK6mq1c IqKu+r6xoawzZeiz8hf4foGv/lAf8dx5QdaAKiVgZUOm+AM/NJryLsQ6S JuD1DTPlG8V55b4PR5lIeisVQyWNz7U5DTzQIsRBRhkE/1iM/5E8fsA5Z Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="376951126" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="376951126" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 00:37:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10943"; a="784148255" X-IronPort-AV: E=Sophos;i="6.04,333,1695711600"; d="scan'208";a="784148255" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Jan 2024 00:37:45 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 00:37:45 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 00:37:44 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 5 Jan 2024 00:37:44 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 5 Jan 2024 00:37:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RK/q50akEQGJHOuozErXFYw2q41Y9hY/JQM856Eo96W/2nLmi1wiLedsNxmdwQ35fNzFkMfsf94Y8R3y3/aWQoj5dvbHoEJAPEl0bRBCGUly9K+Ju82gcVrp/pc+UtI64RIaFKsyrfNbguOWaMmcBfZ45L3lmSynVA349xkmZPuc9Mp1q3aGOPBdGHHCo3GQDItl8aYIauA53jnLJaZ7cZS5+tp/5QFADNQtSgBhU31hEzkV964TKDldy79VFmejIK++0ZY3v2Or0KAuCeKVZs5vbKlgCdNK7pezwvDF3NLEzp+YX6YUjQluiq96vIRqFeMA6C2ktXs/LvzRPYxC1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u0yGPo2hNawDNcerx/XOm2E4V011vTnJky0dqZozKNI=; b=ea6VaL2uK7+B8va9qC9npb6i5C4zLCOsowpcVqLXSduErA2QKM9/0bETwg/7e4q6g1c5/bRwt4S9o43naGgYGqYgJBD7MZ3PKru4eBP382FcZfgE2pSX/bPmbtdB6jYq18gkqDg9rLAD/RU9qvmSgerMNPzUH2938gKYlUzRGEGd5rzLZnrd5UrLvdwE28L80OFb/waQMycasnWMNi2wqNiG7OyxnHVJxhZHwpO2hzy+5BpCcgtygUop5nD3S083DpZfwI7D5jR6PK0kyu6vumUvM+aFCj6J+Nru+jyx9Z1C4z937uwuCowP59g2lKzLny+VwYkh3k7O2Fm4IvZqtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM4PR11MB5994.namprd11.prod.outlook.com (2603:10b6:8:5d::20) by BL1PR11MB5541.namprd11.prod.outlook.com (2603:10b6:208:31f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.17; Fri, 5 Jan 2024 08:37:38 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::fc91:526:bead:4f73]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::fc91:526:bead:4f73%4]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 08:37:37 +0000 From: "Zhang, Qi Z" To: "Yang, Qiming" , "Wu, Wenjun1" CC: "dev@dpdk.org" Subject: RE: [PATCH v2 2/3] net/ice: refactor tm config data structure Thread-Topic: [PATCH v2 2/3] net/ice: refactor tm config data structure Thread-Index: AQHaP5osY7dXN/dJ5UmRsoWjrG0fabDK5P4w Date: Fri, 5 Jan 2024 08:37:37 +0000 Message-ID: References: <20240105135906.383394-1-qi.z.zhang@intel.com> <20240105141120.384681-1-qi.z.zhang@intel.com> <20240105141120.384681-3-qi.z.zhang@intel.com> In-Reply-To: <20240105141120.384681-3-qi.z.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB5994:EE_|BL1PR11MB5541:EE_ x-ms-office365-filtering-correlation-id: 11720127-3ea2-4a7e-fbeb-08dc0dc9929f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zjSk6jf0tRJpVN1ZxKVK9QFfFNqEI4QNkUEy8jMq4AkoMwn/ooLnEt9HcexDaOlMXjt/+tdt2i++3ZQ/Gc6E+LgdK2hRfIdS78xDhK9DCIMgPb1oyM4DMR00UBbQC/mQPiwvAfJTWL8ERFjPmLs6IZgrI/Utci9eax0bxAnQZF0HatK04FYVV6ubkQ+XZhfO3iw72TTI6UMNUP+O07WngGRPInLmdrHiBK2vNLODvjELgP2FJdQtKL3JKOqrVvDy59xJ0oaccmJ3yQAFTQDt5FR24njcykLNn9XxeHcuMyNqqitpltek4toL9QkWI2xrLIPyoWgadOdzOsfT61mwYmWn6BN7pW4OYFiuLlLYXizoiNdLE+FheCHIqcDKxbAZcL3QrLotR0KQuy8K98/rUC5rcMmm2lDa5eerQWYiq+RQv+C0Bxq/5zovxmlk2rG0C2HG8SXMnDss9XTyNl2Cy+zQZLTJalKkfQbYVZWpa1Wy2fEPsV4risbpEnvuA01qTdcOc0UsHK6D38A6E4O3poJHgPzFXndrVv+sMLmuRg6n6WeojQbiPq1taepzsfK11L6qECrBpZKk/YS1+Zy+jTkouRlhPD7aHYX0YyqciKyUxHl1ED3jKsMq88WCZ+VZ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5994.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(136003)(39860400002)(346002)(366004)(396003)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(55016003)(7696005)(26005)(53546011)(6506007)(9686003)(71200400001)(83380400001)(4326008)(52536014)(8936002)(316002)(8676002)(110136005)(2906002)(5660300002)(33656002)(478600001)(66946007)(76116006)(66556008)(66476007)(6636002)(64756008)(66446008)(38100700002)(122000001)(82960400001)(86362001)(41300700001)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1l4WaSZW15M5/PEFjQxEdEjm+s7QiDD82xFqR/fghthPJikbEz3E+cO1eW9n?= =?us-ascii?Q?AXFKxuQzTjCXX/93v/VRPot1A6dFlBctLmJgniGNp1M38yGuedszyg9lRkKy?= =?us-ascii?Q?o+qpV2uUwB226Te6HJXdLKOLZYcV+MdC/W7Bt2rb/8Sz2eGh7l9oFlEPJIag?= =?us-ascii?Q?sK9TgvnhaSHiBYz6Acb16jhVcmYSIriWe1LAtfdLaTJggrrQ5K35d8g7eC1X?= =?us-ascii?Q?88PRV4GKuYWagxdZO92nn+dyZKtPw6P5nQ1b0xW+GxEMfYI3+Y2JXqYO13aJ?= =?us-ascii?Q?z5dv8jG2ThZqpJd96Q/O+/0IZlHWctgD3KLy+QO9R6p/6icc8m5l/Jm3nAb6?= =?us-ascii?Q?4uZD461565emK5qtJOmq85glc+0Dv5CtBMjHhE5I35HFFRmLTBihpjgoC/Iq?= =?us-ascii?Q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0oY4wxFZT2KI2Dq5XHcCut/?= =?us-ascii?Q?wK5hV5BLwJBEv/fa2uSMi87cUqkwD7I0Zq0d3rDYShMV/T2arH+eMyVTRZM3?= =?us-ascii?Q?9KcvW0Esw62NT+IRrKOAKehndm0r+g53nHFpvTURreVvZqfu6nKdLvsFtV7C?= =?us-ascii?Q?HqfXI5moIAb2t1OLDwxcdqL1bX1wrtANqjI8z08QGOu3qKuln2AluVJ+HlDY?= =?us-ascii?Q?FYEppArQh07JpIgSc9w0NT3yLDQ160yBkz7GviwqQp/6VB5WlzqrjTOr+KBR?= =?us-ascii?Q?Fe9JC7fUXLAKOeMdDaFlRueVM3QKws8QffHAD06T?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5994.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11720127-3ea2-4a7e-fbeb-08dc0dc9929f X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2024 08:37:37.8837 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bZ+24qTdCEWl07rQxqf83W1cVp4X623GoCqDDZhFGLMmxhMdGUuRnjF5zHVbQngbJhBwmNal/Zo1GU64pxxILw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5541 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Zhang, Qi Z > Sent: Friday, January 5, 2024 10:11 PM > To: Yang, Qiming ; Wu, Wenjun1 > > Cc: dev@dpdk.org; Zhang, Qi Z > Subject: [PATCH v2 2/3] net/ice: refactor tm config data structure >=20 > Simplified struct ice_tm_conf by removing per level node list. >=20 > Signed-off-by: Qi Zhang > --- > drivers/net/ice/ice_ethdev.h | 5 +- > drivers/net/ice/ice_tm.c | 210 +++++++++++++++-------------------- > 2 files changed, 88 insertions(+), 127 deletions(-) >=20 > 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 =3D NULL; > - TAILQ_INIT(&pf->tm_conf.qgroup_list); > - TAILQ_INIT(&pf->tm_conf.queue_list); > - pf->tm_conf.nb_qgroup_node =3D 0; > - pf->tm_conf.nb_queue_node =3D 0; > pf->tm_conf.committed =3D false; > pf->tm_conf.clear_on_fail =3D false; > } >=20 > -void > -ice_tm_conf_uninit(struct rte_eth_dev *dev) > +static void free_node(struct ice_tm_node *root) > { > - struct ice_pf *pf =3D ICE_DEV_PRIVATE_TO_PF(dev->data- > >dev_private); > - struct ice_tm_node *tm_node; > + uint32_t i; >=20 > - /* clear node configuration */ > - while ((tm_node =3D 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 =3D 0; > - while ((tm_node =3D 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 =3D 0; > - if (pf->tm_conf.root) { > - rte_free(pf->tm_conf.root); > - pf->tm_conf.root =3D NULL; > - } > + if (root =3D=3D NULL) > + return; > + > + for (i =3D 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.