* [dpdk-dev] [PATCH 0/6 v2] support atomic queues in dpaa2 ethernet with eventdev @ 2018-01-12 21:22 Nipun Gupta 2018-01-12 21:22 ` [dpdk-dev] [PATCH 1/6 v2] event/dpaa2: replace static with dynamic logging Nipun Gupta ` (6 more replies) 0 siblings, 7 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-12 21:22 UTC (permalink / raw) To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta These patches assume that DPAA2 series is already applied [1]. 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 [1] https://dpdk.org/dev/patchwork/patch/31997/ Changes in v2: Rebase on top of net-next branch (because of dependency on DPAA2 series [1]) 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] 17+ messages in thread
* [dpdk-dev] [PATCH 1/6 v2] event/dpaa2: replace static with dynamic logging 2018-01-12 21:22 [dpdk-dev] [PATCH 0/6 v2] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta @ 2018-01-12 21:22 ` Nipun Gupta 2018-01-12 15:29 ` Hemant Agrawal 2018-01-12 21:22 ` [dpdk-dev] [PATCH 2/6 v2] bus/fslmc: introduce API to consume dqrr using index Nipun Gupta ` (5 subsequent siblings) 6 siblings, 1 reply; 17+ messages in thread From: Nipun Gupta @ 2018-01-12 21:22 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 ba7e514..83b572f 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -35,6 +35,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> @@ -46,6 +47,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) @@ -68,7 +72,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; } } @@ -118,7 +122,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)); @@ -163,9 +167,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; } } @@ -223,7 +227,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; } } @@ -259,7 +263,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; } @@ -282,7 +286,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); @@ -316,7 +320,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; @@ -326,14 +330,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); @@ -343,7 +348,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); } @@ -351,7 +356,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); @@ -362,7 +367,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); @@ -377,7 +382,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); @@ -391,7 +396,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; @@ -402,7 +407,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); @@ -419,7 +424,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); } @@ -428,7 +433,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); @@ -454,7 +459,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]]; @@ -480,7 +485,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]]; @@ -492,7 +497,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; } @@ -525,7 +530,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; @@ -536,7 +541,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); @@ -549,7 +554,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); @@ -571,13 +576,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; } @@ -601,7 +606,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, @@ -610,7 +615,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; @@ -622,14 +627,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; } @@ -645,14 +650,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; } @@ -663,7 +668,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); @@ -675,7 +680,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); @@ -732,7 +737,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; } @@ -753,7 +758,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; } @@ -787,7 +792,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; } @@ -805,7 +810,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); } @@ -815,7 +820,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 96524fa..91c8f2a 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.h +++ b/drivers/event/dpaa2/dpaa2_eventdev.h @@ -16,18 +16,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 cdb3f86..c949b2d 100644 --- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c +++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c @@ -20,6 +20,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] 17+ messages in thread
* Re: [dpdk-dev] [PATCH 1/6 v2] event/dpaa2: replace static with dynamic logging 2018-01-12 21:22 ` [dpdk-dev] [PATCH 1/6 v2] event/dpaa2: replace static with dynamic logging Nipun Gupta @ 2018-01-12 15:29 ` Hemant Agrawal 2018-01-17 3:50 ` Nipun Gupta 2018-01-18 6:37 ` Jerin Jacob 0 siblings, 2 replies; 17+ messages in thread From: Hemant Agrawal @ 2018-01-12 15:29 UTC (permalink / raw) To: Nipun Gupta, jerin.jacob; +Cc: dev On 1/13/2018 2:52 AM, Nipun Gupta wrote: > 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 > Series-Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com> ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH 1/6 v2] event/dpaa2: replace static with dynamic logging 2018-01-12 15:29 ` Hemant Agrawal @ 2018-01-17 3:50 ` Nipun Gupta 2018-01-18 6:37 ` Jerin Jacob 1 sibling, 0 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-17 3:50 UTC (permalink / raw) To: jerin.jacob; +Cc: dev, Hemant Agrawal Hi Jerin, Please do not apply this version on dpdk-eventdev-next as there is some compilation issue when both the DPAA series for eventdev support and this series are applied (though they are compileable independently). I will fix this and send a new version by today EOD. Thanks, Nipun > -----Original Message----- > From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com] > Sent: Friday, January 12, 2018 20:59 > To: Nipun Gupta <nipun.gupta@nxp.com>; jerin.jacob@caviumnetworks.com > Cc: dev@dpdk.org > Subject: Re: [PATCH 1/6 v2] event/dpaa2: replace static with dynamic logging > > On 1/13/2018 2:52 AM, Nipun Gupta wrote: > > 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 > > > > Series-Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com> ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH 1/6 v2] event/dpaa2: replace static with dynamic logging 2018-01-12 15:29 ` Hemant Agrawal 2018-01-17 3:50 ` Nipun Gupta @ 2018-01-18 6:37 ` Jerin Jacob 1 sibling, 0 replies; 17+ messages in thread From: Jerin Jacob @ 2018-01-18 6:37 UTC (permalink / raw) To: Hemant Agrawal; +Cc: Nipun Gupta, dev -----Original Message----- > Date: Fri, 12 Jan 2018 20:59:05 +0530 > From: Hemant Agrawal <hemant.agrawal@nxp.com> > To: Nipun Gupta <nipun.gupta@nxp.com>, jerin.jacob@caviumnetworks.com > CC: dev@dpdk.org > Subject: Re: [PATCH 1/6 v2] event/dpaa2: replace static with dynamic logging > User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 > Thunderbird/45.8.0 > > On 1/13/2018 2:52 AM, Nipun Gupta wrote: > > 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 > > > > Series-Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com> Applied the v3 series to dpdk-next-eventdev/master. Thanks. > ^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 2/6 v2] bus/fslmc: introduce API to consume dqrr using index 2018-01-12 21:22 [dpdk-dev] [PATCH 0/6 v2] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta 2018-01-12 21:22 ` [dpdk-dev] [PATCH 1/6 v2] event/dpaa2: replace static with dynamic logging Nipun Gupta @ 2018-01-12 21:22 ` Nipun Gupta 2018-01-12 21:22 ` [dpdk-dev] [PATCH 3/6 v2] event/dpaa2: use dqrr index to cosume the DQRR entry Nipun Gupta ` (4 subsequent siblings) 6 siblings, 0 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-12 21:22 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 019deae..10f38ca 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h @@ -389,6 +389,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 b5c8b50..b02dfa2 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -859,6 +859,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 f59fc67..17e0ee4 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -97,5 +97,6 @@ DPDK_18.02 { dpaa2_virt_mode; qbman_fq_query_state; qbman_fq_state_frame_count; + qbman_swp_dqrr_idx_consume; } DPDK_17.11; -- 1.9.1 ^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 3/6 v2] event/dpaa2: use dqrr index to cosume the DQRR entry 2018-01-12 21:22 [dpdk-dev] [PATCH 0/6 v2] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta 2018-01-12 21:22 ` [dpdk-dev] [PATCH 1/6 v2] event/dpaa2: replace static with dynamic logging Nipun Gupta 2018-01-12 21:22 ` [dpdk-dev] [PATCH 2/6 v2] bus/fslmc: introduce API to consume dqrr using index Nipun Gupta @ 2018-01-12 21:22 ` Nipun Gupta 2018-01-12 21:22 ` [dpdk-dev] [PATCH 4/6 v2] event/dpaa2: have separate structure to hold dqrr entries Nipun Gupta ` (3 subsequent siblings) 6 siblings, 0 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-12 21:22 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 83b572f..37e3e1c 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -237,8 +237,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] 17+ messages in thread
* [dpdk-dev] [PATCH 4/6 v2] event/dpaa2: have separate structure to hold dqrr entries 2018-01-12 21:22 [dpdk-dev] [PATCH 0/6 v2] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta ` (2 preceding siblings ...) 2018-01-12 21:22 ` [dpdk-dev] [PATCH 3/6 v2] event/dpaa2: use dqrr index to cosume the DQRR entry Nipun Gupta @ 2018-01-12 21:22 ` Nipun Gupta 2018-01-12 21:23 ` [dpdk-dev] [PATCH 5/6 v2] bus/fslmc: add flag to configure DCA in QBMAN multi Tx Nipun Gupta ` (2 subsequent siblings) 6 siblings, 0 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-12 21:22 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 f0d3a6e..7024c87 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -27,6 +27,8 @@ struct rte_fslmc_bus rte_fslmc_bus; uint8_t dpaa2_virt_mode; +RTE_DEFINE_PER_LCORE(struct dpaa2_portal_dqrr, held_bufs); + static void cleanup_fslmc_device_list(void) { diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 2e79399..46f1e75 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -79,8 +79,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 17e0ee4..5b6b31d 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 1524df8..71145db 100644 --- a/drivers/bus/fslmc/rte_fslmc.h +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -128,6 +128,21 @@ struct rte_fslmc_bus { /**< Optional: Count of devices on bus */ }; +#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 37e3e1c..76c2214 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -99,13 +99,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); } @@ -207,9 +207,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 @@ -231,18 +231,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 3390d67..4d34687 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h @@ -10,6 +10,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] 17+ messages in thread
* [dpdk-dev] [PATCH 5/6 v2] bus/fslmc: add flag to configure DCA in QBMAN multi Tx 2018-01-12 21:22 [dpdk-dev] [PATCH 0/6 v2] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta ` (3 preceding siblings ...) 2018-01-12 21:22 ` [dpdk-dev] [PATCH 4/6 v2] event/dpaa2: have separate structure to hold dqrr entries Nipun Gupta @ 2018-01-12 21:23 ` Nipun Gupta 2018-01-12 21:23 ` [dpdk-dev] [PATCH 6/6 v2] net/dpaa2: support atomic queues Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 0/6 v3] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta 6 siblings, 0 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-12 21:23 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 10f38ca..95d785f 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h @@ -566,6 +566,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. @@ -956,6 +959,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 @@ -963,6 +967,7 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s, * @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. diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index b02dfa2..2d324f7 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -496,6 +496,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; @@ -538,6 +539,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 977c49a..a67d979 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -673,6 +673,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 53466c3..c43e3a1 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -761,7 +761,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; @@ -777,7 +778,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] 17+ messages in thread
* [dpdk-dev] [PATCH 6/6 v2] net/dpaa2: support atomic queues 2018-01-12 21:22 [dpdk-dev] [PATCH 0/6 v2] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta ` (4 preceding siblings ...) 2018-01-12 21:23 ` [dpdk-dev] [PATCH 5/6 v2] bus/fslmc: add flag to configure DCA in QBMAN multi Tx Nipun Gupta @ 2018-01-12 21:23 ` Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 0/6 v3] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta 6 siblings, 0 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-12 21:23 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 068e9d3..5a93a0b 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -25,6 +25,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 821c862..5f24759 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1670,6 +1670,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; @@ -1679,6 +1681,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 8fa1872..ba0856f 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -118,6 +118,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 c43e3a1..e88b034 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -15,11 +15,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" @@ -641,6 +643,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 */ @@ -661,6 +687,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(); @@ -679,7 +706,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*/ @@ -694,6 +720,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); @@ -761,7 +797,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); } @@ -778,7 +814,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] 17+ messages in thread
* [dpdk-dev] [PATCH 0/6 v3] support atomic queues in dpaa2 ethernet with eventdev 2018-01-12 21:22 [dpdk-dev] [PATCH 0/6 v2] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta ` (5 preceding siblings ...) 2018-01-12 21:23 ` [dpdk-dev] [PATCH 6/6 v2] net/dpaa2: support atomic queues Nipun Gupta @ 2018-01-17 11:39 ` Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 1/6 v3] event/dpaa2: replace static with dynamic logging Nipun Gupta ` (5 more replies) 6 siblings, 6 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-17 11:39 UTC (permalink / raw) To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta These patches assume that DPAA2 series is already applied [1]. 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 [1] https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdpdk.org%2Fdev%2Fpatchwork%2Fpatch%2F31997%2F&data=02%7C01%7Cnipun.gupta%40nxp.com%7C9a89aaced3d3451810aa08d559ce435d%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636513664790745808&sdata=IUnkbDAGOJhK%2FYRpqDCJc7oF%2BUxulGmSl4ykD95JtYc%3D&reserved=0 Changes in v2: Rebase on top of net-next branch (because of dependency on DPAA2 series [1]) Changes in v3: Rebased on top of dpdk-net-next Replaced variable held_bufs with dpaa2_held_bufs 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 | 18 ++++ 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, 202 insertions(+), 70 deletions(-) create mode 100644 drivers/event/dpaa2/dpaa2_eventdev_logs.h -- 1.9.1 ^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH 1/6 v3] event/dpaa2: replace static with dynamic logging 2018-01-17 11:39 ` [dpdk-dev] [PATCH 0/6 v3] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta @ 2018-01-17 11:39 ` Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 2/6 v3] bus/fslmc: introduce API to consume dqrr using index Nipun Gupta ` (4 subsequent siblings) 5 siblings, 0 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-17 11:39 UTC (permalink / raw) To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> Acked-by: Hemant Agrawal <hemant.agrawal@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 498d049..542bccc 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -35,6 +35,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> @@ -46,6 +47,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) @@ -68,7 +72,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; } } @@ -118,7 +122,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)); @@ -163,9 +167,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; } } @@ -223,7 +227,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; } } @@ -259,7 +263,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; } @@ -282,7 +286,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); @@ -320,7 +324,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; @@ -330,14 +334,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); @@ -347,7 +352,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); } @@ -355,7 +360,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); @@ -366,7 +371,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); @@ -381,7 +386,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); @@ -395,7 +400,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; @@ -406,7 +411,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); @@ -424,7 +429,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); } @@ -433,7 +438,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); @@ -459,7 +464,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]]; @@ -485,7 +490,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]]; @@ -497,7 +502,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; } @@ -530,7 +535,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; @@ -541,7 +546,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); @@ -554,7 +559,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); @@ -576,13 +581,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; } @@ -606,7 +611,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, @@ -615,7 +620,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; @@ -627,14 +632,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; } @@ -650,14 +655,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; } @@ -668,7 +673,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); @@ -680,7 +685,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); @@ -737,7 +742,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; } @@ -758,7 +763,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; } @@ -792,7 +797,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; } @@ -810,7 +815,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); } @@ -820,7 +825,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 96524fa..91c8f2a 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.h +++ b/drivers/event/dpaa2/dpaa2_eventdev.h @@ -16,18 +16,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 cdb3f86..c949b2d 100644 --- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c +++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c @@ -20,6 +20,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] 17+ messages in thread
* [dpdk-dev] [PATCH 2/6 v3] bus/fslmc: introduce API to consume dqrr using index 2018-01-17 11:39 ` [dpdk-dev] [PATCH 0/6 v3] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 1/6 v3] event/dpaa2: replace static with dynamic logging Nipun Gupta @ 2018-01-17 11:39 ` Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 3/6 v3] event/dpaa2: use dqrr index to cosume the DQRR entry Nipun Gupta ` (3 subsequent siblings) 5 siblings, 0 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-17 11:39 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> Acked-by: Hemant Agrawal <hemant.agrawal@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 019deae..10f38ca 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h @@ -389,6 +389,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 b5c8b50..b02dfa2 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -859,6 +859,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] 17+ messages in thread
* [dpdk-dev] [PATCH 3/6 v3] event/dpaa2: use dqrr index to cosume the DQRR entry 2018-01-17 11:39 ` [dpdk-dev] [PATCH 0/6 v3] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 1/6 v3] event/dpaa2: replace static with dynamic logging Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 2/6 v3] bus/fslmc: introduce API to consume dqrr using index Nipun Gupta @ 2018-01-17 11:39 ` Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 4/6 v3] event/dpaa2: have separate structure to hold dqrr entries Nipun Gupta ` (2 subsequent siblings) 5 siblings, 0 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-17 11:39 UTC (permalink / raw) To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> Acked-by: Hemant Agrawal <hemant.agrawal@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 542bccc..65c2c7a 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -237,8 +237,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] 17+ messages in thread
* [dpdk-dev] [PATCH 4/6 v3] event/dpaa2: have separate structure to hold dqrr entries 2018-01-17 11:39 ` [dpdk-dev] [PATCH 0/6 v3] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta ` (2 preceding siblings ...) 2018-01-17 11:39 ` [dpdk-dev] [PATCH 3/6 v3] event/dpaa2: use dqrr index to cosume the DQRR entry Nipun Gupta @ 2018-01-17 11:39 ` Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 5/6 v3] bus/fslmc: add flag to configure DCA in QBMAN multi Tx Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 6/6 v3] net/dpaa2: support atomic queues Nipun Gupta 5 siblings, 0 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-17 11:39 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> Acked-by: Hemant Agrawal <hemant.agrawal@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 | 18 ++++++++++++++++++ drivers/event/dpaa2/dpaa2_eventdev.c | 25 +++++++++++++------------ drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 ++ 6 files changed, 36 insertions(+), 14 deletions(-) diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index acc275a..8fe08f6 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -35,6 +35,8 @@ return rte_fslmc_bus.device_count[device_type]; } +RTE_DEFINE_PER_LCORE(struct dpaa2_portal_dqrr, dpaa2_held_bufs); + static void cleanup_fslmc_device_list(void) { diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 2e79399..46f1e75 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -79,8 +79,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..09ec05f 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_dpaa2_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 c447b06..69d0fec 100644 --- a/drivers/bus/fslmc/rte_fslmc.h +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -129,6 +129,24 @@ 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, dpaa2_held_bufs); + +#define DPAA2_PER_LCORE_DQRR_SIZE \ + RTE_PER_LCORE(dpaa2_held_bufs).dqrr_size +#define DPAA2_PER_LCORE_DQRR_HELD \ + RTE_PER_LCORE(dpaa2_held_bufs).dqrr_held +#define DPAA2_PER_LCORE_DQRR_MBUF(i) \ + RTE_PER_LCORE(dpaa2_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 65c2c7a..88dd930 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -99,13 +99,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); } @@ -207,9 +207,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 @@ -231,18 +231,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 3390d67..4d34687 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h @@ -10,6 +10,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] 17+ messages in thread
* [dpdk-dev] [PATCH 5/6 v3] bus/fslmc: add flag to configure DCA in QBMAN multi Tx 2018-01-17 11:39 ` [dpdk-dev] [PATCH 0/6 v3] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta ` (3 preceding siblings ...) 2018-01-17 11:39 ` [dpdk-dev] [PATCH 4/6 v3] event/dpaa2: have separate structure to hold dqrr entries Nipun Gupta @ 2018-01-17 11:39 ` Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 6/6 v3] net/dpaa2: support atomic queues Nipun Gupta 5 siblings, 0 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-17 11:39 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> Acked-by: Hemant Agrawal <hemant.agrawal@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 10f38ca..95d785f 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_portal.h @@ -566,6 +566,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. @@ -956,6 +959,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 @@ -963,6 +967,7 @@ int qbman_swp_enqueue_multiple(struct qbman_swp *s, * @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. diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index b02dfa2..2d324f7 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -496,6 +496,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; @@ -538,6 +539,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 977c49a..a67d979 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -673,6 +673,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 53466c3..c43e3a1 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -761,7 +761,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; @@ -777,7 +778,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] 17+ messages in thread
* [dpdk-dev] [PATCH 6/6 v3] net/dpaa2: support atomic queues 2018-01-17 11:39 ` [dpdk-dev] [PATCH 0/6 v3] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta ` (4 preceding siblings ...) 2018-01-17 11:39 ` [dpdk-dev] [PATCH 5/6 v3] bus/fslmc: add flag to configure DCA in QBMAN multi Tx Nipun Gupta @ 2018-01-17 11:39 ` Nipun Gupta 5 siblings, 0 replies; 17+ messages in thread From: Nipun Gupta @ 2018-01-17 11:39 UTC (permalink / raw) To: jerin.jacob; +Cc: dev, hemant.agrawal, Nipun Gupta Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> Acked-by: Hemant Agrawal <hemant.agrawal@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 068e9d3..5a93a0b 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -25,6 +25,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 821c862..5f24759 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1670,6 +1670,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; @@ -1679,6 +1681,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 8fa1872..ba0856f 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -118,6 +118,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 c43e3a1..e88b034 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -15,11 +15,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" @@ -641,6 +643,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 */ @@ -661,6 +687,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(); @@ -679,7 +706,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*/ @@ -694,6 +720,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); @@ -761,7 +797,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); } @@ -778,7 +814,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] 17+ messages in thread
end of thread, other threads:[~2018-01-18 6:37 UTC | newest] Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-01-12 21:22 [dpdk-dev] [PATCH 0/6 v2] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta 2018-01-12 21:22 ` [dpdk-dev] [PATCH 1/6 v2] event/dpaa2: replace static with dynamic logging Nipun Gupta 2018-01-12 15:29 ` Hemant Agrawal 2018-01-17 3:50 ` Nipun Gupta 2018-01-18 6:37 ` Jerin Jacob 2018-01-12 21:22 ` [dpdk-dev] [PATCH 2/6 v2] bus/fslmc: introduce API to consume dqrr using index Nipun Gupta 2018-01-12 21:22 ` [dpdk-dev] [PATCH 3/6 v2] event/dpaa2: use dqrr index to cosume the DQRR entry Nipun Gupta 2018-01-12 21:22 ` [dpdk-dev] [PATCH 4/6 v2] event/dpaa2: have separate structure to hold dqrr entries Nipun Gupta 2018-01-12 21:23 ` [dpdk-dev] [PATCH 5/6 v2] bus/fslmc: add flag to configure DCA in QBMAN multi Tx Nipun Gupta 2018-01-12 21:23 ` [dpdk-dev] [PATCH 6/6 v2] net/dpaa2: support atomic queues Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 0/6 v3] support atomic queues in dpaa2 ethernet with eventdev Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 1/6 v3] event/dpaa2: replace static with dynamic logging Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 2/6 v3] bus/fslmc: introduce API to consume dqrr using index Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 3/6 v3] event/dpaa2: use dqrr index to cosume the DQRR entry Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 4/6 v3] event/dpaa2: have separate structure to hold dqrr entries Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 5/6 v3] bus/fslmc: add flag to configure DCA in QBMAN multi Tx Nipun Gupta 2018-01-17 11:39 ` [dpdk-dev] [PATCH 6/6 v3] 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).