numam-dpdk/lib/librte_hash
Anatoly Burakov 4542f89397 hash: make tailq fully local
Since the data structures such as rings are shared in their entirety,
those TAILQ pointers are shared as well. Meaning that, after a
successful rte_ring creation, the tailq_next pointer of the last
ring in the TAILQ will be updated with a pointer to a ring which may
not be present in the address space of another process (i.e. a ring
that may be host-local or guest-local, and not shared over IVSHMEM).
Any successive ring create/lookup on the other side of IVSHMEM will
result in trying to dereference an invalid pointer.

This patchset fixes this problem by creating a default tailq entry
that may be used by any data structure that chooses to use TAILQs.
This default TAILQ entry will consist of a tailq_next/tailq_prev
pointers, and an opaque pointer to arbitrary data. All TAILQ
pointers from data structures themselves will be removed and
replaced by those generic TAILQ entries, thus fixing the problem
of potentially exposing local address space to shared structures.

Technically, only rte_ring structure require modification, because
IVSHMEM is only using memzones (which aren't in TAILQs) and rings,
but for consistency's sake other TAILQ-based data structures were
adapted as well.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2014-07-22 19:42:23 +02:00
..
Makefile remove trailing whitespaces 2014-06-11 00:29:34 +02:00
rte_fbk_hash.c hash: make tailq fully local 2014-07-22 19:42:23 +02:00
rte_fbk_hash.h hash: make tailq fully local 2014-07-22 19:42:23 +02:00
rte_hash_crc.h remove trailing whitespaces 2014-06-11 00:29:34 +02:00
rte_hash.c hash: make tailq fully local 2014-07-22 19:42:23 +02:00
rte_hash.h hash: make tailq fully local 2014-07-22 19:42:23 +02:00
rte_jhash.h remove trailing whitespaces 2014-06-11 00:29:34 +02:00