[dpdk-dev] [PATCH v6 02/14] compressdev: add queue pair management

Trahe, Fiona fiona.trahe at intel.com
Fri May 4 10:43:58 CEST 2018



> -----Original Message-----
> From: Verma, Shally [mailto:Shally.Verma at cavium.com]
> Sent: Friday, May 4, 2018 3:49 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>; dev at dpdk.org
> Cc: Trahe, Fiona <fiona.trahe at intel.com>; ahmed.mansour at nxp.com; Gupta, Ashish
> <Ashish.Gupta at cavium.com>; Sahu, Sunila <Sunila.Sahu at 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.guarch at intel.com]
> >Sent: 27 April 2018 18:54
> >To: dev at dpdk.org
> >Cc: fiona.trahe at intel.com; Verma, Shally <Shally.Verma at cavium.com>; ahmed.mansour at nxp.com;
> Gupta, Ashish
> ><Ashish.Gupta at cavium.com>; Pablo de Lara <pablo.de.lara.guarch at intel.com>; Verma, Shally
> <Shally.Verma at cavium.com>; Gupta,
> >Ashish <Ashish.Gupta at cavium.com>
> >Subject: [PATCH v6 02/14] compressdev: add queue pair management
> >
> >From: Fiona Trahe <fiona.trahe at intel.com>
> >
> >Add functions to manage device queue pairs.
> >
> >Signed-off-by: Fiona Trahe <fiona.trahe at intel.com>
> >Signed-off-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
> >Signed-off-by: Shally Verma <shally.verma at caviumnetworks.com>
> >Signed-off-by: Ashish Gupta <ashish.gupta at 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.


More information about the dev mailing list