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 3EA2146104; Sat, 25 Jan 2025 03:14:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA74D40652; Sat, 25 Jan 2025 03:14:02 +0100 (CET) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id B41D34042E for ; Sat, 25 Jan 2025 03:13:27 +0100 (CET) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-21c2f1b610dso61692075ad.0 for ; Fri, 24 Jan 2025 18:13:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737771207; x=1738376007; 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=BuOhnu1eGXXObGva4CAwN+80f90LUFG9i89pC/EM1nN6sIN0bOQ80UMU0rcCE34KOR ipDyYcQwRsTYVznf0UFJII6em2CCK4ngiPDjlOuIx9X6i1Fi17xT+aVLckTK1IXcIofm 54ylixztnXq01SLNEzV94jEwCxRVfxOHiM92prFrRzvR+SU3D04ijqqeOAjOW6y+l+bM sqDSWE8KqwmtqMFR+djkiA6UEil2s9SAK/1/M70B+YPc9lAptRm+IPqIfzQzqlTJsSTC RFJDCGo9V/Kgx3mS2uW8YxGoLsRCpeIrYok574kgiaG4ZRirvkhEYFcKRblYpmICG4bt Bzzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737771207; x=1738376007; 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=CreHSG/HxG1/Wl+hr7WJlxO78ceQFj1e1yDJm18XPyMUu8j3H+qjIASKEfznkF0znq rLT1w0aCUGB2tZiumjqZc3TsMxYD3Q/df79fMqE3R6iemMaro2Pj07W/P5pRzLM2KgAT BtRFQ37KfBVpa4OkUVKAwEl65jayEn8Yz/KbVYiJufZCfg3sBdWsbC0h7wM5Ija8Vxwy /+VwWBl2Ias8ryR0Bv135kErD9SrLnvnDDbpWLuZphI9Wgmj86gU3vcAvT4doLb8t0fL pkf87f0cnn8V+cFRnbqvxfOAa4xZBu2mlZ2lzGWq1bb0mPSr4Mo3kbbyAnyezUE7Oy4g lSgw== X-Gm-Message-State: AOJu0Yws2y0M3CGOFnAk1m6+cbZPh1zPTHHTAXqH0s0UiLRymnwow3wM YG9FRiag42mGacoOYNwfUE/bbIF+1z2UpnvufzoUVUTrwW/KbnDrwCsIXqTGIorAJqhs5DhbXcW h X-Gm-Gg: ASbGncv25CwCYYgLCQKZ2UExd5NoPxVlXNcbNk1Am4qerUidkbOZsDq4sGZwtz+VpAL 3ml2wQz5ag9s9awSBdm0yUC9n44ZrFsOwyWebOTKRKa2P1Lfl2GR99QaEPBLwkysZzl9ST2ij+X LV7aHKdW2aCLbtTS4xUtM65qpWqvruYxpBlXOVelDf8+UHIlHXtMRIjWW43XoZgCvQgWlJDI+MH 9tkf0WgIQ5F05gN8i6xYUeeYIdjlOY0txAw2mz1AIKAfEIYNp+pY5yBxPV0pZpF0I5W7j5lmm1j OHSlmGYtup+jxL3r+PSq8LY3fkSYluwHYnpb/Z1fCwfyxrhbcyrvNjrfMA== X-Google-Smtp-Source: AGHT+IGpbInUsOtOz4PEJxP4d4OKNzRLUME7WeJok+/l1HkXFqBMxgbXJhnBQ1+XhwULHSjrf1SZtA== X-Received: by 2002:a05:6a20:7f96:b0:1e8:a374:cee6 with SMTP id adf61e73a8af0-1eb214766efmr47193349637.6.1737771207014; Fri, 24 Jan 2025 18:13: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-ac48e84e199sm2345256a12.11.2025.01.24.18.13.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 18:13:26 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Volodymyr Fialko Subject: [PATCH v5 12/16] reorder: add allocation function attributes Date: Fri, 24 Jan 2025 18:11:25 -0800 Message-ID: <20250125021305.76485-13-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250125021305.76485-1-stephen@networkplumber.org> References: <20250110170603.538756-1-stephen@networkplumber.org> <20250125021305.76485-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