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 B38FC460FF; Thu, 23 Jan 2025 17:31:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AE37B40B9F; Thu, 23 Jan 2025 17:30:41 +0100 (CET) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id B80DC40E09 for ; Thu, 23 Jan 2025 17:30:31 +0100 (CET) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-21675fd60feso25203535ad.2 for ; Thu, 23 Jan 2025 08:30:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737649830; x=1738254630; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cVz7fv3oNzmZPVy7o5StuGHJ1iJvgRwNcuan4/jHY1M=; b=RP0QM+tpxD6Zsg9Swgxb3FNgCFmpun/vWTgqeA0QVv3V0zl/EFHhH4ZML/EXmNX2kM Lrsm8kHRq7GM87Z+cNHFmcwgLStbhtR0yQ0S8YM9npRU9ekVRbI081anHvSPEXZG49Qi cG+/FBoEPgU0eZbuVZrYu1tBeU97QKkf/PUE13q8y/LkE/MDNi1M4mU2auAIhofSLhI/ SMfuKsi+YOqM4lOLUdm58FrRFi7A0NhJd+ZeF8eJ9p+lYY+55sK4mB8LJrdJ7LHLd6zU 4yx8tqzBm3QCiDu11NengnM1vtjlUsDEp3PEh1c6Jp4Mqxg0fFe+W/p1z2nEZi3U4+IW 3bYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737649830; x=1738254630; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cVz7fv3oNzmZPVy7o5StuGHJ1iJvgRwNcuan4/jHY1M=; b=eYi9tE5wjMeNWKVwcDKGvFX225yCJyiTHG25tld1PG9wopSuwVKLfjCNgQIFqy8yXz /cHEfmjjPigidQgDMbpHjEvGRfbiIo6Wd36qqqritVvgwFFw7r6lJfPmQM9itOnnKyz4 CNku5T6a4BFenMHm758gTUbD6Dmph+erxQVeBIl0XeegsqDmlIUbbSp1PoIb3Pf6XlxJ jvDjMrJ+8vM04p6z8EBTm/DpSKQyg29+xHFoTcAQW4R58iHKivYUCUj4dZ6xeQp/1yyh eJ5zjXE3RenZAAELpMsMDVQV11qxZhRoxmAShJn5Na51i83l4tN1Dv2fULc/FXO2W0T7 TGyA== X-Gm-Message-State: AOJu0YwQHY1EazRFcRc9VbrePcIoUx6cYKJC5yid/EXr/HKQOU2Uzznq v0ohpu9dr/4q9a5zzhcSx0r/sAWxl3rWPnDLva1JGgNbOph7fTijOOTpRXZrMe8+B122xvrMlJk S X-Gm-Gg: ASbGncuHk6RjvkmATFZGjxbTpDbs7o7wQPSGUEtab2ojV4FURKDgQakqeetNa90+N3w o+V9NzKaisSegnDTJhpBOd1IKtt+16uBSBdrE8t6WoGXSdZ1kfvTtrx/pJwqnMfPq5CAsKaY+ez RUZtQCrbhlyBIGKzJlKeTwyvkfgijjQevyUympPwAMqdCmCtFno3NU9D+3V+j3aYBN2h6bgnaHj Bm8Z2lIRn6KmWzs6TPdzp3aVBFJlG33V9ZSoQD5cX3DM9LXlKqYE5mbonVJA7TaFIaZeQYhnMSY Ffjfsu657r400MAwhHUCsia0QDCQWuRYsd5VzM44CplBI5n5yKm7Z9CDDg== X-Google-Smtp-Source: AGHT+IH7axvV8AJuEo8Jr4o+hwgL6GhOOHnvkRU5sb6IMoikwdBTjJe4WmCbhp9H6nTWjEbmd1iO6Q== X-Received: by 2002:a05:6a20:8429:b0:1e1:e2d9:7f0a with SMTP id adf61e73a8af0-1eb2156f917mr49518981637.34.1737649830600; Thu, 23 Jan 2025 08:30:30 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-ac4907f076dsm64601a12.37.2025.01.23.08.30.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2025 08:30:30 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v3 15/15] sched: add allocation function attributes Date: Thu, 23 Jan 2025 08:28:15 -0800 Message-ID: <20250123163003.23394-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250123163003.23394-1-stephen@networkplumber.org> References: <20250110170603.538756-1-stephen@networkplumber.or> <20250123163003.23394-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Use function attributes to catch cases where sched port config is allocated but not freed correctly. Signed-off-by: Stephen Hemminger --- lib/sched/rte_sched.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/sched/rte_sched.h b/lib/sched/rte_sched.h index 222e6b3583..7ae570aa1b 100644 --- a/lib/sched/rte_sched.h +++ b/lib/sched/rte_sched.h @@ -310,16 +310,7 @@ struct rte_sched_port_params { * Configuration */ -/** - * Hierarchical scheduler port configuration - * - * @param params - * Port scheduler configuration parameter structure - * @return - * Handle to port scheduler instance upon success or NULL otherwise. - */ -struct rte_sched_port * -rte_sched_port_config(struct rte_sched_port_params *params); +struct rte_sched_port; /** * Hierarchical scheduler port free @@ -331,6 +322,18 @@ rte_sched_port_config(struct rte_sched_port_params *params); void rte_sched_port_free(struct rte_sched_port *port); +/** + * Hierarchical scheduler port configuration + * + * @param params + * Port scheduler configuration parameter structure + * @return + * Handle to port scheduler instance upon success or NULL otherwise. + */ +struct rte_sched_port * +rte_sched_port_config(struct rte_sched_port_params *params) + __rte_malloc __rte_dealloc(rte_sched_port_free, 1); + /** * Hierarchical scheduler pipe profile add * -- 2.45.2