[dpdk-dev] [RFC PATCH] ivshmem ring aliases
Thomas Monjalon
thomas.monjalon at 6wind.com
Fri Apr 29 17:52:26 CEST 2016
2016-02-24 11:33, David Verbeiren:
> The goal of this parch is to allow VMs to use standard ring names regardless of the names
> given to the rings by host environment. It applies to configurations using ivshmem.
>
> With shared memory rings, all VMs share a single namespace for the rings. However, a VM
> will typically expect to find its rings with a pre-determined name (e.g. p1_rx, p1_tx)
> regardless of how it's deployed, inserted in a service chain, or of which other VMs are
> deployed alongside it. Hence, it is desirable to introduce a level of indirection where
> the host can set a mapping from the actual ring names (e.g. dpdkr0_rx|tx with OVS) and
> the names that will be visible in the VM. This patch provides a simple implementation
> of such a mapping scheme.
>
> Since the mapping must be VM specific, the aliases are inserted into the IVSHMEM metadata
> area by the host and the guest side uses thoses aliases when doing rte_ring_lookup().
>
> A new function, rte_ivshmem_add_ring_alias() is provided in librte_ivshmem to populate
> alias entries in the host environment when creating the per-VM metadata.
I'm still not sure this library is a good idea at all.
This patch continue the tradition of librte_ivshmem by adding more
#ifdef in the code (in rte_ring here).
We could also comment the compile time values or the checkpatch warnings.
But more importantly, what is the use case of this library and why is
it important to have such support in DPDK?
> --- a/lib/librte_ring/rte_ring.c
> +++ b/lib/librte_ring/rte_ring.c
> @@ -352,6 +352,12 @@ rte_ring_lookup(const char *name)
> struct rte_ring *r = NULL;
> struct rte_ring_list *ring_list;
>
> +#ifdef RTE_LIBRTE_IVSHMEM
> + const char * target_name = rte_eal_ivshmem_alias_get(name);
> + if (target_name)
> + name = target_name;
> +#endif
This #ifdef should not exist.
More information about the dev
mailing list