DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [27.03 RFC PATCH v1 0/8] Add usage counter helpers
@ 2026-10-16 14:02 Anatoly Burakov
  2026-10-16 14:02 ` [27.03 RFC PATCH v1 1/8] eal: add usage count helpers Anatoly Burakov
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Anatoly Burakov @ 2026-10-16 14:02 UTC (permalink / raw)
  To: dev

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-10-16 14:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 14:02 [27.03 RFC PATCH v1 0/8] Add usage counter helpers Anatoly Burakov
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox