DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [PATCH 5/6] bus/dpaa2: add flag to configure DCA in QBMAN multi Tx
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 5/6] bus/dpaa2: add flag to configure DCA in QBMAN multi Tx Nipun Gupta
@ 2018-01-04  9:56   ` Nipun Gupta
  0 siblings, 0 replies; 9+ messages in thread
From: Nipun Gupta @ 2018-01-04  9:56 UTC (permalink / raw)
  To: Nipun Gupta, jerin.jacob; +Cc: dev, Hemant Agrawal

Sent this particular patch by mistake. Please ignore.
I have rejected this patch in the patchworks.

Thanks,
Nipun

> -----Original Message-----
> From: Nipun Gupta [mailto:nipun.gupta@nxp.com]
> Sent: Thursday, January 04, 2018 21:36
> To: jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org; Hemant Agrawal <hemant.agrawal@nxp.com>; Nipun Gupta
> <nipun.gupta@nxp.com>
> Subject: [PATCH 5/6] bus/dpaa2: add flag to configure DCA in QBMAN multi Tx
> 
> With the current QBMAN multi-tx API, we need to create separate
> enqueue descriptors for each of the packet which is required to
> be enqueued to the hardware, once we support Atomic Queues
> (with DCA) in dpaa2 drivers. Creating enqueue descriptor for
> each packet is costly and have significant performance impact.
> This patch introduces a flag parameter in the QBMAN multi-tx API,
> so that DCA configuration (and later on ORP/ODP for ordered queues)
> can be passed using flags and be updated in the EQCR using this flag.
> 
> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
> ---
>  drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h | 5 +++++
>  drivers/bus/fslmc/qbman/qbman_portal.c             | 7 +++++++
>  drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c        | 1 +
>  drivers/net/dpaa2/dpaa2_rxtx.c                     | 6 ++++--
>  4 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
> b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
> index efa4861..da0c694 100644
> --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
> +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
> @@ -588,6 +588,9 @@ static inline int qbman_result_is_SCN(const struct
> qbman_result *dq)
>  /* volatile dequeue command is expired */
>  #define QBMAN_DQ_STAT_EXPIRED       0x01
> 
> +#define QBMAN_EQCR_DCA_IDXMASK		0x0f
> +#define QBMAN_ENQUEUE_FLAG_DCA		(1ULL << 31)
> +
>  /**
>   * qbman_result_DQ_flags() - Get the STAT field of dequeue response
>   * @dq: the dequeue result.
> @@ -971,6 +974,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const
> struct qbman_eq_desc *d,
>   * @s: the software portal used for enqueue.
>   * @d: the enqueue descriptor.
>   * @fd: the frame descriptor to be enqueued.
> + * @flags: bit-mask of QBMAN_ENQUEUE_FLAG_*** options
>   * @num_frames: the number of the frames to be enqueued.
>   *
>   * Return the number of enqueued frames, -EBUSY if the EQCR is not ready.
> @@ -978,6 +982,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const
> struct qbman_eq_desc *d,
>  int qbman_swp_enqueue_multiple(struct qbman_swp *s,
>  			       const struct qbman_eq_desc *d,
>  			       const struct qbman_fd *fd,
> +			       uint32_t *flags,
>  			       int num_frames);
>  /**
>   * qbman_swp_enqueue_multiple_desc() - Enqueue multiple frames with
> diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c
> b/drivers/bus/fslmc/qbman/qbman_portal.c
> index 314a70e..d3023d9 100644
> --- a/drivers/bus/fslmc/qbman/qbman_portal.c
> +++ b/drivers/bus/fslmc/qbman/qbman_portal.c
> @@ -518,6 +518,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const
> struct qbman_eq_desc *d,
>  int qbman_swp_enqueue_multiple(struct qbman_swp *s,
>  			       const struct qbman_eq_desc *d,
>  			       const struct qbman_fd *fd,
> +			       uint32_t *flags,
>  			       int num_frames)
>  {
>  	uint32_t *p;
> @@ -560,6 +561,12 @@ int qbman_swp_enqueue_multiple(struct qbman_swp
> *s,
>  		p = qbman_cena_write_start_wo_shadow(&s->sys,
>  					QBMAN_CENA_SWP_EQCR(eqcr_pi &
> 7));
>  		p[0] = cl[0] | s->eqcr.pi_vb;
> +		if (flags && (flags[i] & QBMAN_ENQUEUE_FLAG_DCA)) {
> +			struct qbman_eq_desc *d = (struct qbman_eq_desc *)p;
> +
> +			d->eq.dca = (1 << QB_ENQUEUE_CMD_DCA_EN_SHIFT)
> |
> +				((flags[i]) & QBMAN_EQCR_DCA_IDXMASK);
> +		}
>  		eqcr_pi++;
>  		eqcr_pi &= 0xF;
>  		if (!(eqcr_pi & 7))
> diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> index 5e52390..32e19b7 100644
> --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
> @@ -699,6 +699,7 @@
>  		while (loop < frames_to_send) {
>  			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
>  							&fd_arr[loop],
> +							NULL,
>  							frames_to_send -
> loop);
>  		}
> 
> diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
> index 9b66bd3..6c4fddb 100644
> --- a/drivers/net/dpaa2/dpaa2_rxtx.c
> +++ b/drivers/net/dpaa2/dpaa2_rxtx.c
> @@ -787,7 +787,8 @@ void __attribute__((hot))
>  		loop = 0;
>  		while (loop < frames_to_send) {
>  			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
> -					&fd_arr[loop], frames_to_send - loop);
> +					&fd_arr[loop], NULL,
> +					frames_to_send - loop);
>  		}
> 
>  		num_tx += frames_to_send;
> @@ -803,7 +804,8 @@ void __attribute__((hot))
> 
>  		while (i < loop) {
>  			i += qbman_swp_enqueue_multiple(swp, &eqdesc,
> -							&fd_arr[i], loop - i);
> +							&fd_arr[i], NULL,
> +							loop - i);
>  		}
>  		num_tx += loop;
>  	}
> --
> 1.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 0/6] support atomic queues in dpaa2 ethernet with eventdev
@ 2018-01-04 16:06 Nipun Gupta
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 1/6] event/dpaa2: replace static with dynamic logging Nipun Gupta
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Nipun Gupta @ 2018-01-04 16:06 UTC (permalink / raw)
  To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta

This patch series supports atomic queues in DPAA2 Ethernet driver
with eventdev. Also other changes such as dynamic logging is
supported with these changes.

Patch 1 - support dynamic logging in eventdev
Patch 2,3,4 - Cleanups and performance enhancement for eventdev
Patch 5,6 - support atomic queues in DPAA2 ethernet driver

Nipun Gupta (6):
  event/dpaa2: replace static with dynamic logging
  bus/fslmc: introduce API to consume dqrr using index
  event/dpaa2: use dqrr index to cosume the DQRR entry
  event/dpaa2: have separate structure to hold dqrr entries
  bus/fslmc: add flag to configure DCA in QBMAN multi Tx
  net/dpaa2: support atomic queues

 drivers/bus/fslmc/fslmc_bus.c                      |   2 +
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h            |   2 -
 drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h |  12 +++
 drivers/bus/fslmc/qbman/qbman_portal.c             |  14 +++
 drivers/bus/fslmc/rte_bus_fslmc_version.map        |   2 +
 drivers/bus/fslmc/rte_fslmc.h                      |  15 +++
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c        |   1 +
 drivers/event/dpaa2/dpaa2_eventdev.c               | 111 +++++++++++----------
 drivers/event/dpaa2/dpaa2_eventdev.h               |  12 ---
 drivers/event/dpaa2/dpaa2_eventdev_logs.h          |  37 +++++++
 drivers/event/dpaa2/dpaa2_hw_dpcon.c               |   1 +
 drivers/mempool/dpaa2/dpaa2_hw_mempool.h           |   2 +
 drivers/net/dpaa2/Makefile                         |   1 +
 drivers/net/dpaa2/dpaa2_ethdev.c                   |   7 ++
 drivers/net/dpaa2/dpaa2_ethdev.h                   |   5 +
 drivers/net/dpaa2/dpaa2_rxtx.c                     |  45 ++++++++-
 16 files changed, 199 insertions(+), 70 deletions(-)
 create mode 100644 drivers/event/dpaa2/dpaa2_eventdev_logs.h

-- 
1.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 1/6] event/dpaa2: replace static with dynamic logging
  2018-01-04 16:06 [dpdk-dev] [PATCH 0/6] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta
@ 2018-01-04 16:06 ` Nipun Gupta
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 2/6] bus/fslmc: introduce API to consume dqrr using index Nipun Gupta
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Nipun Gupta @ 2018-01-04 16:06 UTC (permalink / raw)
  To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/event/dpaa2/dpaa2_eventdev.c      | 83 ++++++++++++++++---------------
 drivers/event/dpaa2/dpaa2_eventdev.h      | 12 -----
 drivers/event/dpaa2/dpaa2_eventdev_logs.h | 37 ++++++++++++++
 drivers/event/dpaa2/dpaa2_hw_dpcon.c      |  1 +
 4 files changed, 82 insertions(+), 51 deletions(-)
 create mode 100644 drivers/event/dpaa2/dpaa2_eventdev_logs.h

diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 49ac46e..c6dc5a2 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -61,6 +61,7 @@
 #include <dpaa2_hw_dpio.h>
 #include <dpaa2_ethdev.h>
 #include "dpaa2_eventdev.h"
+#include "dpaa2_eventdev_logs.h"
 #include <portal/dpaa2_hw_pvt.h>
 #include <mc/fsl_dpci.h>
 
@@ -72,6 +73,9 @@
  * Soft Event Flow is DPCI Instance
  */
 
+/* Dynamic logging identified for mempool */
+int dpaa2_logtype_event;
+
 static uint16_t
 dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[],
 			     uint16_t nb_events)
@@ -94,7 +98,7 @@
 	if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
 		ret = dpaa2_affine_qbman_swp();
 		if (ret) {
-			PMD_DRV_LOG(ERR, "Failure in affining portal\n");
+			DPAA2_EVENTDEV_ERR("Failure in affining portal\n");
 			return 0;
 		}
 	}
@@ -144,7 +148,7 @@
 				if (!loop)
 					return num_tx;
 				frames_to_send = loop;
-				PMD_DRV_LOG(ERR, "Unable to allocate memory");
+				DPAA2_EVENTDEV_ERR("Unable to allocate memory");
 				goto send_partial;
 			}
 			rte_memcpy(ev_temp, event, sizeof(struct rte_event));
@@ -189,9 +193,9 @@ static void dpaa2_eventdev_dequeue_wait(uint64_t timeout_ticks)
 		 * case to avoid the problem.
 		 */
 		if (errno == EINTR) {
-			PMD_DRV_LOG(DEBUG, "epoll_wait fails\n");
+			DPAA2_EVENTDEV_DEBUG("epoll_wait fails\n");
 			if (i++ > 10)
-				PMD_DRV_LOG(DEBUG, "Dequeue burst Failed\n");
+				DPAA2_EVENTDEV_DEBUG("Dequeue burst Failed\n");
 		goto RETRY;
 		}
 	}
@@ -249,7 +253,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 	if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
 		ret = dpaa2_affine_qbman_swp();
 		if (ret) {
-			PMD_DRV_LOG(ERR, "Failure in affining portal\n");
+			DPAA2_EVENTDEV_ERR("Failure in affining portal\n");
 			return 0;
 		}
 	}
@@ -285,7 +289,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 			rxq->cb(swp, fd, dq, rxq, &ev[num_pkts]);
 		} else {
 			qbman_swp_dqrr_consume(swp, dq);
-			PMD_DRV_LOG(ERR, "Null Return VQ received\n");
+			DPAA2_EVENTDEV_ERR("Null Return VQ received\n");
 			return 0;
 		}
 
@@ -308,7 +312,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 {
 	struct dpaa2_eventdev *priv = dev->data->dev_private;
 
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 
@@ -342,7 +346,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 	struct dpaa2_eventdev *priv = dev->data->dev_private;
 	struct rte_event_dev_config *conf = &dev->data->dev_conf;
 
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	priv->dequeue_timeout_ns = conf->dequeue_timeout_ns;
 	priv->nb_event_queues = conf->nb_event_queues;
@@ -352,14 +356,15 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 	priv->nb_event_port_enqueue_depth = conf->nb_event_port_enqueue_depth;
 	priv->event_dev_cfg = conf->event_dev_cfg;
 
-	PMD_DRV_LOG(DEBUG, "Configured eventdev devid=%d", dev->data->dev_id);
+	DPAA2_EVENTDEV_DEBUG("Configured eventdev devid=%d",
+		dev->data->dev_id);
 	return 0;
 }
 
 static int
 dpaa2_eventdev_start(struct rte_eventdev *dev)
 {
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 
@@ -369,7 +374,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 static void
 dpaa2_eventdev_stop(struct rte_eventdev *dev)
 {
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 }
@@ -377,7 +382,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 static int
 dpaa2_eventdev_close(struct rte_eventdev *dev)
 {
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 
@@ -388,7 +393,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 dpaa2_eventdev_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id,
 			      struct rte_event_queue_conf *queue_conf)
 {
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 	RTE_SET_USED(queue_id);
@@ -403,7 +408,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 static void
 dpaa2_eventdev_queue_release(struct rte_eventdev *dev, uint8_t queue_id)
 {
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 	RTE_SET_USED(queue_id);
@@ -417,7 +422,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 	struct evq_info_t *evq_info =
 		&priv->evq_info[queue_id];
 
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	evq_info->event_queue_cfg = queue_conf->event_queue_cfg;
 
@@ -428,7 +433,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 dpaa2_eventdev_port_def_conf(struct rte_eventdev *dev, uint8_t port_id,
 			     struct rte_event_port_conf *port_conf)
 {
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 	RTE_SET_USED(port_id);
@@ -445,7 +450,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 static void
 dpaa2_eventdev_port_release(void *port)
 {
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(port);
 }
@@ -454,7 +459,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 dpaa2_eventdev_port_setup(struct rte_eventdev *dev, uint8_t port_id,
 			  const struct rte_event_port_conf *port_conf)
 {
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(port_conf);
 
@@ -480,7 +485,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 	struct evq_info_t *evq_info;
 	int i;
 
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	for (i = 0; i < nb_unlinks; i++) {
 		evq_info = &priv->evq_info[queues[i]];
@@ -506,7 +511,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 	uint8_t channel_index;
 	int ret, i, n;
 
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	for (i = 0; i < nb_links; i++) {
 		evq_info = &priv->evq_info[queues[i]];
@@ -518,7 +523,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 			CMD_PRI_LOW, dpaa2_portal->dpio_dev->token,
 			evq_info->dpcon->dpcon_id, &channel_index);
 		if (ret < 0) {
-			PMD_DRV_ERR("Static dequeue cfg failed with ret: %d\n",
+			DPAA2_EVENTDEV_ERR("Static dequeue cfg failed with ret: %d\n",
 				    ret);
 			goto err;
 		}
@@ -551,7 +556,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 {
 	uint32_t scale = 1;
 
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 	*timeout_ticks = ns * scale;
@@ -562,7 +567,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 static void
 dpaa2_eventdev_dump(struct rte_eventdev *dev, FILE *f)
 {
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 	RTE_SET_USED(f);
@@ -575,7 +580,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 {
 	const char *ethdev_driver = eth_dev->device->driver->name;
 
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 
@@ -597,13 +602,13 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 	uint16_t dpcon_id = priv->evq_info[ev_qid].dpcon->dpcon_id;
 	int i, ret;
 
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
 		ret = dpaa2_eth_eventq_attach(eth_dev, i,
 				dpcon_id, queue_conf);
 		if (ret) {
-			PMD_DRV_ERR("dpaa2_eth_eventq_attach failed: ret %d\n",
+			DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_attach failed: ret %d\n",
 				    ret);
 			goto fail;
 		}
@@ -627,7 +632,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 	uint16_t dpcon_id = priv->evq_info[ev_qid].dpcon->dpcon_id;
 	int ret;
 
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	if (rx_queue_id == -1)
 		return dpaa2_eventdev_eth_queue_add_all(dev,
@@ -636,7 +641,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 	ret = dpaa2_eth_eventq_attach(eth_dev, rx_queue_id,
 			dpcon_id, queue_conf);
 	if (ret) {
-		PMD_DRV_ERR("dpaa2_eth_eventq_attach failed: ret: %d\n", ret);
+		DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_attach failed: ret: %d\n", ret);
 		return ret;
 	}
 	return 0;
@@ -648,14 +653,14 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 {
 	int i, ret;
 
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 
 	for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
 		ret = dpaa2_eth_eventq_detach(eth_dev, i);
 		if (ret) {
-			PMD_DRV_ERR("dpaa2_eth_eventq_detach failed: ret %d\n",
+			DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_detach failed: ret %d\n",
 				    ret);
 			return ret;
 		}
@@ -671,14 +676,14 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 {
 	int ret;
 
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	if (rx_queue_id == -1)
 		return dpaa2_eventdev_eth_queue_del_all(dev, eth_dev);
 
 	ret = dpaa2_eth_eventq_detach(eth_dev, rx_queue_id);
 	if (ret) {
-		PMD_DRV_ERR("dpaa2_eth_eventq_detach failed: ret: %d\n", ret);
+		DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_detach failed: ret: %d\n", ret);
 		return ret;
 	}
 
@@ -689,7 +694,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 dpaa2_eventdev_eth_start(const struct rte_eventdev *dev,
 			 const struct rte_eth_dev *eth_dev)
 {
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 	RTE_SET_USED(eth_dev);
@@ -701,7 +706,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 dpaa2_eventdev_eth_stop(const struct rte_eventdev *dev,
 			const struct rte_eth_dev *eth_dev)
 {
-	PMD_DRV_FUNC_TRACE();
+	EVENTDEV_INIT_FUNC_TRACE();
 
 	RTE_SET_USED(dev);
 	RTE_SET_USED(eth_dev);
@@ -758,7 +763,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 					dpci_dev->token, i,
 					&rx_queue_cfg);
 		if (ret) {
-			PMD_DRV_LOG(ERR,
+			DPAA2_EVENTDEV_ERR(
 				    "set_rx_q failed with err code: %d", ret);
 			return ret;
 		}
@@ -779,7 +784,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 					   sizeof(struct dpaa2_eventdev),
 					   rte_socket_id());
 	if (eventdev == NULL) {
-		PMD_DRV_ERR("Failed to create eventdev vdev %s", name);
+		DPAA2_EVENTDEV_ERR("Failed to create eventdev vdev %s", name);
 		goto fail;
 	}
 
@@ -813,7 +818,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 
 		ret = dpaa2_eventdev_setup_dpci(dpci_dev, dpcon_dev);
 		if (ret) {
-			PMD_DRV_LOG(ERR,
+			DPAA2_EVENTDEV_ERR(
 				    "dpci setup failed with err code: %d", ret);
 			return ret;
 		}
@@ -831,7 +836,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 	const char *name;
 
 	name = rte_vdev_device_name(vdev);
-	PMD_DRV_LOG(INFO, "Initializing %s", name);
+	DPAA2_EVENTDEV_INFO("Initializing %s", name);
 	return dpaa2_eventdev_create(name);
 }
 
@@ -841,7 +846,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 	const char *name;
 
 	name = rte_vdev_device_name(vdev);
-	PMD_DRV_LOG(INFO, "Closing %s", name);
+	DPAA2_EVENTDEV_INFO("Closing %s", name);
 
 	return rte_event_pmd_vdev_uninit(name);
 }
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h b/drivers/event/dpaa2/dpaa2_eventdev.h
index ae8e07e..274335d 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.h
+++ b/drivers/event/dpaa2/dpaa2_eventdev.h
@@ -41,18 +41,6 @@
 
 #define EVENTDEV_NAME_DPAA2_PMD		event_dpaa2
 
-#ifdef RTE_LIBRTE_PMD_DPAA2_EVENTDEV_DEBUG
-#define PMD_DRV_LOG(level, fmt, args...) \
-	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
-#define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>")
-#else
-#define PMD_DRV_LOG(level, fmt, args...) do { } while (0)
-#define PMD_DRV_FUNC_TRACE() do { } while (0)
-#endif
-
-#define PMD_DRV_ERR(fmt, args...) \
-	RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args)
-
 #define DPAA2_EVENT_DEFAULT_DPCI_PRIO 0
 
 #define DPAA2_EVENT_MAX_QUEUES			16
diff --git a/drivers/event/dpaa2/dpaa2_eventdev_logs.h b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
new file mode 100644
index 0000000..7d250c3
--- /dev/null
+++ b/drivers/event/dpaa2/dpaa2_eventdev_logs.h
@@ -0,0 +1,37 @@
+/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2018 NXP
+ */
+
+#ifndef _DPAA2_EVENTDEV_LOGS_H_
+#define _DPAA2_EVENTDEV_LOGS_H_
+
+extern int dpaa2_logtype_event;
+
+#define DPAA2_EVENTDEV_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, dpaa2_logtype_event, "%s(): " fmt "\n", \
+		__func__, ##args)
+
+#define EVENTDEV_INIT_FUNC_TRACE() DPAA2_EVENTDEV_LOG(DEBUG, " >>")
+
+#define DPAA2_EVENTDEV_DEBUG(fmt, args...) \
+	DPAA2_EVENTDEV_LOG(DEBUG, fmt, ## args)
+#define DPAA2_EVENTDEV_INFO(fmt, args...) \
+	DPAA2_EVENTDEV_LOG(INFO, fmt, ## args)
+#define DPAA2_EVENTDEV_ERR(fmt, args...) \
+	DPAA2_EVENTDEV_LOG(ERR, fmt, ## args)
+#define DPAA2_EVENTDEV_WARN(fmt, args...) \
+	DPAA2_EVENTDEV_LOG(WARNING, fmt, ## args)
+
+/* DP Logs, toggled out at compile time if level lower than current level */
+#define DPAA2_EVENTDEV_DP_LOG(level, fmt, args...) \
+	RTE_LOG_DP(level, PMD, fmt, ## args)
+
+#define DPAA2_EVENTDEV_DP_DEBUG(fmt, args...) \
+	DPAA2_EVENTDEV_DP_LOG(DEBUG, fmt, ## args)
+#define DPAA2_EVENTDEV_DP_INFO(fmt, args...) \
+	DPAA2_EVENTDEV_DP_LOG(INFO, fmt, ## args)
+#define DPAA2_EVENTDEV_DP_WARN(fmt, args...) \
+	DPAA2_EVENTDEV_DP_LOG(WARNING, fmt, ## args)
+
+#endif /* _DPAA2_EVENTDEV_LOGS_H_ */
diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
index 005e623..4e6ca7c 100644
--- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c
+++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
@@ -46,6 +46,7 @@
 #include <rte_dev.h>
 #include <rte_ethdev.h>
 
+#include <fslmc_logs.h>
 #include <rte_fslmc.h>
 #include <mc/fsl_dpcon.h>
 #include <portal/dpaa2_hw_pvt.h>
-- 
1.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 2/6] bus/fslmc: introduce API to consume dqrr using index
  2018-01-04 16:06 [dpdk-dev] [PATCH 0/6] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 1/6] event/dpaa2: replace static with dynamic logging Nipun Gupta
@ 2018-01-04 16:06 ` Nipun Gupta
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 3/6] event/dpaa2: use dqrr index to cosume the DQRR entry Nipun Gupta
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Nipun Gupta @ 2018-01-04 16:06 UTC (permalink / raw)
  To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta

A new API qbman_swp_dqrr_idx_consume is defined which takes
input as DQRR index to consume corresponding DQRR entry.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h | 7 +++++++
 drivers/bus/fslmc/qbman/qbman_portal.c             | 7 +++++++
 drivers/bus/fslmc/rte_bus_fslmc_version.map        | 1 +
 3 files changed, 15 insertions(+)

diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
index 1e65660..efa4861 100644
--- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
+++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
@@ -411,6 +411,13 @@ void qbman_pull_desc_set_channel(struct qbman_pull_desc *d, uint32_t chid,
 void qbman_swp_dqrr_consume(struct qbman_swp *s, const struct qbman_result *dq);
 
 /**
+ * qbman_swp_dqrr_idx_consume() -  Given the DQRR index consume the DQRR entry
+ * @s: the software portal object.
+ * @dqrr_index: the DQRR index entry to be consumed.
+ */
+void qbman_swp_dqrr_idx_consume(struct qbman_swp *s, uint8_t dqrr_index);
+
+/**
  * qbman_get_dqrr_idx() - Get dqrr index from the given dqrr
  * @dqrr: the given dqrr object.
  *
diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c
index 809770c..314a70e 100644
--- a/drivers/bus/fslmc/qbman/qbman_portal.c
+++ b/drivers/bus/fslmc/qbman/qbman_portal.c
@@ -881,6 +881,13 @@ void qbman_swp_dqrr_consume(struct qbman_swp *s,
 	qbman_cinh_write(&s->sys, QBMAN_CINH_SWP_DCAP, QBMAN_IDX_FROM_DQRR(dq));
 }
 
+/* Consume DQRR entries previously returned from qbman_swp_dqrr_next(). */
+void qbman_swp_dqrr_idx_consume(struct qbman_swp *s,
+			    uint8_t dqrr_index)
+{
+	qbman_cinh_write(&s->sys, QBMAN_CINH_SWP_DCAP, dqrr_index);
+}
+
 /*********************************/
 /* Polling user-provided storage */
 /*********************************/
diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map
index 16b759d..b9dd063 100644
--- a/drivers/bus/fslmc/rte_bus_fslmc_version.map
+++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map
@@ -97,6 +97,7 @@ DPDK_18.02 {
 	dpaa2_virt_mode;
 	qbman_fq_query_state;
 	qbman_fq_state_frame_count;
+	qbman_swp_dqrr_idx_consume;
 	rte_fslmc_get_device_count;
 
 } DPDK_17.11;
-- 
1.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 3/6] event/dpaa2: use dqrr index to cosume the DQRR entry
  2018-01-04 16:06 [dpdk-dev] [PATCH 0/6] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 1/6] event/dpaa2: replace static with dynamic logging Nipun Gupta
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 2/6] bus/fslmc: introduce API to consume dqrr using index Nipun Gupta
@ 2018-01-04 16:06 ` Nipun Gupta
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 4/6] event/dpaa2: have separate structure to hold dqrr entries Nipun Gupta
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Nipun Gupta @ 2018-01-04 16:06 UTC (permalink / raw)
  To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/event/dpaa2/dpaa2_eventdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index c6dc5a2..23727f0 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -263,8 +263,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 	/* Check if there are atomic contexts to be released */
 	while (DPAA2_PER_LCORE_DPIO->dqrr_size) {
 		if (DPAA2_PER_LCORE_DPIO->dqrr_held & (1 << i)) {
-			dq = qbman_get_dqrr_from_idx(swp, i);
-			qbman_swp_dqrr_consume(swp, dq);
+			qbman_swp_dqrr_idx_consume(swp, i);
 			DPAA2_PER_LCORE_DPIO->dqrr_size--;
 		}
 		i++;
-- 
1.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 4/6] event/dpaa2: have separate structure to hold dqrr entries
  2018-01-04 16:06 [dpdk-dev] [PATCH 0/6] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta
                   ` (2 preceding siblings ...)
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 3/6] event/dpaa2: use dqrr index to cosume the DQRR entry Nipun Gupta
@ 2018-01-04 16:06 ` Nipun Gupta
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 5/6] bus/dpaa2: add flag to configure DCA in QBMAN multi Tx Nipun Gupta
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Nipun Gupta @ 2018-01-04 16:06 UTC (permalink / raw)
  To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta

This patch provides cleaner approach to store the DQRR entries,
which are yet to be consumed in case of atomic queues.

Also, this patch changes the storage of the DQRR entry index
into the mbuf->seqn instead of ev->opaque

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/fslmc/fslmc_bus.c               |  2 ++
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h     |  2 --
 drivers/bus/fslmc/rte_bus_fslmc_version.map |  1 +
 drivers/bus/fslmc/rte_fslmc.h               | 15 +++++++++++++++
 drivers/event/dpaa2/dpaa2_eventdev.c        | 25 +++++++++++++------------
 drivers/mempool/dpaa2/dpaa2_hw_mempool.h    |  2 ++
 6 files changed, 33 insertions(+), 14 deletions(-)

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 39478f7..1860ba9 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -53,6 +53,8 @@
 struct rte_fslmc_bus rte_fslmc_bus;
 uint8_t dpaa2_virt_mode;
 
+RTE_DEFINE_PER_LCORE(struct dpaa2_portal_dqrr, held_bufs);
+
 uint32_t
 rte_fslmc_get_device_count(enum rte_dpaa2_dev_type device_type)
 {
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index fd9e656..343e2f9 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -105,8 +105,6 @@ struct dpaa2_dpio_dev {
 	struct rte_intr_handle intr_handle; /* Interrupt related info */
 	int32_t	epoll_fd; /**< File descriptor created for interrupt polling */
 	int32_t hw_id; /**< An unique ID of this DPIO device instance */
-	uint64_t dqrr_held;
-	uint8_t dqrr_size;
 };
 
 struct dpaa2_dpbp_dev {
diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map
index b9dd063..ac4849e 100644
--- a/drivers/bus/fslmc/rte_bus_fslmc_version.map
+++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map
@@ -95,6 +95,7 @@ DPDK_18.02 {
 
 	dpaa2_svr_family;
 	dpaa2_virt_mode;
+	per_lcore_held_bufs;
 	qbman_fq_query_state;
 	qbman_fq_state_frame_count;
 	qbman_swp_dqrr_idx_consume;
diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h
index e6314b5..07781b9 100644
--- a/drivers/bus/fslmc/rte_fslmc.h
+++ b/drivers/bus/fslmc/rte_fslmc.h
@@ -155,6 +155,21 @@ struct rte_fslmc_bus {
 				/**< Count of all devices scanned */
 };
 
+#define DPAA2_PORTAL_DEQUEUE_DEPTH	32
+
+/* Create storage for dqrr entries per lcore */
+struct dpaa2_portal_dqrr {
+	struct rte_mbuf *mbuf[DPAA2_PORTAL_DEQUEUE_DEPTH];
+	uint64_t dqrr_held;
+	uint8_t dqrr_size;
+};
+
+RTE_DECLARE_PER_LCORE(struct dpaa2_portal_dqrr, held_bufs);
+
+#define DPAA2_PER_LCORE_DQRR_SIZE       RTE_PER_LCORE(held_bufs).dqrr_size
+#define DPAA2_PER_LCORE_DQRR_HELD       RTE_PER_LCORE(held_bufs).dqrr_held
+#define DPAA2_PER_LCORE_DQRR_MBUF(i)    RTE_PER_LCORE(held_bufs).mbuf[i]
+
 /**
  * Register a DPAA2 driver.
  *
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 23727f0..3b82f02 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -125,13 +125,13 @@
 			qbman_eq_desc_set_no_orp(&eqdesc[loop], 0);
 			qbman_eq_desc_set_response(&eqdesc[loop], 0, 0);
 
-			if (event->impl_opaque) {
-				uint8_t dqrr_index = event->impl_opaque - 1;
+			if (event->mbuf->seqn) {
+				uint8_t dqrr_index = event->mbuf->seqn - 1;
 
 				qbman_eq_desc_set_dca(&eqdesc[loop], 1,
 						      dqrr_index, 0);
-				DPAA2_PER_LCORE_DPIO->dqrr_size--;
-				DPAA2_PER_LCORE_DPIO->dqrr_held &=
+				DPAA2_PER_LCORE_DQRR_SIZE--;
+				DPAA2_PER_LCORE_DQRR_HELD &=
 					~(1 << dqrr_index);
 			}
 
@@ -233,9 +233,9 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 
 	rte_memcpy(ev, ev_temp, sizeof(struct rte_event));
 	rte_free(ev_temp);
-	ev->impl_opaque = dqrr_index + 1;
-	DPAA2_PER_LCORE_DPIO->dqrr_size++;
-	DPAA2_PER_LCORE_DPIO->dqrr_held |= 1 << dqrr_index;
+	ev->mbuf->seqn = dqrr_index + 1;
+	DPAA2_PER_LCORE_DQRR_SIZE++;
+	DPAA2_PER_LCORE_DQRR_HELD |= 1 << dqrr_index;
 }
 
 static uint16_t
@@ -257,18 +257,19 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
 			return 0;
 		}
 	}
-
 	swp = DPAA2_PER_LCORE_PORTAL;
 
 	/* Check if there are atomic contexts to be released */
-	while (DPAA2_PER_LCORE_DPIO->dqrr_size) {
-		if (DPAA2_PER_LCORE_DPIO->dqrr_held & (1 << i)) {
+	while (DPAA2_PER_LCORE_DQRR_SIZE) {
+		if (DPAA2_PER_LCORE_DQRR_HELD & (1 << i)) {
 			qbman_swp_dqrr_idx_consume(swp, i);
-			DPAA2_PER_LCORE_DPIO->dqrr_size--;
+			DPAA2_PER_LCORE_DQRR_SIZE--;
+			DPAA2_PER_LCORE_DQRR_MBUF(i)->seqn =
+				DPAA2_INVALID_MBUF_SEQN;
 		}
 		i++;
 	}
-	DPAA2_PER_LCORE_DPIO->dqrr_held = 0;
+	DPAA2_PER_LCORE_DQRR_HELD = 0;
 
 	do {
 		dq = qbman_swp_dqrr_next(swp);
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
index 0971929..e37dc10 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h
@@ -36,6 +36,8 @@
 
 #define DPAA2_MAX_BUF_POOLS	8
 
+#define DPAA2_INVALID_MBUF_SEQN	0
+
 struct buf_pool_cfg {
 	void *addr;
 	/**< The address from where DPAA2 will carve out the buffers */
-- 
1.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 5/6] bus/dpaa2: add flag to configure DCA in QBMAN multi Tx
  2018-01-04 16:06 [dpdk-dev] [PATCH 0/6] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta
                   ` (3 preceding siblings ...)
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 4/6] event/dpaa2: have separate structure to hold dqrr entries Nipun Gupta
@ 2018-01-04 16:06 ` Nipun Gupta
  2018-01-04  9:56   ` Nipun Gupta
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 5/6] bus/fslmc: " Nipun Gupta
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 6/6] net/dpaa2: support atomic queues Nipun Gupta
  6 siblings, 1 reply; 9+ messages in thread
From: Nipun Gupta @ 2018-01-04 16:06 UTC (permalink / raw)
  To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta

With the current QBMAN multi-tx API, we need to create separate
enqueue descriptors for each of the packet which is required to
be enqueued to the hardware, once we support Atomic Queues
(with DCA) in dpaa2 drivers. Creating enqueue descriptor for
each packet is costly and have significant performance impact.
This patch introduces a flag parameter in the QBMAN multi-tx API,
so that DCA configuration (and later on ORP/ODP for ordered queues)
can be passed using flags and be updated in the EQCR using this flag.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h | 5 +++++
 drivers/bus/fslmc/qbman/qbman_portal.c             | 7 +++++++
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c        | 1 +
 drivers/net/dpaa2/dpaa2_rxtx.c                     | 6 ++++--
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
index efa4861..da0c694 100644
--- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
+++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
@@ -588,6 +588,9 @@ static inline int qbman_result_is_SCN(const struct qbman_result *dq)
 /* volatile dequeue command is expired */
 #define QBMAN_DQ_STAT_EXPIRED       0x01
 
+#define QBMAN_EQCR_DCA_IDXMASK		0x0f
+#define QBMAN_ENQUEUE_FLAG_DCA		(1ULL << 31)
+
 /**
  * qbman_result_DQ_flags() - Get the STAT field of dequeue response
  * @dq: the dequeue result.
@@ -971,6 +974,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d,
  * @s: the software portal used for enqueue.
  * @d: the enqueue descriptor.
  * @fd: the frame descriptor to be enqueued.
+ * @flags: bit-mask of QBMAN_ENQUEUE_FLAG_*** options
  * @num_frames: the number of the frames to be enqueued.
  *
  * Return the number of enqueued frames, -EBUSY if the EQCR is not ready.
@@ -978,6 +982,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d,
 int qbman_swp_enqueue_multiple(struct qbman_swp *s,
 			       const struct qbman_eq_desc *d,
 			       const struct qbman_fd *fd,
+			       uint32_t *flags,
 			       int num_frames);
 /**
  * qbman_swp_enqueue_multiple_desc() - Enqueue multiple frames with
diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c
index 314a70e..d3023d9 100644
--- a/drivers/bus/fslmc/qbman/qbman_portal.c
+++ b/drivers/bus/fslmc/qbman/qbman_portal.c
@@ -518,6 +518,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d,
 int qbman_swp_enqueue_multiple(struct qbman_swp *s,
 			       const struct qbman_eq_desc *d,
 			       const struct qbman_fd *fd,
+			       uint32_t *flags,
 			       int num_frames)
 {
 	uint32_t *p;
@@ -560,6 +561,12 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s,
 		p = qbman_cena_write_start_wo_shadow(&s->sys,
 					QBMAN_CENA_SWP_EQCR(eqcr_pi & 7));
 		p[0] = cl[0] | s->eqcr.pi_vb;
+		if (flags && (flags[i] & QBMAN_ENQUEUE_FLAG_DCA)) {
+			struct qbman_eq_desc *d = (struct qbman_eq_desc *)p;
+
+			d->eq.dca = (1 << QB_ENQUEUE_CMD_DCA_EN_SHIFT) |
+				((flags[i]) & QBMAN_EQCR_DCA_IDXMASK);
+		}
 		eqcr_pi++;
 		eqcr_pi &= 0xF;
 		if (!(eqcr_pi & 7))
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 5e52390..32e19b7 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -699,6 +699,7 @@
 		while (loop < frames_to_send) {
 			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
 							&fd_arr[loop],
+							NULL,
 							frames_to_send - loop);
 		}
 
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 9b66bd3..6c4fddb 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -787,7 +787,8 @@ void __attribute__((hot))
 		loop = 0;
 		while (loop < frames_to_send) {
 			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
-					&fd_arr[loop], frames_to_send - loop);
+					&fd_arr[loop], NULL,
+					frames_to_send - loop);
 		}
 
 		num_tx += frames_to_send;
@@ -803,7 +804,8 @@ void __attribute__((hot))
 
 		while (i < loop) {
 			i += qbman_swp_enqueue_multiple(swp, &eqdesc,
-							&fd_arr[i], loop - i);
+							&fd_arr[i], NULL,
+							loop - i);
 		}
 		num_tx += loop;
 	}
-- 
1.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 5/6] bus/fslmc: add flag to configure DCA in QBMAN multi Tx
  2018-01-04 16:06 [dpdk-dev] [PATCH 0/6] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta
                   ` (4 preceding siblings ...)
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 5/6] bus/dpaa2: add flag to configure DCA in QBMAN multi Tx Nipun Gupta
@ 2018-01-04 16:06 ` Nipun Gupta
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 6/6] net/dpaa2: support atomic queues Nipun Gupta
  6 siblings, 0 replies; 9+ messages in thread
From: Nipun Gupta @ 2018-01-04 16:06 UTC (permalink / raw)
  To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta

With the current QBMAN multi-tx API, we need to create separate
enqueue descriptors for each of the packet which is required to
be enqueued to the hardware, once we support Atomic Queues
(with DCA) in dpaa2 drivers. Creating enqueue descriptor for
each packet is costly and have significant performance impact.
This patch introduces a flag parameter in the QBMAN multi-tx API,
so that DCA configuration (and later on ORP/ODP for ordered queues)
can be passed using flags and be updated in the EQCR using this flag.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h | 5 +++++
 drivers/bus/fslmc/qbman/qbman_portal.c             | 7 +++++++
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c        | 1 +
 drivers/net/dpaa2/dpaa2_rxtx.c                     | 6 ++++--
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
index efa4861..da0c694 100644
--- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
+++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h
@@ -588,6 +588,9 @@ static inline int qbman_result_is_SCN(const struct qbman_result *dq)
 /* volatile dequeue command is expired */
 #define QBMAN_DQ_STAT_EXPIRED       0x01
 
+#define QBMAN_EQCR_DCA_IDXMASK		0x0f
+#define QBMAN_ENQUEUE_FLAG_DCA		(1ULL << 31)
+
 /**
  * qbman_result_DQ_flags() - Get the STAT field of dequeue response
  * @dq: the dequeue result.
@@ -971,6 +974,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d,
  * @s: the software portal used for enqueue.
  * @d: the enqueue descriptor.
  * @fd: the frame descriptor to be enqueued.
+ * @flags: bit-mask of QBMAN_ENQUEUE_FLAG_*** options
  * @num_frames: the number of the frames to be enqueued.
  *
  * Return the number of enqueued frames, -EBUSY if the EQCR is not ready.
@@ -978,6 +982,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d,
 int qbman_swp_enqueue_multiple(struct qbman_swp *s,
 			       const struct qbman_eq_desc *d,
 			       const struct qbman_fd *fd,
+			       uint32_t *flags,
 			       int num_frames);
 /**
  * qbman_swp_enqueue_multiple_desc() - Enqueue multiple frames with
diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c
index 314a70e..d3023d9 100644
--- a/drivers/bus/fslmc/qbman/qbman_portal.c
+++ b/drivers/bus/fslmc/qbman/qbman_portal.c
@@ -518,6 +518,7 @@ int qbman_swp_enqueue(struct qbman_swp *s, const struct qbman_eq_desc *d,
 int qbman_swp_enqueue_multiple(struct qbman_swp *s,
 			       const struct qbman_eq_desc *d,
 			       const struct qbman_fd *fd,
+			       uint32_t *flags,
 			       int num_frames)
 {
 	uint32_t *p;
@@ -560,6 +561,12 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s,
 		p = qbman_cena_write_start_wo_shadow(&s->sys,
 					QBMAN_CENA_SWP_EQCR(eqcr_pi & 7));
 		p[0] = cl[0] | s->eqcr.pi_vb;
+		if (flags && (flags[i] & QBMAN_ENQUEUE_FLAG_DCA)) {
+			struct qbman_eq_desc *d = (struct qbman_eq_desc *)p;
+
+			d->eq.dca = (1 << QB_ENQUEUE_CMD_DCA_EN_SHIFT) |
+				((flags[i]) & QBMAN_EQCR_DCA_IDXMASK);
+		}
 		eqcr_pi++;
 		eqcr_pi &= 0xF;
 		if (!(eqcr_pi & 7))
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 5e52390..32e19b7 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -699,6 +699,7 @@
 		while (loop < frames_to_send) {
 			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
 							&fd_arr[loop],
+							NULL,
 							frames_to_send - loop);
 		}
 
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 9b66bd3..6c4fddb 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -787,7 +787,8 @@ void __attribute__((hot))
 		loop = 0;
 		while (loop < frames_to_send) {
 			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
-					&fd_arr[loop], frames_to_send - loop);
+					&fd_arr[loop], NULL,
+					frames_to_send - loop);
 		}
 
 		num_tx += frames_to_send;
@@ -803,7 +804,8 @@ void __attribute__((hot))
 
 		while (i < loop) {
 			i += qbman_swp_enqueue_multiple(swp, &eqdesc,
-							&fd_arr[i], loop - i);
+							&fd_arr[i], NULL,
+							loop - i);
 		}
 		num_tx += loop;
 	}
-- 
1.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 6/6] net/dpaa2: support atomic queues
  2018-01-04 16:06 [dpdk-dev] [PATCH 0/6] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta
                   ` (5 preceding siblings ...)
  2018-01-04 16:06 ` [dpdk-dev] [PATCH 5/6] bus/fslmc: " Nipun Gupta
@ 2018-01-04 16:06 ` Nipun Gupta
  6 siblings, 0 replies; 9+ messages in thread
From: Nipun Gupta @ 2018-01-04 16:06 UTC (permalink / raw)
  To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/net/dpaa2/Makefile       |  1 +
 drivers/net/dpaa2/dpaa2_ethdev.c |  7 +++++++
 drivers/net/dpaa2/dpaa2_ethdev.h |  5 +++++
 drivers/net/dpaa2/dpaa2_rxtx.c   | 43 +++++++++++++++++++++++++++++++++++++---
 4 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile
index ee9b2cc..fdff976 100644
--- a/drivers/net/dpaa2/Makefile
+++ b/drivers/net/dpaa2/Makefile
@@ -51,6 +51,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include
 CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc
 CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/portal
 CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa2
+CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa2
 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal
 
 # versioning export map
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 894c60e..858e844 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -1696,6 +1696,8 @@ int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev,
 
 	if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_PARALLEL)
 		dpaa2_ethq->cb = dpaa2_dev_process_parallel_event;
+	else if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_ATOMIC)
+		dpaa2_ethq->cb = dpaa2_dev_process_atomic_event;
 	else
 		return -EINVAL;
 
@@ -1705,6 +1707,11 @@ int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev,
 	cfg.destination.id = dpcon_id;
 	cfg.destination.priority = queue_conf->ev.priority;
 
+	if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_ATOMIC) {
+		options |= DPNI_QUEUE_OPT_HOLD_ACTIVE;
+		cfg.destination.hold_active = 1;
+	}
+
 	options |= DPNI_QUEUE_OPT_USER_CTX;
 	cfg.user_context = (uint64_t)(dpaa2_ethq);
 
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h
index 9a9496f..6546f22 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.h
+++ b/drivers/net/dpaa2/dpaa2_ethdev.h
@@ -144,6 +144,11 @@ void dpaa2_dev_process_parallel_event(struct qbman_swp *swp,
 				      const struct qbman_result *dq,
 				      struct dpaa2_queue *rxq,
 				      struct rte_event *ev);
+void dpaa2_dev_process_atomic_event(struct qbman_swp *swp,
+				    const struct qbman_fd *fd,
+				    const struct qbman_result *dq,
+				    struct dpaa2_queue *rxq,
+				    struct rte_event *ev);
 uint16_t dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts);
 uint16_t dummy_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts);
 #endif /* _DPAA2_ETHDEV_H */
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 6c4fddb..7ea262b 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -41,11 +41,13 @@
 #include <rte_string_fns.h>
 #include <rte_dev.h>
 
+#include <rte_fslmc.h>
 #include <fslmc_logs.h>
 #include <fslmc_vfio.h>
 #include <dpaa2_hw_pvt.h>
 #include <dpaa2_hw_dpio.h>
 #include <dpaa2_hw_mempool.h>
+#include <dpaa2_eventdev.h>
 
 #include "dpaa2_ethdev.h"
 #include "base/dpaa2_hw_dpni_annot.h"
@@ -667,6 +669,30 @@ void __attribute__((hot))
 	qbman_swp_dqrr_consume(swp, dq);
 }
 
+void dpaa2_dev_process_atomic_event(struct qbman_swp *swp __attribute__((unused)),
+				    const struct qbman_fd *fd,
+				    const struct qbman_result *dq,
+				    struct dpaa2_queue *rxq,
+				    struct rte_event *ev)
+{
+	uint8_t dqrr_index = qbman_get_dqrr_idx(dq);
+
+	ev->mbuf = eth_fd_to_mbuf(fd);
+
+	ev->flow_id = rxq->ev.flow_id;
+	ev->sub_event_type = rxq->ev.sub_event_type;
+	ev->event_type = RTE_EVENT_TYPE_ETHDEV;
+	ev->op = RTE_EVENT_OP_NEW;
+	ev->sched_type = rxq->ev.sched_type;
+	ev->queue_id = rxq->ev.queue_id;
+	ev->priority = rxq->ev.priority;
+
+	ev->mbuf->seqn = dqrr_index + 1;
+	DPAA2_PER_LCORE_DQRR_SIZE++;
+	DPAA2_PER_LCORE_DQRR_HELD |= 1 << dqrr_index;
+	DPAA2_PER_LCORE_DQRR_MBUF(dqrr_index) = ev->mbuf;
+}
+
 /*
  * Callback to handle sending packets through WRIOP based interface
  */
@@ -687,6 +713,7 @@ void __attribute__((hot))
 	uint16_t bpid;
 	struct rte_eth_dev *dev = dpaa2_q->dev;
 	struct dpaa2_dev_priv *priv = dev->data->dev_private;
+	uint32_t flags[MAX_TX_RING_SLOTS] = {0};
 
 	if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
 		ret = dpaa2_affine_qbman_swp();
@@ -705,7 +732,6 @@ void __attribute__((hot))
 	qbman_eq_desc_set_response(&eqdesc, 0, 0);
 	qbman_eq_desc_set_qd(&eqdesc, priv->qdid,
 			     dpaa2_q->flow_id, dpaa2_q->tc_index);
-
 	/*Clear the unused FD fields before sending*/
 	while (nb_pkts) {
 		/*Check if the queue is congested*/
@@ -720,6 +746,16 @@ void __attribute__((hot))
 		frames_to_send = (nb_pkts >> 3) ? MAX_TX_RING_SLOTS : nb_pkts;
 
 		for (loop = 0; loop < frames_to_send; loop++) {
+			if ((*bufs)->seqn) {
+				uint8_t dqrr_index = (*bufs)->seqn - 1;
+
+				flags[loop] = QBMAN_ENQUEUE_FLAG_DCA |
+						dqrr_index;
+				DPAA2_PER_LCORE_DQRR_SIZE--;
+				DPAA2_PER_LCORE_DQRR_HELD &= ~(1 << dqrr_index);
+				(*bufs)->seqn = DPAA2_INVALID_MBUF_SEQN;
+			}
+
 			fd_arr[loop].simple.frc = 0;
 			DPAA2_RESET_FD_CTRL((&fd_arr[loop]));
 			DPAA2_SET_FD_FLC((&fd_arr[loop]), NULL);
@@ -787,7 +823,7 @@ void __attribute__((hot))
 		loop = 0;
 		while (loop < frames_to_send) {
 			loop += qbman_swp_enqueue_multiple(swp, &eqdesc,
-					&fd_arr[loop], NULL,
+					&fd_arr[loop], &flags[loop],
 					frames_to_send - loop);
 		}
 
@@ -804,7 +840,8 @@ void __attribute__((hot))
 
 		while (i < loop) {
 			i += qbman_swp_enqueue_multiple(swp, &eqdesc,
-							&fd_arr[i], NULL,
+							&fd_arr[i],
+							&flags[loop],
 							loop - i);
 		}
 		num_tx += loop;
-- 
1.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-01-04  9:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-04 16:06 [dpdk-dev] [PATCH 0/6] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta
2018-01-04 16:06 ` [dpdk-dev] [PATCH 1/6] event/dpaa2: replace static with dynamic logging Nipun Gupta
2018-01-04 16:06 ` [dpdk-dev] [PATCH 2/6] bus/fslmc: introduce API to consume dqrr using index Nipun Gupta
2018-01-04 16:06 ` [dpdk-dev] [PATCH 3/6] event/dpaa2: use dqrr index to cosume the DQRR entry Nipun Gupta
2018-01-04 16:06 ` [dpdk-dev] [PATCH 4/6] event/dpaa2: have separate structure to hold dqrr entries Nipun Gupta
2018-01-04 16:06 ` [dpdk-dev] [PATCH 5/6] bus/dpaa2: add flag to configure DCA in QBMAN multi Tx Nipun Gupta
2018-01-04  9:56   ` Nipun Gupta
2018-01-04 16:06 ` [dpdk-dev] [PATCH 5/6] bus/fslmc: " Nipun Gupta
2018-01-04 16:06 ` [dpdk-dev] [PATCH 6/6] net/dpaa2: support atomic queues Nipun Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).