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 5CC2E460E8; Wed, 22 Jan 2025 18:37:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 330CD40A72; Wed, 22 Jan 2025 18:36:13 +0100 (CET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id 9EDB040669 for ; Wed, 22 Jan 2025 18:36:03 +0100 (CET) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2167141dfa1so756925ad.1 for ; Wed, 22 Jan 2025 09:36:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737567363; x=1738172163; 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=3QRacvMKJ9QdaXZMvhcCzID5xFYyo0c0SQkNX//SNz+Vexpp6XFW5aD7FxA/+hQDI6 WCcAZ4Nd5Mq2qljo5+CyJF/8BOOldgPt/E27e1qrin71Aaek4UTh0FAn0UQGigzJMxZ0 l/YklxJIr8gT8S0WktqSIl+A3z6T7aAafDuaoqVWtqVJIHS19LCe2uvU+m0FuCBDDhDH biZ1SxtSVLzAvl/cN8hB0sNQQBoGavQDOzDH+GiFK0ZTkw+bhhbRmi3gHISJg1YwcaVj o5SVrSmu5lMZDG7W5+XvKcg+N/98GQl1hc2fDHpe9iA7lJeB0PU/i7F/XzEIM12Gw9Y8 qTqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737567363; x=1738172163; 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=s6Vkxhd2NszbhxBultDsArtvcZtqnIsnrFHMVTy48jCedh+BGxPun6N5lcGClPfTVt xoaYhKQbGkOCKm/ZjcCz24s1M7PoFU8yXxtqWKwvs+wbTgzkn7fbF1uNsDIpNZQrTrlg Z0WwDs0l48Q0kChlwDV4Fm6+su5MwAJDYrxuCSkl3xQUpBbXx4iGEpfzy7thZJhvEI8I KHzttk4S+PY+WSqHeoC4x/wkwrSdzEtl1MOzARfAEATSWxg1jKIu8CHeZm/0K4jGdEWR wUxlzIX7HbEiGTKHxS5hNgdy0ccUVCHwuJRmzHdHUi4M81x5QkGJzD1OBVXBB5tEkR5w gkfg== X-Gm-Message-State: AOJu0Ywf8uAy8Y1otlW0J4K7ckgfuybAq9TCg3KvoUEQ4zpscJrZNXXW gXYE8P/D9Csawdpfzq1weuPuVTxdXDInTB8QBoYWhiJUpi3coTwbmDWclDlcuYyWO6Pg35CZ8k2 H X-Gm-Gg: ASbGncuKF6+3qYYqabcIqi7CmbA70o8DqXiCqR6SGvY23Ud6CzXQSnPSoW0VGKvdgM/ +wnUTfxtLkMISd2OLYVdEYwL9j5pVTCzVI099GDIXjfSSW8ej9JJJIdHapM+uxrTzvUstxJ/O01 NSzVumsUNxqD4WkhXoZwo2LsRavEJEopeyZtSv4Tt2xZqyT3CrXtW7lZIIuqU9XwOUCy8Gq3s0a CMylvoIl7t3JJhTt+BK5ALciTQzthGAOqpQGRszOZ4w1BYjVDD8AE8B0vvwqKV6jexgbz2/rd5m Usq1ZsQeVwla4nzWiFA6Wxan3Zlo1ZS6fDb61g1W0D2V2fo= X-Google-Smtp-Source: AGHT+IH/ZKkebyeybKELsb1m75h3O5a0YIo4srXlXlPYQ6GQIAsqvErFLjxhfigstNguE8xphuH3Ug== X-Received: by 2002:a17:902:f547:b0:215:6c5f:d142 with SMTP id d9443c01a7336-21d9937cb6dmr1248525ad.20.1737567362874; Wed, 22 Jan 2025 09:36:02 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3bc64dsm97469285ad.122.2025.01.22.09.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2025 09:36:02 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v2 15/15] sched: add allocation function attributes Date: Wed, 22 Jan 2025 09:32:59 -0800 Message-ID: <20250122173521.305108-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250122173521.305108-1-stephen@networkplumber.org> References: <20250120180550.198121-1-stephen@networkplumber.org> <20250122173521.305108-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