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 241CD46130; Fri, 24 Jan 2025 19:18:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A63E642E1D; Fri, 24 Jan 2025 19:17:39 +0100 (CET) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id F3EC842D9D for ; Fri, 24 Jan 2025 19:17:30 +0100 (CET) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2162c0f6a39so66811725ad.0 for ; Fri, 24 Jan 2025 10:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737742650; x=1738347450; 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=1o59IuQtKvwGwufdRIztUqm57DjgRGypmGxme+zhY/b2EnOi+xzCTUBPOGYROqLLmL 3eGhBza+TnHXig6iE7Wwhk+eDAKuKmByhfzZvw456GkShpMmcrGAw9u8x2AltERCi7kj EowNIaBjxNYKOGLkHFR5lDp61sFBvN6YFZijGSqLYsvrqiE3UVbHku8OGrvAoFJa9D2X 0KM1zbjuI5OygA+4xDCEZEcxsTmGUeUnDsEjbWYx7sHx5OOAVK5IuvKhh4FyWXNRwKGC XuWfYptQkW82kiB1oxT47haBHwZt6CxIZosWnOgB3fDOBR5/O56k86D/CvUmsa4Q6ai8 YfnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737742650; x=1738347450; 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=MtC50h5lOcle8HiGt/7JzWTwbYgAnFRzKv2a2xflafFbIWDnc42e1YepRX1kL/4QaF 7XBsfa3nxPIrlwQaRusH8NarP5VcQkjDMhW6BCZUHSepC6SpfDPrBlr6KbJ6gboEgAvI ul5Eztln6yBqBPuYY21gMW3c36vjv7OPPZc4XpZIp3HNXBs2F14QLya+w633fw7uF76F msTpsTaBVT0JvwdJiuoKjFYjXVI0p0SRFVf0WWQ8IGraNffP8kDzfDJq5geiY/Ymf6Ru iztOarLsxD7ApXL4UVYTxdk4d5scrM7qCJ8utW6+8VHGxeAc4QgQYYEJF3RWha4/hM6r /SBQ== X-Gm-Message-State: AOJu0YzVw7BDyA/mDYDeGU+2aNZcOFmrlwCp2findu/XOzWJRDFnm9RI gG4b6K/+68ObihE+SZGf2p7ee+AbWRItKkCO/ztlGlXLxnP/6s0OUsB60fzqCunsC0WanBm1AbZ X X-Gm-Gg: ASbGncte8hq3tsV3KF5sfaNklPVb2kzp79TTJRvk1gqN470wL7ynCmq5+fkwkge3GrT 9AziwUBw0e3zcvZGShpd040JLvpYONWZJPSQiiuLsFzuZkw2D4M2bExZy53owCkke+bENEcTiuC /ep/uLy6pzN6KuuxDWUrOIJF8Nh4Ke5s2dLOrluXUY42YocXyre9TGwynUee6fZhvOAuyMbRjeF Z0fM4Bm7ib35LNqmat2wGAQ8hnXaAlVlNaPiM+5BzP1vAWPXrHEfo/dqLpEiK9hjY6ZZVUgHtUc /puQA2Z907yojV4CB3TDzr72It8RwxgI2iLRvyoPnYqxvt9rnSYmFsBXiw== X-Google-Smtp-Source: AGHT+IEv3197S1k5t3ck3tPCCJLbmPJy2Ir4sxehOps17uar+6TOISR4FqGK/XZ9bN4rSIFdZHkUOw== X-Received: by 2002:a05:6a20:3948:b0:1ea:f941:8d8e with SMTP id adf61e73a8af0-1eb6978d3a5mr13331222637.16.1737742648770; Fri, 24 Jan 2025 10:17:28 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72f8a6b2ed8sm2184477b3a.41.2025.01.24.10.17.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 10:17:28 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v4 15/16] sched: add allocation function attributes Date: Fri, 24 Jan 2025 10:15:06 -0800 Message-ID: <20250124181704.86567-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250124181704.86567-1-stephen@networkplumber.org> References: <20250110170603.538756-1-stephen@networkplumber.or> <20250124181704.86567-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