From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 8AB0446114;
	Sat, 25 Jan 2025 19:40:23 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 20A9D4025E;
	Sat, 25 Jan 2025 19:40:23 +0100 (CET)
Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com
 [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id AFD5D40151
 for <dev@dpdk.org>; Sat, 25 Jan 2025 19:40:21 +0100 (CET)
Received: by mail-pj1-f50.google.com with SMTP id
 98e67ed59e1d1-2ee709715d9so4513120a91.3
 for <dev@dpdk.org>; Sat, 25 Jan 2025 10:40:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737830420;
 x=1738435220; 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=V2gPP3Y0/maFAZpN4oQUrxse49PTIELE6C2aO+Q8IjE=;
 b=PRyB4S3aqKXCO3kXlfctZw0S2XLrlSvUlKADgxEDbpElsWXX6MjUNLned2YBTLN6ES
 aG7xdKaMH1vsCTt46CWMqsRf0iHyZQcWpkMXDquqZSpxyliTMI9lKF0q7UlsHwpfYuis
 RiLOKDhrOjcIt7ywzmIFctveZf+eP3oCs9Rn1Dz1iYKrtz+zhqBNSA6Xw02N541fisN9
 G2TwxpqZhdTA6NO/cxSVpfYPt7BLAdRkoBXes5pZbUhnVl68AIqEOaW2LlOlYyyXW7NO
 LoPQHedC1Y+7Lgk98BIJt9HTLf9MBmm+a0EWgqcbwtkhClmfl2ilCT8olqzIEjA9s49y
 t06w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1737830420; x=1738435220;
 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=V2gPP3Y0/maFAZpN4oQUrxse49PTIELE6C2aO+Q8IjE=;
 b=hdO62TLZdFuATqDIfMeC0WMgNsojSO6NxvUC5hFD20tVElyHSkGLkOVY6hZXhDC6R8
 RuSusbOuoZ9BCVQQF182IBVd+eGQPUyhPmJjNL24eVp7rj+ctSkrQ2JZl+1EfVMBJoly
 jzOOQFHSYX/Fxi8NwjDzuOevONkxUkdYNW496bSb60k4jgV93XVXLUPt9DDh3eWY3Lyh
 iRGRe6wERYJX+GqkTgSVce9FbvMJ1gFK26flyi3hUXwd+nQwnDKKRToeJvMSLHmqrxdp
 OAx6jW09qCjdNuZ6Q050djjhMojdLgHx4GQ6Kd7bfXuZfNGJx4LPG6rK4syg0WO02Fvu
 Bcdw==
X-Gm-Message-State: AOJu0Yy0KTK3+s4ykxRYcntJQbdUGZybfh4o+8cMQuRbnrP9WkviBQrF
 AKJaEBxUz2BLLC61xlbg+kL9BBettB06oDVIahrCLIPSCLtwbzPpLxO5OYeNSoDtYgEfpUKfnmc
 g
X-Gm-Gg: ASbGnctU5MSDeT17qL9GNfHwPd9VDBv+tfVEJVa5dTUaaR4dalksj6mx2e34YlLFVs+
 32811umj0OSbrHxRPlVBInkUTEqkqRrIIt5naJb9lsYvhkfLFrSOUvvTj85izveFapZ21eNl5Q3
 XYkMXxKekEsfSazVZ06EAYSStVFFNKaKA3bzZ48E+WrV1gyp5vH/myPJgDpJ0WvVKucggtJaFBw
 M6nmTBgJmvNIhf43w84jXWvQSLMlmwGOUeBLifyo5pUU6mKKBaMYEh4OHPMM3CRbvY/o/m837RP
 I7UBpj9EL7a/plAQT48cKQ7vQlHOWUaPP22jRB3uxtVr7FkyiRmGBzJOpg==
X-Google-Smtp-Source: AGHT+IHe26+Zb7iy01PBY7132haSry90zVNhT0R2pTlxcwbQsQOtmfdhCyyH2Y0wSC+OsuRYJvh8Xw==
X-Received: by 2002:a05:6a00:428d:b0:71e:4786:98ee with SMTP id
 d2e1a72fcca58-72dafae88b0mr48579095b3a.21.1737830420567; 
 Sat, 25 Jan 2025 10:40:20 -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.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 25 Jan 2025 10:40:19 -0800 (PST)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v6 00/15] Add allocation annotation to more functions
Date: Sat, 25 Jan 2025 10:36:34 -0800
Message-ID: <20250125184010.782330-1-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-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

This patch series builds on the allocation function attributes
added in 24.11 release. These annotations will allow for compiler
to flag cases where a pointer is allocated with one function
but incorrectly passed to a different free function.

The current code base does this correctly now, but adding
attributes will catch future bugs, or errors in user programs.

For each of these patches, the free function prototype
needs to be reordered to be before the function attribute
of the allocator.

Checkpatch perl script falsely complains in a couple patches
because it doesn't really understand C syntax for attributes.

Note: this won't work for functions that are marked experimental.
The problem is that function attribute for deallocator can't handle the
case of experimental API. Even if the function in question is experimental
the use of experimental free function in the attribute attribute causes problems.

v6 - drop the pipeline patch (see note)

Stephen Hemminger (15):
  fib: add allocation function attributes
  rib: annotate rib allocation functions
  hash: add allocation function attributes
  lpm: add allocation function attributes
  acl: add allocation function attributes
  bitratestats: add allocation function attributes
  member: add allocation function attributes
  mempool: add allocation function attributes
  eventdev: add allocation function attributes
  ring: add allocation function attributes
  reorder: add allocation function attributes
  compressdev: add allocation function attributes
  telemetry: add allocation function attributes
  sched: add allocation function attributes
  doc: add release note about allocation attributes

 doc/guides/rel_notes/release_25_03.rst | 30 +++++++++++++++++++++
 lib/acl/rte_acl.h                      | 27 +++++++++++--------
 lib/bitratestats/rte_bitrate.h         | 22 ++++++++-------
 lib/compressdev/rte_comp.h             | 29 +++++++++++---------
 lib/eventdev/rte_event_ring.h          | 27 ++++++++++---------
 lib/fib/rte_fib.h                      | 26 ++++++++++--------
 lib/fib/rte_fib6.h                     | 24 +++++++++--------
 lib/fib/trie.h                         |  7 ++---
 lib/hash/rte_fbk_hash.h                | 25 +++++++++--------
 lib/hash/rte_hash.h                    | 22 ++++++++-------
 lib/lpm/rte_lpm.h                      | 23 ++++++++--------
 lib/lpm/rte_lpm6.h                     | 23 ++++++++--------
 lib/member/rte_member.h                | 24 ++++++++---------
 lib/mempool/rte_mempool.h              | 37 ++++++++++++++------------
 lib/reorder/rte_reorder.h              | 24 +++++++++--------
 lib/rib/rte_rib.h                      | 26 ++++++++++--------
 lib/rib/rte_rib6.h                     | 24 +++++++++--------
 lib/ring/rte_ring.h                    | 23 +++++++++-------
 lib/sched/rte_sched.h                  | 24 ++++++++++-------
 lib/telemetry/rte_telemetry.h          | 21 ++++++++-------
 20 files changed, 281 insertions(+), 207 deletions(-)

-- 
2.45.2