numam-dpdk/drivers/event
Mattias Rönnblom 70cb0278a4 event/dsw: fix flow migration
Fix bug in flow migration, which under certain conditions causes
reordering and violation of atomicity guarantees.

The issue occurs when the processing of a flow (on an atomic queue)
has resulted in events enqueued to a flow currently being migrated,
and the former (producer) flow is also selected for migration. The
events are buffered ("paused") on the originating port, and released
(forwarded) when the migration has completed. However, at the time of
"unpausing" the latter (consumer) flow, processing of the producer
flow on the port to which it was migrated may have already produced
events, for the same paused flow. This constitutes a race condition,
and depending on which port wins, reordering may have been introduced.

This patch forbids migration when a port has paused events, since
those events may have been the result of processing a to-be-migrated
flow.

This patch also disallows processing events pertaining to a flow under
migration, for the same reason. A new buffer is introduced, which
holds such not-yet-processed events dequeued from the port's input
ring. Such events are forwarded to the target port as a part of the
migration process.

The 'forwarding' migration state is eliminated, and instead background
processing is only performed if there are no unreleased events on the
port.

The bug is primarily triggered in situations where multiple flows are
migrated as one transaction, but may occur even if only a single flow
is migrated (e.g., with older DSW versions, which does not support
multi-flow migration).

Fixes: f6257b22e7 ("event/dsw: add load balancing")
Cc: stable@dpdk.org

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
2022-09-26 15:33:46 +02:00
..
cnxk event/cnxk: move crypto adapter to respective file 2022-09-26 15:33:44 +02:00
dlb2 dev: hide driver object 2022-09-23 16:14:34 +02:00
dpaa dev: hide driver object 2022-09-23 16:14:34 +02:00
dpaa2 dev: hide driver object 2022-09-23 16:14:34 +02:00
dsw event/dsw: fix flow migration 2022-09-26 15:33:46 +02:00
octeontx dev: hide driver object 2022-09-23 16:14:34 +02:00
opdl bus/vdev: make driver-only headers private 2022-09-23 16:14:34 +02:00
skeleton dev: hide driver object 2022-09-23 16:14:34 +02:00
sw bus/vdev: make driver-only headers private 2022-09-23 16:14:34 +02:00
meson.build drivers: remove octeontx2 drivers 2022-01-12 15:36:32 +01:00