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 D027146130; Fri, 24 Jan 2025 19:18:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3BB6542DDE; Fri, 24 Jan 2025 19:17:34 +0100 (CET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id B244342D6A for ; Fri, 24 Jan 2025 19:17:26 +0100 (CET) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2166360285dso43545115ad.1 for ; Fri, 24 Jan 2025 10:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737742646; x=1738347446; 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=t/JqNOZy1vl7py61soFkwGc6rIMzd7z0Yd1XcVsc5P//CGToPVf8tHa6l3BQWdl+9M +5WxpoIc/5fRfHU4vYslHtPKfKrfciv+yVt0MRu9GLSxAe2YmMaBa2Q96SJq2cM6QkWV Xez8JBw3LuRZ5o1IKVDUxD9kEWTz6YkqDMSNu4RxrX8qhvJjASVxw0+LsM9Bbmbl6AF2 0w8JoxSY44SxaiCb0FNbG/ancktqvkV9f5rBgCx83u8hAJq0AbOsRrwDWNHSjPQW1biI 50NGyap4k0ACR+Qd02eIZVV6vvVPJEHRz3BY1Sq/zO3M1JjMBVVEl3bS6kKwGN7C2Q+6 9ZSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737742646; x=1738347446; 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=fTL1jpE4i2QUZhi4ElAgcCOxI4n6WaF0tXaCAhjEx625PrqpKi7ZlIG6zYv3D9UORf d7QIni1ZFsdqwQeZchoKnLQ5t3OfYIvDoX/NHFyHTxjIMazDF0/Ll9RScwKR4L3Hl61i QI1Qs5hybEQIsZaEkHbDe/wO+Po3NT6Liou2C6jEHA7Q1+phrvnEEDUT3DhAt3OVaHkm pu70T7mg4SCJRkCWUTO9yMtyLC+AOJAtbxov1tKjKnpGIWcjiX93AmBwXoDpwiivWH0N r3ra7BBSYaoJSldBADESR0H3LavEVOn+mmWq4YfXfU99i/h8mIEQCH6mwl0lmMs9BqLI OhQw== X-Gm-Message-State: AOJu0YydRvRGxl3sYCVHZu9dJVzj1ntQjX5IN2e11NncMG7CQe+zv8SJ 9CtjtboRikNfiBigbezYivm0c93BBUyQyFvnx/+4Vc2GDOukd1kpxtJWfGwLw7f3bVKTblkstkR J X-Gm-Gg: ASbGncuurQRWDDgt4PhMrRpHU7ZWnwp2YE2CkXF+yMr82JFapcHgaL/k/IqE/M2RoFe f97+qiXLRJ/66l+vrFPK8CfgoD1t1A6CwmOSHxTcWqE04QGZmTzM+C9LjWxcyf5NgqDZZHgdCMM elRlBdbVxxG3DQ+bGQ6wsPyx5cUXOi8hHw+nChlptdgLhWw0rB9dw2/Mu1KysbPssRcv6sf24e3 v24OuQTJ938NuJgUi+3DlazMLAiexTvIpGihgAqAbBx1mLySzes6RaJeBXT1qVkf15l6cxm1SUi QR4ScrgEnfEh/WfjIcfmlET+wdEHdfAf2fxeFS1DJvJAzhMFHre5acOFVQ== X-Google-Smtp-Source: AGHT+IEnqknXNFEM4Yk08s+Wtf9cMXy6K8aGpRr6JemS2Qm0BbtyojcF/TpXVTdGLgqWunlzY64KzQ== X-Received: by 2002:a05:6a20:565a:b0:1e1:aa24:2e5c with SMTP id adf61e73a8af0-1eb215eff85mr34856074637.38.1737742645998; Fri, 24 Jan 2025 10:17:25 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 10:17:25 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Volodymyr Fialko Subject: [PATCH v4 12/16] reorder: add allocation function attributes Date: Fri, 24 Jan 2025 10:15:03 -0800 Message-ID: <20250124181704.86567-13-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 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