From: Nipun Gupta <nipun.gupta@nxp.com>
To: <jerin.jacob@caviumnetworks.com>
Cc: <dev@dpdk.org>, <hemant.agrawal@nxp.com>,
Nipun Gupta <nipun.gupta@nxp.com>
Subject: [dpdk-dev] [PATCH 6/6 v3] net/dpaa2: support atomic queues
Date: Wed, 17 Jan 2018 17:09:14 +0530 [thread overview]
Message-ID: <1516189154-28331-7-git-send-email-nipun.gupta@nxp.com> (raw)
In-Reply-To: <1516189154-28331-1-git-send-email-nipun.gupta@nxp.com>
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
prev parent reply other threads:[~2018-01-17 5:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Nipun Gupta [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1516189154-28331-7-git-send-email-nipun.gupta@nxp.com \
--to=nipun.gupta@nxp.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=jerin.jacob@caviumnetworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).