> -----Original Message-----
> From: Verma, Shally [mailto:shally.ve...@cavium.com]
> Sent: Friday, May 4, 2018 3:49 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.gua...@intel.com>; dev@dpdk.org
> Cc: Trahe, Fiona <fiona.tr...@intel.com>; ahmed.mans...@nxp.com; Gupta, Ashish
> <ashish.gu...@cavium.com>; Sahu, Sunila <sunila.s...@cavium.com>
> Subject: RE: [PATCH v6 02/14] compressdev: add queue pair management
>
> One quick question
>
> >-----Original Message-----
> >From: Pablo de Lara [mailto:pablo.de.lara.gua...@intel.com]
> >Sent: 27 April 2018 18:54
> >To: dev@dpdk.org
> >Cc: fiona.tr...@intel.com; Verma, Shally <shally.ve...@cavium.com>;
> >ahmed.mans...@nxp.com;
> Gupta, Ashish
> ><ashish.gu...@cavium.com>; Pablo de Lara <pablo.de.lara.gua...@intel.com>;
> >Verma, Shally
> <shally.ve...@cavium.com>; Gupta,
> >Ashish <ashish.gu...@cavium.com>
> >Subject: [PATCH v6 02/14] compressdev: add queue pair management
> >
> >From: Fiona Trahe <fiona.tr...@intel.com>
> >
> >Add functions to manage device queue pairs.
> >
> >Signed-off-by: Fiona Trahe <fiona.tr...@intel.com>
> >Signed-off-by: Pablo de Lara <pablo.de.lara.gua...@intel.com>
> >Signed-off-by: Shally Verma <shally.ve...@caviumnetworks.com>
> >Signed-off-by: Ashish Gupta <ashish.gu...@caviumnetworks.com>
> >---
> > lib/librte_compressdev/rte_compressdev.c | 178
> > ++++++++++++++++++++-
> > lib/librte_compressdev/rte_compressdev.h | 45 ++++++
> > lib/librte_compressdev/rte_compressdev_internal.h | 5 +
> > lib/librte_compressdev/rte_compressdev_pmd.h | 47 ++++++
> > lib/librte_compressdev/rte_compressdev_version.map | 2 +
> > 5 files changed, 276 insertions(+), 1 deletion(-)
> >
> >+
> >+ if (dev->data->queue_pairs == NULL) { /* first time configuration */
> >+ dev->data->queue_pairs = rte_zmalloc_socket(
> >+ "compressdev->queue_pairs",
> >+ sizeof(dev->data->queue_pairs[0]) * nb_qpairs,
> >+ RTE_CACHE_LINE_SIZE, socket_id);
> >+
> >+ if (dev->data->queue_pairs == NULL) {
> >+ dev->data->nb_queue_pairs = 0;
> >+ COMPRESSDEV_LOG(ERR,
> >+ "failed to get memory for qp meta data, nb_queues %u",
> >+ nb_qpairs);
> >+ return -(ENOMEM);
> >+ }
> >+ } else { /* re-configure */
> >+ int ret;
> >+ uint16_t old_nb_queues = dev->data->nb_queue_pairs;
> >+
> [Shally] dev->data is shared entity among processes. So, does it mean if
> multiple processes call for
> device_configure, then every new process overrides qp allocations (and other
> resources) already done
> by any other process, leaving it unusable for them?
>
> Thanks
> Shally
[Fiona] Yes. If multiple processes want to share a device they'd need to ensure
that a primary process
configures the device and agree between the processes which process uses which
resource, e.g. each
process accesses only 1 queue_pair.
Same is true of other device management APIs like start, stop and close.