From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Subject: [27.03 RFC PATCH v1 0/8] Add usage counter helpers
Date: Fri, 16 Oct 2026 15:02:07 +0100 [thread overview]
Message-ID: <cover.1792159157.git.anatoly.burakov@intel.com> (raw)
There is a recurring pattern in DPDK code: on first use, do something,
on last use, undo something. In a lot of cases, these reference counters
are atomic or otherwise thread-safe, but in cases where they're not, we
use raw integers and do manual checks and counter updates instead.
This patchset attempts to provide a really minimal "usage counter" library
that does *only* that: track usage of resources. The patchset does not do
a full DPDK conversion to these counters, but it does convert a few things
to demonstrate what it would look like if we had them.
Anatoly Burakov (8):
eal: add usage count helpers
vfio: use usage counters
dev: replace raw refcount with usage count
vhost: use usage counters for vchan tracking
acl: use usage counters for ref counting
thash: use usage counters for ref counting
lpm: use usage counters for ref counting
net/nbl: track devices with usage counters
doc/api/doxy-api-index.md | 1 +
drivers/net/nbl/nbl_common/nbl_userdev.c | 22 +++---
lib/acl/acl.h | 4 +-
lib/acl/acl_bld.c | 9 +--
lib/eal/include/meson.build | 1 +
lib/eal/include/rte_usage_count.h | 96 ++++++++++++++++++++++++
lib/eal/linux/eal_dev.c | 20 +++--
lib/eal/linux/eal_vfio.c | 7 +-
lib/eal/linux/eal_vfio.h | 5 +-
lib/eal/linux/eal_vfio_group.c | 11 +--
lib/hash/rte_thash.c | 10 +--
lib/lpm/rte_lpm6.c | 13 ++--
lib/vhost/vhost.c | 5 +-
lib/vhost/vhost.h | 3 +-
14 files changed, 151 insertions(+), 56 deletions(-)
create mode 100644 lib/eal/include/rte_usage_count.h
--
2.52.0
next reply other threads:[~2026-10-16 14:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 14:02 Anatoly Burakov [this message]
2026-10-16 14:02 ` [27.03 RFC PATCH v1 1/8] eal: add usage count helpers Anatoly Burakov
2026-10-16 14:02 ` [27.03 RFC PATCH v1 2/8] vfio: use usage counters Anatoly Burakov
2026-10-16 14:02 ` [27.03 RFC PATCH v1 3/8] dev: replace raw refcount with usage count Anatoly Burakov
2026-10-16 14:02 ` [27.03 RFC PATCH v1 4/8] vhost: use usage counters for vchan tracking Anatoly Burakov
2026-10-16 14:02 ` [27.03 RFC PATCH v1 5/8] acl: use usage counters for ref counting Anatoly Burakov
2026-10-16 14:02 ` [27.03 RFC PATCH v1 6/8] thash: " Anatoly Burakov
2026-10-16 14:02 ` [27.03 RFC PATCH v1 7/8] lpm: " Anatoly Burakov
2026-10-16 14:02 ` [27.03 RFC PATCH v1 8/8] net/nbl: track devices with usage counters Anatoly Burakov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1792159157.git.anatoly.burakov@intel.com \
--to=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.