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 1CF6A460E8; Wed, 22 Jan 2025 18:37:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15A66406BA; Wed, 22 Jan 2025 18:36:10 +0100 (CET) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id DFB9A40668 for ; Wed, 22 Jan 2025 18:36:00 +0100 (CET) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-216395e151bso764005ad.0 for ; Wed, 22 Jan 2025 09:36:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737567360; x=1738172160; 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=UyeOCpIyr/imaMTlJBQNSao57iwu1+2TIlu56ZhDiHKxDdKg09tjl9C+XW9iFgUIdU nl2WPTO9e3O2DN/0QoS7L18zi2Wv8cwaIucKKKd2/CqjQCMt0rgKiVErUBXJ3l+G5q8l OT0gzfqx/QwLZJkJV6cZ+/C4+NOuA1fkdjl+yaswxt3Cta4bWu1P1dbeS7b7+W5/TTGZ fiO7cTPRbess+4lsPeX+7jORa5zqdPco7f5T3Zt58ZTNNJ0QsN2uE4HzaZahtunTxcEy aABHweQnU3VQDaB6ODNPbR0qLNHAuDFGV25wtideON2Y+li3xo13Nkj7C+eyWwM4yA0j k90w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737567360; x=1738172160; 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=RdsgVUMdoYPRAGiRTcbWSQ9wncVsNwVWTFvFeyoflMnqoRzkUtBPkFVmPOQQ7l0pLs KravVTBY77iUVbEhpeQ+ojCAmI/QGSvCSZJL//+HSG5hDT+zmePoYB6V1uXC1Lf5q2uD ELL/KnhM3AArtb6se69jfYHxtkjUL0jP2wjcIP9sjtI38+B2nZE7g2zjSTV1m03FJlEN qea4p53pv5DNpQ9nAIHILvVxZoXcNpr2QEE+LMESNM7AhlZ//ulbZrgJL2bEdUv478pv ZyaENOnfrz2tINw51c9/YfLWHzEmKNitGMclwMyXU/TPf1+vZCVMVrKh8A+4Lo8LTORz 4PmQ== X-Gm-Message-State: AOJu0YzlBt1AHmcBcxBnwjebt8LkXBc8NMeUiY6w57Zz0LEnpI23U700 w4TgJEJd7JBFoZbTG4WzrucycUsn7cukv1I8etXbD+kCB+yZLSjAltJLibpB7z6nRMpIO8nEIr7 R X-Gm-Gg: ASbGnct0UDUTzBuvlfI+fSGSjDml76i/JDgw1feG4+CJtyj7B/KJhHXSjj3DkGPoHcB akBn4tCc71sh/GuSq+SvzGs4ZcBiycpPVsBjU7KayAQ8+PW8lDOvB+izcEhLXTAa0WLdGw/CtNU 1rpVq1Qr57kqQ5LnSVWRBgTLUdJWwVI0dBucZ/Vo1PwiLG3oSiQNf/Gocz68+Ig7YtpHK87gRDl 1rB8yd2IKPVqy5OPTFcr9zXMePDDqSlEpN9J7OuJ/Ma1hqqafKAmxD/QoIkdywDCjXW8hvXuUBv +9bx7z9ZomcR/1CdHvP/YrNAJper3l0/OYhDryLf6mdu7JM= X-Google-Smtp-Source: AGHT+IHP/E/4wOIL5vdB9kGaca2dEidLXaCq+fRxCJs42dX+tijt3pCMSB5vdZJq2Bmi78IJxw2DfA== X-Received: by 2002:a17:902:ea10:b0:215:b18d:ca with SMTP id d9443c01a7336-21d993b9408mr1267305ad.18.1737567360027; Wed, 22 Jan 2025 09:36:00 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3bc64dsm97469285ad.122.2025.01.22.09.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2025 09:35:59 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Volodymyr Fialko Subject: [PATCH v2 12/15] reorder: add allocation function attributes Date: Wed, 22 Jan 2025 09:32:56 -0800 Message-ID: <20250122173521.305108-13-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250122173521.305108-1-stephen@networkplumber.org> References: <20250120180550.198121-1-stephen@networkplumber.org> <20250122173521.305108-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