This patch series completes the removal of rte_smp_XX barrier
functions that was announced over five years ago (20.05).

In the process several cases of race conditions were found
and fixed. See patches 3, 4, and 17. These are marked with Fixes:
tags and Cc: stable. Patch 2 is also marked for stable because
3 and 4 do not build with clang without it.

Most of this is mechanical with AI assistance, so strongly
encourage maintainers to take a good look.

Functional and build run on x86 and ARM native.
Barriers ordering memory writes against a device doorbell now use
rte_io_wmb() rather than an SMP barrier; on arm64 that is dmb oshst
instead of dmb ishst. In some cases the C11 form gives marginal
performance gains.

The lock-free stack patch measured faster than the generic version
it replaces, up to 63% on a 32-core x86 box; the numbers are in
that patch's commit message.

The RFC removed the barrier test outright. Konstantin pointed out it
still covers the custom x86 seq_cst fence, so patch 19 now keeps the
Peterson lock test and converts it to C11 atomics instead, with the
fence and rte_mb() as its two cases. It comes before the x86 patch
that drops rte_smp_mb(), since it holds the last caller and x86
builds with tests enabled would otherwise break for the rest of the
series.

As a side note, Konstantin asked whether the two versions of
__rte_ring_headtail_move_head_st() could be merged into one, keeping
only the _mt variants separate. That looks reasonable but is out of
scope here; left for a follow-up.

v3 - rebase
   - address review feedback
   - detailed review of bpf change
   - reword overly verbose AI verbiage
   - combine patches where possible

Stephen Hemminger (29):
  bpf: replace deprecated SMP barriers with C11 fences
  bus/vmbus: remove packed attribute from ring buffer
  bus/vmbus: fix ring buffer ordering on weakly ordered CPUs
  bus/vmbus: fix missing acquire on receive ring index
  bus/vmbus: replace SMP barriers with C11 memory fences
  drivers/baseband: convert rte_smp_rmb to fence
  net/hinic: replace rte_smp_rmb
  net/intel: replace rte_smp_rmb
  net/virtio: replace rte_smp_rmb
  net/thunderx: replace deprecated SMP barriers
  stack: always use C11 memory model implementation
  ring: replace SMP read barrier with C11 acquire fence
  crypto/virtio: update comment reference to rte_smp_rmb
  crypto/caam_jr: replace rte_smp_rmb
  crypto/caam_jr: use IO barrier before job ring doorbell
  crypto/octeontx: use IO barrier before doorbell
  event/sw: fix unlinks in progress counter races
  event/sw: replace SMP barriers with C11 atomics
  test/barrier: convert to C11 atomics
  eal/x86: move optimized fence out of SMP barrier
  common/octeontx: remove redundant barrier in mbox
  mempool/octeontx: use IO barrier in pool destroy
  event/octeontx: replace deprecated SMP barriers
  event/dpaa2: replace deprecated barrier in selftest
  event/dsw: replace SMP barriers with release fences
  event/opdl: replace SMP barriers with C11 atomics
  net/virtio: replace deprecated barrier in avail index update
  eal: remove stale SMP barrier in rte_service
  eal: remove rte_smp_XX

 app/test/test_barrier.c                       |  71 ++++----
 devtools/checkpatches.sh                      |   8 -
 doc/guides/rel_notes/deprecation.rst          |   8 -
 doc/guides/rel_notes/release_26_11.rst        |  11 ++
 .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c         |   8 +-
 drivers/baseband/fpga_lte_fec/fpga_lte_fec.c  |  12 +-
 drivers/bus/vmbus/private.h                   |  12 +-
 drivers/bus/vmbus/rte_vmbus_reg.h             |   4 +-
 drivers/bus/vmbus/vmbus_bufring.c             |  22 +--
 drivers/bus/vmbus/vmbus_channel.c             |  13 +-
 drivers/common/octeontx/octeontx_mbox.c       |   6 +-
 drivers/crypto/caam_jr/caam_jr.c              |   5 +-
 .../crypto/octeontx/otx_cryptodev_hw_access.h |   4 +-
 drivers/crypto/virtio/virtqueue.h             |   8 +-
 drivers/event/dpaa2/dpaa2_eventdev_selftest.c |   4 +-
 drivers/event/dsw/dsw_event.c                 |   8 +-
 drivers/event/octeontx/ssovf_evdev_selftest.c |   6 +-
 drivers/event/octeontx/ssovf_worker.c         |   8 +-
 drivers/event/opdl/opdl_evdev.c               |   8 +-
 drivers/event/sw/sw_evdev.c                   |  37 +++--
 drivers/event/sw/sw_evdev.h                   |   2 +-
 drivers/event/sw/sw_evdev_scheduler.c         |  24 ++-
 drivers/mempool/octeontx/octeontx_fpavf.c     |   4 +-
 drivers/net/hinic/base/hinic_pmd_cmdq.c       |   3 +-
 drivers/net/hinic/base/hinic_pmd_mgmt.c       |   2 +-
 drivers/net/intel/ice/ice_rxtx.c              |   2 +-
 drivers/net/intel/ixgbe/ixgbe_rxtx.c          |   2 +-
 drivers/net/thunderx/base/nicvf_hw.c          |   3 +-
 drivers/net/thunderx/base/nicvf_plat.h        |   5 +-
 drivers/net/virtio/virtqueue.h                |  22 +--
 lib/bpf/bpf_pkt.c                             |  45 ++++--
 lib/eal/arm/include/rte_atomic_32.h           |   6 -
 lib/eal/arm/include/rte_atomic_64.h           |   6 -
 lib/eal/common/rte_service.c                  |   1 -
 lib/eal/include/generic/rte_atomic.h          |  61 -------
 lib/eal/loongarch/include/rte_atomic.h        |   6 -
 lib/eal/ppc/include/rte_atomic.h              |   6 -
 lib/eal/riscv/include/rte_atomic.h            |   6 -
 lib/eal/x86/include/rte_atomic.h              |  41 ++---
 lib/ring/rte_ring_gcc_pvt.h                   |   6 +-
 lib/stack/meson.build                         |   1 -
 lib/stack/rte_stack_lf.h                      |   4 -
 lib/stack/rte_stack_lf_generic.h              | 153 ------------------
 43 files changed, 237 insertions(+), 437 deletions(-)
 delete mode 100644 lib/stack/rte_stack_lf_generic.h

-- 
2.53.0

Reply via email to