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 7972A46114; Sat, 25 Jan 2025 19:41:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 90FBE40651; Sat, 25 Jan 2025 19:40:39 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id EAD4540648 for ; Sat, 25 Jan 2025 19:40:30 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-21634338cfdso74364935ad.2 for ; Sat, 25 Jan 2025 10:40:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737830430; x=1738435230; 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=pCDCD2uDQSZsSWX509hbExiUUdTlz1WS8psIKStiB8Q=; b=HR2Vmp5tbb5/fUV77Z0Zh9x7qgRl1aZPLkFH8zHr3rsOIQpls7Em22PAEI/bjTJ+SI D5Hhlw5QZFcfgvW1dXLZIcK77Id9DvXaxgjP1d8/e4spA81NpCcKXhJxY7GNie+jdYOw hZ+XmD9sYPVewclEUhCFavCb1FxZMSftOSe+RDaHmStfqwPQTgLQIrjzKrqAD5HDTL4e cVHugTQJrXWW90vjDEtWShZBP+JJxBKBOyeiXbjTauthgvXB0kEblZ1gYT9a9eNjxekK lZYjGQBmxvBHAMQ7S+NvC2rGcdvFE8kgWF9kgGkYQ01NLrF9+Qr//V2lh7644TKQACbT IDMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737830430; x=1738435230; 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=pCDCD2uDQSZsSWX509hbExiUUdTlz1WS8psIKStiB8Q=; b=n3zykFx6wj/hWgFpGfDYD6o8FO2+kNv6cDsb0R/fQV6CNqY5RlyMMR7Sn8D3qz8wgk NMa+rwm+BgKDFOlAp8Vo2rucwWVqfg6Xg0Oj5gbwRMWwErzzLwrlppMJnbO2U0S3C/Kg SB6YTqshq8opB17cpHhM8qVsWK6m0oHnq4opgHwgMJh257sXe/Y/sYdaXnarTRLtd3z+ Jd81q02XkKguDvhey89I3f/TE35BFrrIbd7uADKy9IIih20n53w0fO3bcdC8kKEJiKII N/V9nh8xRUPYm1EwObLgaPSTzbRGrLrVjCpH/cXVySyHEEagj0pYKmsdqB21sqdqbu/h rwJg== X-Gm-Message-State: AOJu0Yw34+oiiunYslxTlhIIm/dSYwGs5WwQZ2fJd9OsJ+YzVhWQcsvf ruwJYhmk3byV0vqg40wGh6mN4FHEXYOYVZ2N2EPYsVhTaUrEHUP7qHWD+vgBRlEdEGeI9FZLrml g X-Gm-Gg: ASbGncsaGOsWp8K/wUCcU7EFEEtWnhxgGkfMpK0ZMeLgt/v0dKZeFgK4dBrS68b5cja HkKs/ezsAGxeiYZsgHhenIAOFxZLaOMyKxVJ6Tbj4QcwXstt3W9HnP6oyMtZdbym30eEAla90RD n85Y3HXzCOPNUp0JcDMzfSQ9JYZaXcBJHSmp8CE87AZkPWXvpryJ+eR9NQVh+xh3EeHwZC/szt9 15m94MmEq0SRUe6OlLnJ6J5avSMW8AglTi2suQ9ZnwRnC7ypTZkJoP/7Ze++HshvNagx8vpbbVn zqjdSW8mat/t1n+5n8tkYoEswCMotMQIh0lPN4DvSDphP1/+kgUVvBqP3A== X-Google-Smtp-Source: AGHT+IGpBLw+SLJUo+YKhlTzo0ZIFOmUZsFJNDYPExEmt4/XGVVJ0M9vhGPIXhEK4JbJBex07MCNWg== X-Received: by 2002:a05:6a00:288e:b0:72d:2444:da2d with SMTP id d2e1a72fcca58-72dafa03216mr42939094b3a.9.1737830430150; Sat, 25 Jan 2025 10:40:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Jan 2025 10:40:29 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Volodymyr Fialko Subject: [PATCH v6 11/15] reorder: add allocation function attributes Date: Sat, 25 Jan 2025 10:36:45 -0800 Message-ID: <20250125184010.782330-12-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 reorder table is allocated but not freed correctly. Signed-off-by: Stephen Hemminger Acked-by: Volodymyr Fialko --- lib/reorder/rte_reorder.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/reorder/rte_reorder.h b/lib/reorder/rte_reorder.h index 56a6507f9f..1c8c1d5079 100644 --- a/lib/reorder/rte_reorder.h +++ b/lib/reorder/rte_reorder.h @@ -14,6 +14,7 @@ * sequence number present in mbuf. */ +#include #include #include #include @@ -44,6 +45,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 +75,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 +123,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