Skip to content

RFC Add usage counter helpers

Anatoly Burakov dpdk-dev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8eal: add usage count helpersdoc/api/doxy-api-index.md lib/eal/include/meson.build lib/eal/include/rte_usage_count.h+98 -00 replies
2/8vfio: use usage counterslib/eal/linux/eal_vfio.c lib/eal/linux/eal_vfio.h lib/eal/linux/eal_vfio_group.c+9 -140 replies
3/8dev: replace raw refcount with usage countlib/eal/linux/eal_dev.c+9 -110 replies
4/8vhost: use usage counters for vchan trackinglib/vhost/vhost.c lib/vhost/vhost.h+4 -40 replies
5/8acl: use usage counters for ref countinglib/acl/acl.h lib/acl/acl_bld.c+7 -60 replies
6/8thash: use usage counters for ref countinglib/hash/rte_thash.c+5 -50 replies
7/8lpm: use usage counters for ref countinglib/lpm/rte_lpm6.c+7 -60 replies
8/8net/nbl: track devices with usage countersdrivers/net/nbl/nbl_common/nbl_userdev.c+12 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [27.03 RFC PATCH v1 0/8] Add usage counter helpers

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
Signature · 1 line
2.52.0