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 CBC4945757; Wed, 7 Aug 2024 09:27:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B76C440B9C; Wed, 7 Aug 2024 09:27:50 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by mails.dpdk.org (Postfix) with ESMTP id 15F7D40B97 for ; Wed, 7 Aug 2024 09:27:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723015669; x=1754551669; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=xPvfB9D7ygpJcBLsJFrG6JNQ7dgymGG70ER9Y86l4nM=; b=gq6SrHVBG+Gng1YusXxIc+L3J5SkHt8FqYYU/XxdE7ntTrHgXFOjfX/6 HVbwDDe2fRfNOyZUi/g9jv3ULrtp0a2pujDEtHOfmE/fOlLqX3eoefCR4 2sAzpnSRtz2Tv6Pu4F76UxxL0V3RRRFyB2o29Y42eLXfHHk4weeQQWTRI NqmtVmeUiJ4VBLX28l1WK0xpmMrVKGg0aHUbUS4ldz3JAKh74udQ1DKtQ SafOLQZjvlsuavM4hJJwo7YvLE8nbNvrQgwtBOMX4CzBc+KM9EPzu6Tdp rxXi2ORxQWDcVPE63ES+4VwNxtBICwrA1h4Q5ODlVGuWJU7hqg+uspQcb w==; X-CSE-ConnectionGUID: HQglh2LwTVq1ObFoUh/uUg== X-CSE-MsgGUID: FCcy61SDQ86avtavqh/+bA== X-IronPort-AV: E=McAfee;i="6700,10204,11156"; a="21243757" X-IronPort-AV: E=Sophos;i="6.09,269,1716274800"; d="scan'208";a="21243757" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2024 00:27:47 -0700 X-CSE-ConnectionGUID: ms1IXngLSPejNXTnYQHJ8g== X-CSE-MsgGUID: zvAJcs0YQ8qTwUXqL+O39g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,269,1716274800"; d="scan'208";a="56711592" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa008.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 07 Aug 2024 00:27:47 -0700 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.39; Wed, 7 Aug 2024 00:27:46 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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.39 via Frontend Transport; Wed, 7 Aug 2024 00:27:46 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 7 Aug 2024 00:27:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iM6k6d4uZnEcqRbH2lBNpi46wFWYniLGecU/FvpabctHU5Rmx77WfyA3n261x+S64+R0pYKSW5+Hq06zoYSteZZy1wW61tZ+gYc1XHWQlsUJTHGT1ZXT8rRNs6GBZqDM1vl1Sl88gC5HI+or8p/2E3fJvyzUMypTcS4G7eiie0+Qh1TZCGslsn2mznIZNWadfUqnXEZS7m8zcohIktiQDm0N2O00dxlIkmXS8ejJclXiisJaKm6kD1yGjTuobzOHMPpFQ9fuo4kr+oYaWvHlmGCCaQMABTok/iQWIWQkyR/2u8ASeRWD5TUKcCVYCi/xh2UMkg8EprezgMCr6vw3ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=U9YPvkiWP2qVkcd4CHjV51mr485QR1kaXdnSqKXMh1Y=; b=lx4uH2Vld57AjWHL1KzYNLT7a+UoikXG4XPt0gVkrL5lQUFWi3XCzdSrfw5BEKT+WeKg/b95onAADGPB6uZ/Nkr/IQK7lMVBvgr/p+7xP62kGIrev1mYCm6TRDe4a7DoIGqqlcC0CkT5wQ0RnZFmofZnRYXwHYueatumMZIt4HMGz4+oC959o3CemEup2DoTPosfb8f3pfJ7QI0SVH8KZdQjqgldipjZvUXM4/yM3wTROWbUMl12lqmV7IC7SJh0Jl4sUeNyTwv0c93g4rcgio2Z6shKwiOwplJCaUY0WS9bn+pgUBMuAz5HFiL72YoJ3ueTNPELlkHsA3WZo/9tXw== 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 DM4PR11MB7757.namprd11.prod.outlook.com (2603:10b6:8:103::22) by SJ0PR11MB4816.namprd11.prod.outlook.com (2603:10b6:a03:2ad::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Wed, 7 Aug 2024 07:27:44 +0000 Received: from DM4PR11MB7757.namprd11.prod.outlook.com ([fe80::60c9:10e5:60f0:13a1]) by DM4PR11MB7757.namprd11.prod.outlook.com ([fe80::60c9:10e5:60f0:13a1%5]) with mapi id 15.20.7828.023; Wed, 7 Aug 2024 07:27:44 +0000 From: "Xu, Rosen" To: "Richardson, Bruce" , "dev@dpdk.org" CC: "Dumitrescu, Cristian" , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Subject: RE: [PATCH 2/4] ethdev: make parameters to TM profile add fn constant Thread-Topic: [PATCH 2/4] ethdev: make parameters to TM profile add fn constant Thread-Index: AQHa6BTQMEROQ/D/ZkmwP7pCxa1LPbIbZl/g Date: Wed, 7 Aug 2024 07:27:44 +0000 Message-ID: References: <20240806152417.3649745-1-bruce.richardson@intel.com> <20240806152417.3649745-3-bruce.richardson@intel.com> In-Reply-To: <20240806152417.3649745-3-bruce.richardson@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: DM4PR11MB7757:EE_|SJ0PR11MB4816:EE_ x-ms-office365-filtering-correlation-id: 00f3b6de-f71f-4660-be0b-08dcb6b26db7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?+icfCitOd6bDHLiN5mSitiPfF2F5A/B97KJhyF2gLEWNBESRwzU612zZsRyp?= =?us-ascii?Q?V95VcfslHDicHjHzVimfJiRCq0JbHbH6p2/d6quzD0iXiAZMmiSfBM6Ra9Gj?= =?us-ascii?Q?nHvdELmcYWl/KYXTTZ2eACIw5aj3ccH01uan8GoLMYqOsOxrglBQbFHLe1AZ?= =?us-ascii?Q?OM6Bf30njCW7FrPE5w6GE9XVePYEC3ITRoRNNqGa2lOb9lT9AmXjVylWSB9i?= =?us-ascii?Q?DpFWQFVIeJ6zYGQmndMayPaYaG8E5GqkpKPHOWT7bY4EAp+gqI9LTjYb1lvy?= =?us-ascii?Q?9AKxKso6NykM6eZg3s4aMzIQVzNg6JFV6OjCKAavvrO4RYd9SSjhge34kq93?= =?us-ascii?Q?qP18mumgyR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wLsCmdv/cR?= =?us-ascii?Q?fQ1ZRJasRtzlJbvrFfDjjYIt1LX8cknwmMvFWisBTbVq4yvLMKfHKYgv6PZW?= =?us-ascii?Q?Qy+4WrY5LoBZhyA7IrHtumsQFtxJuo82pPdEyy8mUCADomVR0gAquWwrQSSg?= =?us-ascii?Q?p3lZgvA3GHjvoaQbtdgjj9Fxo25nhBqZLIulVYvsV4hCQL2EUA=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB7757.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DKQjJYJ8nrYNoKqKjo2tAuJoZHXSIV854g71bvSrRTrlmjmPK67sET111YCn?= =?us-ascii?Q?iwB3kc9Eqcm2e90iFSeTEoLOooKdxHkh12iT+Xdx2UIZtBJGOYD50kDyMvPr?= =?us-ascii?Q?ByoZ1u3VVIhUq6QF2/xe/NPHoGkzroA/evojC7+XCA1AsJmRxs8IXS9mPz5Z?= =?us-ascii?Q?Zf7DH7rGwoP3A5+EGzM/G+KALiKCt5QWy6Yu/RJ4wHK77iwG3xFlHRZwA7uy?= =?us-ascii?Q?Y5nyhreZn5lDiqp1yWsXZP5fSGCwho0d8FkFqul3Hcijl/5uHDYUDr0n1Qhi?= =?us-ascii?Q?RdHjZy2G3P7RNwWaaZ/cdKfzyv8U5Um7hDjTRoSrg5xZU+kJd8/iASrI1yWM?= =?us-ascii?Q?y7mw6GJo8TtQc9gtQvcfEcmIp4afLxS9sw1pQe4DZbhQq7K+IC9j6+GnJ8xh?= =?us-ascii?Q?I6wek3U1+fIcVjhZ+APf2wWEHWhS6N0b34CHIF8S//jJZUbzkdW1WT+wI+5D?= =?us-ascii?Q?i6R40AJiHDQSh1aFFU6vXgCVmL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PP/OObHqoe9Pu2dtWECRAGPtdpFMfQwcQ0sHYG67zow1RoZV1e9q?= =?us-ascii?Q?A2unk0lOOHdSfcYSEBtAqJyotnNRbFXO+Q+3aWwUwYef6WZCzzhf9eRNfXic?= =?us-ascii?Q?fQI3MQZLRHA6SBpbVosHW8MoRsJt8RgKBim7hi6RtcThVvDsgEb4QU71oSzE?= =?us-ascii?Q?xJzLHNlv/S69sMH/k0JJ7igVoCsYDyqjycygEAAD?= 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: DM4PR11MB7757.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00f3b6de-f71f-4660-be0b-08dcb6b26db7 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Aug 2024 07:27:44.0370 (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: 2jwkttS6OjGNxK2GVZAuSWqQ4DTE90cxlGRJ42xUQyvOHj+vcMOtyc8H6GCv/PQF0jfo/OolkgOiuA5GB6nX3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4816 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 Hi, > -----Original Message----- > From: Richardson, Bruce > Sent: Tuesday, August 6, 2024 11:24 PM > To: dev@dpdk.org > Cc: Richardson, Bruce ; Xu, Rosen > ; Dumitrescu, Cristian > ; Thomas Monjalon > ; Ferruh Yigit ; Andrew > Rybchenko > Subject: [PATCH 2/4] ethdev: make parameters to TM profile add fn constan= t >=20 > The function to add a new profile in rte_tm should not (and does not) mod= ify > the profile parameters passed in via struct pointer. We should guarantee = this > by marking the parameter pointer as const. This allows SW to create mult= iple > profiles using the same parameter struct without having to reset it each = time. >=20 > Signed-off-by: Bruce Richardson > --- > drivers/net/ipn3ke/ipn3ke_tm.c | 4 ++-- > lib/ethdev/rte_tm.c | 2 +- > lib/ethdev/rte_tm.h | 2 +- > lib/ethdev/rte_tm_driver.h | 2 +- > 4 files changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c > b/drivers/net/ipn3ke/ipn3ke_tm.c index cffe1fdaa4..20a0ed0467 100644 > --- a/drivers/net/ipn3ke/ipn3ke_tm.c > +++ b/drivers/net/ipn3ke/ipn3ke_tm.c > @@ -848,7 +848,7 @@ ipn3ke_tm_shaper_profile_delete(struct > rte_eth_dev *dev, >=20 > static int > ipn3ke_tm_tdrop_profile_check(__rte_unused struct rte_eth_dev *dev, > - uint32_t tdrop_profile_id, struct rte_tm_wred_params *profile, > + uint32_t tdrop_profile_id, const struct rte_tm_wred_params > *profile, > struct rte_tm_error *error) > { > enum rte_color color; > @@ -931,7 +931,7 @@ ipn3ke_hw_tm_tdrop_wr(struct ipn3ke_hw *hw, > /* Traffic manager TDROP profile add */ static int > ipn3ke_tm_tdrop_profile_add(struct rte_eth_dev *dev, > - uint32_t tdrop_profile_id, struct rte_tm_wred_params *profile, > + uint32_t tdrop_profile_id, const struct rte_tm_wred_params > *profile, > struct rte_tm_error *error) > { > struct ipn3ke_hw *hw =3D IPN3KE_DEV_PRIVATE_TO_HW(dev); diff -- > git a/lib/ethdev/rte_tm.c b/lib/ethdev/rte_tm.c index > 74e6f4d610..d221b1e553 100644 > --- a/lib/ethdev/rte_tm.c > +++ b/lib/ethdev/rte_tm.c > @@ -153,7 +153,7 @@ int rte_tm_node_capabilities_get(uint16_t port_id, > /* Add WRED profile */ > int rte_tm_wred_profile_add(uint16_t port_id, > uint32_t wred_profile_id, > - struct rte_tm_wred_params *profile, > + const struct rte_tm_wred_params *profile, > struct rte_tm_error *error) > { > struct rte_eth_dev *dev =3D &rte_eth_devices[port_id]; diff --git > a/lib/ethdev/rte_tm.h b/lib/ethdev/rte_tm.h index c52acd1b4f..f6f3f6a8d4 > 100644 > --- a/lib/ethdev/rte_tm.h > +++ b/lib/ethdev/rte_tm.h > @@ -1347,7 +1347,7 @@ rte_tm_node_capabilities_get(uint16_t port_id, > int rte_tm_wred_profile_add(uint16_t port_id, > uint32_t wred_profile_id, > - struct rte_tm_wred_params *profile, > + const struct rte_tm_wred_params *profile, > struct rte_tm_error *error); >=20 > /** > diff --git a/lib/ethdev/rte_tm_driver.h b/lib/ethdev/rte_tm_driver.h inde= x > 25d688516b..b6ecf1bd4d 100644 > --- a/lib/ethdev/rte_tm_driver.h > +++ b/lib/ethdev/rte_tm_driver.h > @@ -51,7 +51,7 @@ typedef int (*rte_tm_node_capabilities_get_t)(struct > rte_eth_dev *dev, > /** @internal Traffic manager WRED profile add */ typedef int > (*rte_tm_wred_profile_add_t)(struct rte_eth_dev *dev, > uint32_t wred_profile_id, > - struct rte_tm_wred_params *profile, > + const struct rte_tm_wred_params *profile, > struct rte_tm_error *error); >=20 > /** @internal Traffic manager WRED profile delete */ > -- > 2.43.0 Reviewed-by: Rosen Xu