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 AE97F4601A; Mon, 20 Jan 2025 19:07:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 015E5427BF; Mon, 20 Jan 2025 19:06:15 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id D75F5427A7 for ; Mon, 20 Jan 2025 19:06:09 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2162c0f6a39so107136785ad.0 for ; Mon, 20 Jan 2025 10:06:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737396369; x=1738001169; 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=6P5EWiAl55ZEAgp+t6UGwjbTqBHOFMXC3+2TgSu8tDc=; b=w4N8B4VVivbW1UEB6nvX838J18g76O4yarplsuq5aLEfKxI77OZuEb86gqZs+nTgla UZR6f0N7DNuVPi6J0/vukEZuOCYDDl2ehhjP9BHMdQkeEh9BCOb+tictlfKInNfDa/qo xyYS+M3VAws9QVMxa7olOqrhE+ZmTFWRuJK4Z+e0qrOpm5Q6C6N8SieaTfRs5cNqQyzi rtuUGyIbfvpiK+FuAeYadpJY3esl9g2vKhViGa2feQhiN5DMCtFzQw+y7TxhBzoMjYB2 7jEu3YfQIEkygYxeA/zg3Q4JfwqQkjZxp6vvNc3Oa391irK+UNM3jo6UjijHp12nbEuY t0Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737396369; x=1738001169; 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=6P5EWiAl55ZEAgp+t6UGwjbTqBHOFMXC3+2TgSu8tDc=; b=i89M01fcimMlFGdDH/uRmfUy/2nIQFsReOy2hzzkNaj3kDxbkmNtgBjJuos/AI9RvU nh4rdwmMM4ipocIIzwAXve5TN0Uvjj9IvD3miYZo4xpjRnsyGIj4yYuMvsJyunYQj7B6 Pw7IwZ3h1rtOWrOsC5zQjwSK94hiiNBGeqy2BjkPelFRhEezDETu5TSXBXqsJi89FeTs FBx1aZYNUV0eOvI4nov0oT2Tn/mZpKRr/r4hSyMToPPb/FFwTfgXTmdYhBQCsVo+lPva 23Gvo2UhhKiliM+zJ7UMaojth+uwL76uLJllNgMOYnaJsjRWjLWSMpiHZQuDsDceSYue op0w== X-Gm-Message-State: AOJu0YzFdpGFl9DacBlweHKQeKQtdcw/NJviJTYGi5I50EyKN2tBTXK8 paymc7uhh94I4aXMo9QXLqcKJbqCyz/GW7mu8O4WBhtBOP7y/Njdbn9NZCcEFKWToXz01D3gcNt M X-Gm-Gg: ASbGncs5uH7CRg4EoiJj8VmohQQZLJwMBw3LGRne53aRW0ILu7geVLoAs1hWEmoVJbW qZUgw07c6OkyHkW0s5G7/E1c86fSUl732Oygbngv6A8YYXHXC9wiiu9FhtzMV6CRQ/bWmAHAz6m ZNfX+CreoDhyXgGzxoKaocIOt+vi4I17OyP1G733gZniCjxt29jb8hzrolpQQX/qN9FG/25jY11 0XPiV+Pr0utctJYCg7HEyHkRLrPFFNrcxCpa5Phzzgow0UVBvgGEUGc68F0oECgNpwGPlkJ4hOW 3f4NybkMWmtEXgpv6JCjWCPvW9jTXJe9XrGylbpTJO79R30= X-Google-Smtp-Source: AGHT+IEVGz0R3YLThMcecir3dob+WFto4XUzxNWahn8by5ai//8snqTKJbTqdJNALfqqE14rbjk9oQ== X-Received: by 2002:a05:6a00:ad2:b0:725:f359:4641 with SMTP id d2e1a72fcca58-72db1b311cemr19375669b3a.1.1737396369059; Mon, 20 Jan 2025 10:06:09 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72dab848b08sm7393982b3a.71.2025.01.20.10.06.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 10:06:08 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Volodymyr Fialko Subject: [PATCH 12/15] reorder: add allocation function attributes Date: Mon, 20 Jan 2025 10:03:30 -0800 Message-ID: <20250120180550.198121-13-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250120180550.198121-1-stephen@networkplumber.org> References: <20250120180550.198121-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 --- 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