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 4A3D646114; Sat, 25 Jan 2025 19:41:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5E1544068A; Sat, 25 Jan 2025 19:40:44 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 62E974065D for ; Sat, 25 Jan 2025 19:40:33 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2ee50ffcf14so6731349a91.0 for ; Sat, 25 Jan 2025 10:40:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737830432; x=1738435232; 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=+oQ2P8a47fCd0TJPqICbX62+VhXo899XJEdh7Y0/IPo=; b=DWaTxpxQ2I5LF+uGk3/CMFPLGgqTfscbXVv5MJXq7mVVlf/tXFWUddtvonWL0mHIcd +/tQypZ3yL5d2t/X2pE1hB6lTMeIaFsiOJ4b7Is2dWWyMpjSuCp44WznmWAVkoJfKRId 8KBkkzBA+ZPa0l5JR1Il47RSG0Qh4yw9FTCSUPEPGc1GRbqf5JRSE1Ie1Bh2J3enK6u7 4ZY8Fx2/E9st030E80+KLxBeERYgbDN26X4baS8nzQzROomFPAIAlS/Q7qCKXOGBjhxK YbwDvJDfBH+u9Y+vxeryyatLAwdKom9I9QIp5DK7WNFGDVTZRVj4x4Kbv1zeswJBAjKW 5Wmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737830432; x=1738435232; 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=+oQ2P8a47fCd0TJPqICbX62+VhXo899XJEdh7Y0/IPo=; b=Mo3fSFMMWwvKtklrpjVPSRmsUFK+ZE1kSVLZQZ52Ft5G0KSjhDJU/ubDD/RJLZ8a25 ETYde++/SRs5K+Mbtk9D/RjmteaVnaktOkUrZbFQ8rOPTPZiENvKLiJuhngZVuyPjq9d pveWPDiBgfCEYK5AguzPqTIhzimOcDaR0S+9i345iAHLyq4SDDsH9DmCumeXdDmzMGvL ZDue8ZR0pFFxHfLR5i9hX4e0zXRl8o4Wbh1LXRYbTDbvGKQimGRsGLCybtrvPxtmJBkw c6wOyuYEEPBMJILCzCdqsKbebtKGTa8piN7IJCnaMLrLr/b1g/z34sE2BF5lRqcWLG37 XsdQ== X-Gm-Message-State: AOJu0YxeOkXPHmBdiIX6atWT9hs42ELPD62YGnqOpxankFVC7iVjbWMs WOaY+63Vte0GzeJNF0Om2vBZIDGBcu5FI8E8u+626ww/1hdc72ukvAWX3r/+kC5y1q4au5hV6gE e X-Gm-Gg: ASbGnct0EEHaDKS/JyKlTeN2fBXPNh611EHeQl1npatGFVgiKKeFoSZyk+zsZRiLJR+ kDwjy/PAj4FNh+TH2kKMoVkqeztaxHtASwvYKmYWZ2kns2CICITTzhYQlLAJrg6Q09jsgaRmeqd ZZx2/GGZfN4F64lPHgeP0oJYxQdlf4Co7rJBaPnDp2B079lR/RnUkq+WWR83t9D4dIhMZqp5A5h JNTysPPel5TI9rASSKukvA21OIL1fGwSCNFroJTrYoKa4sOMRGP6xjp38vQqcq2ZQxwYdC5Ed+g CIpWDsMdFegdW4zXtL4SVCWEAopGJNDbnktLixpboQmfCMwzbpbQM6fMig== X-Google-Smtp-Source: AGHT+IFIcRsx23N+K/BrXuefB5zyuiAGl2N3sPtFl/xOp+VODubJHPmk3D9Dn/+xmq785ag7h+qqeA== X-Received: by 2002:a05:6a00:94a6:b0:725:e386:3c5b with SMTP id d2e1a72fcca58-72f8b20507cmr14247809b3a.5.1737830432590; Sat, 25 Jan 2025 10:40:32 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72f8a7614f4sm4100547b3a.97.2025.01.25.10.40.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Jan 2025 10:40:32 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v6 14/15] sched: add allocation function attributes Date: Sat, 25 Jan 2025 10:36:48 -0800 Message-ID: <20250125184010.782330-15-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250125184010.782330-1-stephen@networkplumber.org> References: <20250120180550.198121-1-stephen@networkplumber.org> <20250125184010.782330-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 | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/sched/rte_sched.h b/lib/sched/rte_sched.h index 222e6b3583..e98f43072d 100644 --- a/lib/sched/rte_sched.h +++ b/lib/sched/rte_sched.h @@ -51,6 +51,7 @@ * queues within same pipe lowest priority traffic class (best-effort). */ +#include #include #include @@ -310,16 +311,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 +323,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