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 C1FA8460FF; Thu, 23 Jan 2025 17:31:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A88B40E2B; Thu, 23 Jan 2025 17:30:38 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id AC00240DDA for ; Thu, 23 Jan 2025 17:30:28 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2f43da61ba9so1720420a91.2 for ; Thu, 23 Jan 2025 08:30:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737649828; x=1738254628; 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=kVPXzxrV0nDGJ5Ie6Cowl+SwRLqS/2HUG2nprcCn0Ys=; b=csYkdSpJy4USsqWsoFZui9bZon0WABMZRtGLaS9kkLuNaTuKxzglrvD4jnpgbMnwNt 8SY70168Y4n9++G1wUDt44qSHesNCkLouEpcoZhtsiwYwlMc5Ryg+GzkgHZeO48etXif tGfrRhnGRyVYF/GdYiUsDTtuZoCHdIi5/bqGjq1lEyY+7w9fxmkriBRVfUqISsQBe6LK foQk7Vf6Rrt3CWeeYnwO3AMvS5iE41GTuHWhS0pqumpgW/aLZsc7l10zs4/ardYnXcXS 5uISFYx06C38Jf8u2Q/ExtRj249FWZxcJK6/0N7Go47j/FooiLQF9Om5e3kDha1yRlHw 8J1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737649828; x=1738254628; 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=kVPXzxrV0nDGJ5Ie6Cowl+SwRLqS/2HUG2nprcCn0Ys=; b=j+2G4/MTYYtM4bgR+TOEb/paQnKNYfU4ytluYckT4RasIZuvk4QvXEaMlot30PfK73 4BBlvFpKweoUNZLHD08plSVLJdfJkrtRg4D9B3f5QizXpK5RzzfwiZOUFLDqczn/NLgo S89SMAt+q5cwxNxILyUWxbD63JbE6PrCBUh+v9OfXLJcVbvt6csNXq+S21DJ7lEWQnzk NemxyyaqnlmV8DvqEe+GLbQNpyGr+nmjKXHuqBB4G1l8NF1o3CyNmZYS44h4KaW+WC8N Kdy8KKQqSB39+RK53kEZwAhgpaw68/hA3DT8qH0JzCFfGi8XipeV4Kf1iQ+KZMkLByYw xpAQ== X-Gm-Message-State: AOJu0YzRt0cJZkffKeWLVI7EIFkP/GApUGdPhCZ0/9AJxV2FE/vQGP+e 6A1BUfcrrRRfJtfXYBUpwXqWpEZiKp9bqoScNLoQfPqXnji8jyNtZReQG0sLwfBRLFlDH3jRTMC i X-Gm-Gg: ASbGncvWfMRKoCu3pwIqj+npCVTT0uWIoVks27IUbnc+QI90KVa8gKiqAkrEa8LhYcY Qwyv4P6EVREDtXNjzithEYniXE8v/WloX6dXhgCKcJarDFAB70xY5ZcbaJnEWtapyj0ZgqqLknW lYaCySq4PRaw4VRGc5xURPiXsmmsajk43fQapcoZl4QqQRHnf7P/clVf4+ZqHxJzXQogbxiyQH+ nvRl0pNpLVvzswiy3/3ihWm+sfqXsL+yBrq7uT8zmjH2hj77nd/jwMI2gY8SMbF2ckvFGAsmU/e s7Cy5QaySyITxG6l7vmc3d7TfN6haTePPmZxFbJKsHT+89zTAtmCWX53Bw== X-Google-Smtp-Source: AGHT+IGCuprr2KiKUpmTzYMk3pl7xI4mqfq13kbOIRd+ewr04W5uSO4zAh8zSNDkiC4/t9eH30KXhg== X-Received: by 2002:a05:6a00:244d:b0:71e:6c3f:2fb6 with SMTP id d2e1a72fcca58-72daf950b94mr45037516b3a.8.1737649827871; Thu, 23 Jan 2025 08:30:27 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2025 08:30:27 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Volodymyr Fialko Subject: [PATCH v3 12/15] reorder: add allocation function attributes Date: Thu, 23 Jan 2025 08:28:12 -0800 Message-ID: <20250123163003.23394-13-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 reorder table is allocated but not freed correctly. Signed-off-by: Stephen Hemminger Acked-by: Volodymyr Fialko --- lib/reorder/rte_reorder.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/reorder/rte_reorder.h b/lib/reorder/rte_reorder.h index 56a6507f9f..2f26ed7df3 100644 --- a/lib/reorder/rte_reorder.h +++ b/lib/reorder/rte_reorder.h @@ -44,6 +44,16 @@ rte_reorder_seqn(struct rte_mbuf *mbuf) rte_reorder_seqn_t *); } +/** + * Free reorder buffer instance. + * + * @param b + * Pointer to reorder buffer instance. + * If b is NULL, no operation is performed. + */ +void +rte_reorder_free(struct rte_reorder_buffer *b); + /** * Create a new reorder buffer instance * @@ -64,7 +74,8 @@ rte_reorder_seqn(struct rte_mbuf *mbuf) * - EINVAL - invalid parameters */ struct rte_reorder_buffer * -rte_reorder_create(const char *name, unsigned socket_id, unsigned int size); +rte_reorder_create(const char *name, unsigned int socket_id, unsigned int size) + __rte_malloc __rte_dealloc(rte_reorder_free, 1); /** * Initializes given reorder buffer instance @@ -111,16 +122,6 @@ rte_reorder_find_existing(const char *name); void rte_reorder_reset(struct rte_reorder_buffer *b); -/** - * Free reorder buffer instance. - * - * @param b - * Pointer to reorder buffer instance. - * If b is NULL, no operation is performed. - */ -void -rte_reorder_free(struct rte_reorder_buffer *b); - /** * Insert given mbuf in reorder buffer in its correct position * -- 2.45.2