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 8E7E6460FF; Thu, 23 Jan 2025 17:31:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 208BE40DDB; Thu, 23 Jan 2025 17:30:33 +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 03A7F40B9D for ; Thu, 23 Jan 2025 17:30:25 +0100 (CET) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-218c8aca5f1so26474615ad.0 for ; Thu, 23 Jan 2025 08:30:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737649824; x=1738254624; 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=34mATj8nhQRi5zocmRZZEm8EKuw2ZcxoGU4Biu3Hvk4=; b=SR6zkuBgkTNXLFbwQp1Qj0Cz30MG44e+/XpzKNfZqGdkdHuL+jvpdF7uSCmFB5pUQg iTLvyeTxMPqsJ9VxJd+0WgohhxRrV09bNLKFEWreH9d9TZ4MBYqhuuWQeTYRLMkE9pp4 ncfTSdF40423yAGPDv12DiGhCqL3aiv4u1bV2VElO/KzsVsy/h7+UJNPJQoKhsElTORm 3vp8su50UKJe2gvPayy/9GJmkL8NESwAqdJ6gnK3X2nNuPuqfhvg6xtglziaZcYMJyAR r3A/e2DSswzWCtLGR7AyZhzk0dKhtqgqiX9ov/HvWoLUxuNj/z6HPw33abSjfzqPHUJD 9gkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737649824; x=1738254624; 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=34mATj8nhQRi5zocmRZZEm8EKuw2ZcxoGU4Biu3Hvk4=; b=VVExJk+ZBSN+2XAa1g+oG/0pvDzTB+Vq/s+P02Y9E1k6IqiEZD3a2z8Z6nJMpYhkDP G7GTIW8NiOmDNpf2b8yORCfAosAfBnDSMGqNxAixc/USrgMKHaSNNPIv8mNkumLvqez0 vkhXYOKDzvZxqp0AQbw14yfObsIjf4FW0ugAIxuPPYZBYsHUGd/7go9nB2ly3U9c/9M3 8saTB/hdQhr30KEe2acsgtyYyckEliua7p/Q9huUfP0VlQIzyfeECBXEsZn+2XbOQsUS F8dab2NC9nVh0G5UFd12yi1w4fdRWmOYkdiTi+Eame31/VVG8f3xaJRgvgiT8yMLqIdN Lfmw== X-Gm-Message-State: AOJu0YwJBHZzib7iKpmQW+4rEc+BpgKxfkF2sCxaTnlNy7LATtHHqZI8 3lonZZKHibt/+S/K3p23UO7pqGO0bVyfr95yGc9f+pRFnkNNpbWfj2ZYUZSaktIJA8We8/XaFQo t X-Gm-Gg: ASbGnct1LX7AB1OZ4WumYvFhl5T7+SWCd1i26Uy2acOoLoSr/bWcQ+k1yaVwoEGY+hK w9VteCqW2El2qGqoLAE8WYSleL/dM+nxHnRyQJiyTBwv/Q6JRwARe3o85phSeS7iQRw5elR2t9o hOFfCuUpfA4d0LcedEKi8w8qq37QqSCpBQKjkBdOPIjO86gckNpRUwl7BYWeFskrgEAx5j6Ikc3 cpB76un9VTMGwCJrD19qu3qxsbWui84dV41RPMrG1aJ2yD94t/PqvK9kJYv5mPZi+/hIH8DrGJd YSZhlMn+bMjnVFQFeUhM1D7y0mz5U4z+pfEGRefz5QoATiGA1KlOR+Hh3w== X-Google-Smtp-Source: AGHT+IGo26hp9c4MZCxIkLHul4Ipd0pNXB+acfcF5Hr1Vfzi+V7SK/e8Ya/ZsElJBw9fxr7KQIdLuQ== X-Received: by 2002:a05:6a21:9989:b0:1e5:a79e:3c7e with SMTP id adf61e73a8af0-1eb2144d76bmr40765114637.9.1737649824247; Thu, 23 Jan 2025 08:30:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2025 08:30:23 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel Subject: [PATCH v3 08/15] member: add allocation function attributes Date: Thu, 23 Jan 2025 08:28:08 -0800 Message-ID: <20250123163003.23394-9-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 member table is allocated but not freed correctly. Signed-off-by: Stephen Hemminger --- lib/member/rte_member.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/member/rte_member.h b/lib/member/rte_member.h index 109bdd000b..0235bb0a81 100644 --- a/lib/member/rte_member.h +++ b/lib/member/rte_member.h @@ -341,6 +341,16 @@ struct __rte_cache_aligned rte_member_parameters { struct rte_member_setsum * rte_member_find_existing(const char *name); +/** + * De-allocate memory used by set-summary. + * + * @param setsum + * Pointer to the set summary. + * If setsum is NULL, no operation is performed. + */ +void +rte_member_free(struct rte_member_setsum *setsum); + /** * Create set-summary (SS). * @@ -351,7 +361,8 @@ rte_member_find_existing(const char *name); * Return value is NULL if the creation failed. */ struct rte_member_setsum * -rte_member_create(const struct rte_member_parameters *params); +rte_member_create(const struct rte_member_parameters *params) + __rte_malloc __rte_dealloc(rte_member_free, 1); /** * Lookup key in set-summary (SS). @@ -528,17 +539,6 @@ int rte_member_report_heavyhitter(const struct rte_member_setsum *setsum, void **keys, uint64_t *counts); - -/** - * De-allocate memory used by set-summary. - * - * @param setsum - * Pointer to the set summary. - * If setsum is NULL, no operation is performed. - */ -void -rte_member_free(struct rte_member_setsum *setsum); - /** * Reset the set-summary tables. E.g. reset bits to be 0 in BF, * reset set_id in each entry to be RTE_MEMBER_NO_MATCH in HT based SS. -- 2.45.2