[v3] ethdev: add field for device data per process
Checks
Commit Message
Primary and secondary processes share a per-device private data. With
current design it is not possible to have data per-device per-process.
This is required for handling properly the CPP interface inside the NFP
PMD with multiprocess support.
There is also at least another PMD driver, tap, with similar
requirements for per-process device data.
v2:
- changing library version
- report shared library change in release notes
v3:
- fix shared library version
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
doc/guides/rel_notes/release_18_11.rst | 1 +
lib/librte_ethdev/Makefile | 2 +-
lib/librte_ethdev/meson.build | 2 +-
lib/librte_ethdev/rte_ethdev_core.h | 8 +++++++-
4 files changed, 10 insertions(+), 3 deletions(-)
Comments
On 10/15/18 12:00 PM, Alejandro Lucero wrote:
> Primary and secondary processes share a per-device private data. With
> current design it is not possible to have data per-device per-process.
> This is required for handling properly the CPP interface inside the NFP
> PMD with multiprocess support.
>
> There is also at least another PMD driver, tap, with similar
> requirements for per-process device data.
>
> v2:
> - changing library version
> - report shared library change in release notes
>
> v3:
> - fix shared library version
>
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
> ---
> doc/guides/rel_notes/release_18_11.rst | 1 +
> lib/librte_ethdev/Makefile | 2 +-
> lib/librte_ethdev/meson.build | 2 +-
> lib/librte_ethdev/rte_ethdev_core.h | 8 +++++++-
> 4 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_18_11.rst b/doc/guides/rel_notes/release_18_11.rst
> index c806dc6..8b2ccad 100644
> --- a/doc/guides/rel_notes/release_18_11.rst
> +++ b/doc/guides/rel_notes/release_18_11.rst
> @@ -189,6 +189,7 @@ Shared Library Versions
> librte_acl.so.2
> + librte_cfgfile.so.2
> librte_cmdline.so.2
> + + librte_ethdev.so.11
>
> This section is a comment. Do not overwrite or remove it.
> =========================================================
It is still wrong place. There is librte_ethdev.so.10 few lines below.
It should be updated to add + sign and change version to 11.
<...>
On Mon, Oct 15, 2018 at 1:12 PM Andrew Rybchenko <arybchenko@solarflare.com>
wrote:
> On 10/15/18 12:00 PM, Alejandro Lucero wrote:
> > Primary and secondary processes share a per-device private data. With
> > current design it is not possible to have data per-device per-process.
> > This is required for handling properly the CPP interface inside the NFP
> > PMD with multiprocess support.
> >
> > There is also at least another PMD driver, tap, with similar
> > requirements for per-process device data.
> >
> > v2:
> > - changing library version
> > - report shared library change in release notes
> >
> > v3:
> > - fix shared library version
> >
> > Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
> > ---
> > doc/guides/rel_notes/release_18_11.rst | 1 +
> > lib/librte_ethdev/Makefile | 2 +-
> > lib/librte_ethdev/meson.build | 2 +-
> > lib/librte_ethdev/rte_ethdev_core.h | 8 +++++++-
> > 4 files changed, 10 insertions(+), 3 deletions(-)
> >
> > diff --git a/doc/guides/rel_notes/release_18_11.rst
> b/doc/guides/rel_notes/release_18_11.rst
> > index c806dc6..8b2ccad 100644
> > --- a/doc/guides/rel_notes/release_18_11.rst
> > +++ b/doc/guides/rel_notes/release_18_11.rst
> > @@ -189,6 +189,7 @@ Shared Library Versions
> > librte_acl.so.2
> > + librte_cfgfile.so.2
> > librte_cmdline.so.2
> > + + librte_ethdev.so.11
> >
> > This section is a comment. Do not overwrite or remove it.
> > =========================================================
>
> It is still wrong place. There is librte_ethdev.so.10 few lines below.
> It should be updated to add + sign and change version to 11.
>
>
Apologies for my clumsiness. It seems I was modifying the example!
I'll fix this asap.
Thanks
> <...>
>
@@ -189,6 +189,7 @@ Shared Library Versions
librte_acl.so.2
+ librte_cfgfile.so.2
librte_cmdline.so.2
+ + librte_ethdev.so.11
This section is a comment. Do not overwrite or remove it.
=========================================================
@@ -16,7 +16,7 @@ LDLIBS += -lrte_mbuf -lrte_kvargs
EXPORT_MAP := rte_ethdev_version.map
-LIBABIVER := 10
+LIBABIVER := 11
SRCS-y += ethdev_private.c
SRCS-y += rte_ethdev.c
@@ -2,7 +2,7 @@
# Copyright(c) 2017 Intel Corporation
name = 'ethdev'
-version = 10
+version = 11
allow_experimental_apis = true
sources = files('ethdev_private.c',
'ethdev_profile.c',
@@ -539,7 +539,13 @@ struct rte_eth_dev {
eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
- struct rte_eth_dev_data *data; /**< Pointer to device data */
+ /**
+ * Next two fields are per-device data but *data is shared between
+ * primary and secondary processes and *process_private is per-process
+ * private. The second one is managed by PMDs if necessary.
+ */
+ struct rte_eth_dev_data *data; /**< Pointer to device data. */
+ void *process_private; /**< Pointer to per-process device data. */
const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
struct rte_device *device; /**< Backing device */
struct rte_intr_handle *intr_handle; /**< Device interrupt handle */