DPDK patches and discussions
 help / color / mirror / Atom feed
From: <pbhagavatula@marvell.com>
To: <jerinj@marvell.com>, <jay.jayatheerthan@intel.com>,
	<erik.g.carrillo@intel.com>, <abhinandan.gujjar@intel.com>,
	<timothy.mcdaniel@intel.com>, <hemant.agrawal@nxp.com>,
	<harry.van.haaren@intel.com>, <mattias.ronnblom@ericsson.com>,
	<liang.j.ma@intel.com>
Cc: <dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>
Subject: [dpdk-dev] [PATCH v4 5/8] eventdev: add Tx adapter event vector support
Date: Sat, 20 Mar 2021 02:27:14 +0530
Message-ID: <20210319205718.1436-6-pbhagavatula@marvell.com> (raw)
In-Reply-To: <20210319205718.1436-1-pbhagavatula@marvell.com>

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add event vector support for event eth Tx adapter, the implementation
receives events from the single linked queue and based on
rte_event_vector::union_valid transmits the vector of mbufs to a given
port, queue pair.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 .../rte_event_eth_tx_adapter.c                | 66 ++++++++++++++++---
 lib/librte_eventdev/rte_eventdev.c            |  5 +-
 2 files changed, 60 insertions(+), 11 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.c b/lib/librte_eventdev/rte_event_eth_tx_adapter.c
index 5b4c42dcf..db260bfb6 100644
--- a/lib/librte_eventdev/rte_event_eth_tx_adapter.c
+++ b/lib/librte_eventdev/rte_event_eth_tx_adapter.c
@@ -510,6 +510,47 @@ txa_service_buffer_retry(struct rte_mbuf **pkts, uint16_t unsent,
 	stats->tx_dropped += unsent - sent;
 }
 
+static uint16_t
+txa_process_event_vector(struct txa_service_data *txa,
+			 struct rte_event_vector *vec)
+{
+	struct txa_service_queue_info *tqi;
+	uint16_t port, queue, nb_tx = 0;
+	struct rte_mbuf **mbufs;
+	int i;
+
+	mbufs = (struct rte_mbuf **)vec->mbufs;
+	if (vec->attr_valid) {
+		port = vec->port;
+		queue = vec->queue;
+		tqi = txa_service_queue(txa, port, queue);
+		if (unlikely(tqi == NULL || !tqi->added)) {
+			rte_pktmbuf_free_bulk(mbufs, vec->nb_elem);
+			rte_mempool_put(rte_mempool_from_obj(vec), vec);
+			return 0;
+		}
+		for (i = 0; i < vec->nb_elem; i++) {
+			nb_tx += rte_eth_tx_buffer(port, queue, tqi->tx_buf,
+						   mbufs[i]);
+		}
+	} else {
+		for (i = 0; i < vec->nb_elem; i++) {
+			port = mbufs[i]->port;
+			queue = rte_event_eth_tx_adapter_txq_get(mbufs[i]);
+			tqi = txa_service_queue(txa, port, queue);
+			if (unlikely(tqi == NULL || !tqi->added)) {
+				rte_pktmbuf_free(mbufs[i]);
+				continue;
+			}
+			nb_tx += rte_eth_tx_buffer(port, queue, tqi->tx_buf,
+						   mbufs[i]);
+		}
+	}
+	rte_mempool_put(rte_mempool_from_obj(vec), vec);
+
+	return nb_tx;
+}
+
 static void
 txa_service_tx(struct txa_service_data *txa, struct rte_event *ev,
 	uint32_t n)
@@ -522,22 +563,27 @@ txa_service_tx(struct txa_service_data *txa, struct rte_event *ev,
 
 	nb_tx = 0;
 	for (i = 0; i < n; i++) {
-		struct rte_mbuf *m;
 		uint16_t port;
 		uint16_t queue;
 		struct txa_service_queue_info *tqi;
 
-		m = ev[i].mbuf;
-		port = m->port;
-		queue = rte_event_eth_tx_adapter_txq_get(m);
+		if (!(ev[i].event_type & RTE_EVENT_TYPE_VECTOR)) {
+			struct rte_mbuf *m;
 
-		tqi = txa_service_queue(txa, port, queue);
-		if (unlikely(tqi == NULL || !tqi->added)) {
-			rte_pktmbuf_free(m);
-			continue;
-		}
+			m = ev[i].mbuf;
+			port = m->port;
+			queue = rte_event_eth_tx_adapter_txq_get(m);
 
-		nb_tx += rte_eth_tx_buffer(port, queue, tqi->tx_buf, m);
+			tqi = txa_service_queue(txa, port, queue);
+			if (unlikely(tqi == NULL || !tqi->added)) {
+				rte_pktmbuf_free(m);
+				continue;
+			}
+
+			nb_tx += rte_eth_tx_buffer(port, queue, tqi->tx_buf, m);
+		} else {
+			nb_tx += txa_process_event_vector(txa, ev[i].vec);
+		}
 	}
 
 	stats->tx_packets += nb_tx;
diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index 2e6e367e0..b2e85ce67 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -196,7 +196,10 @@ rte_event_eth_tx_adapter_caps_get(uint8_t dev_id, uint16_t eth_port_id,
 	if (caps == NULL)
 		return -EINVAL;
 
-	*caps = 0;
+	if (dev->dev_ops->eth_tx_adapter_caps_get == NULL)
+		*caps = RTE_EVENT_ETH_TX_ADAPTER_CAP_EVENT_VECTOR;
+	else
+		*caps = 0;
 
 	return dev->dev_ops->eth_tx_adapter_caps_get ?
 			(*dev->dev_ops->eth_tx_adapter_caps_get)(dev,
-- 
2.17.1


  parent reply	other threads:[~2021-03-19 20:58 UTC|newest]

Thread overview: 144+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-20 22:09 [dpdk-dev] [PATCH 0/7] Introduce event vectorization pbhagavatula
2021-02-20 22:09 ` [dpdk-dev] [PATCH 1/7] eventdev: introduce event vector capability pbhagavatula
2021-03-08 16:49   ` Jerin Jacob
2021-02-20 22:09 ` [dpdk-dev] [PATCH 2/7] eventdev: introduce event vector Rx capability pbhagavatula
2021-03-08 17:07   ` Jerin Jacob
2021-02-20 22:09 ` [dpdk-dev] [PATCH 3/7] eventdev: introduce event vector Tx capability pbhagavatula
2021-03-08 17:09   ` Jerin Jacob
2021-02-20 22:09 ` [dpdk-dev] [PATCH 4/7] eventdev: add Rx adapter event vector support pbhagavatula
2021-03-08 17:27   ` Jerin Jacob
2021-03-16 10:41     ` Jayatheerthan, Jay
2021-02-20 22:09 ` [dpdk-dev] [PATCH 5/7] eventdev: add Tx " pbhagavatula
2021-02-20 22:09 ` [dpdk-dev] [PATCH 6/7] app/eventdev: add event vector mode in pipeline test pbhagavatula
2021-02-20 22:09 ` [dpdk-dev] [PATCH 7/7] eventdev: fix ABI breakage due to event vector pbhagavatula
2021-03-08 18:44   ` Jerin Jacob
2021-03-12 14:28     ` David Marchand
2021-03-16  5:54       ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-03-15 10:01     ` [dpdk-dev] " Kinsella, Ray
2021-03-08 16:41 ` [dpdk-dev] [PATCH 0/7] Introduce event vectorization Jerin Jacob
2021-03-16 15:48 ` [dpdk-dev] [PATCH v2 0/8] " pbhagavatula
2021-03-16 15:48   ` [dpdk-dev] [PATCH v2 1/8] eventdev: introduce event vector capability pbhagavatula
2021-03-16 17:48     ` Jerin Jacob
2021-03-16 19:17       ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-03-16 15:48   ` [dpdk-dev] [PATCH v2 2/8] eventdev: introduce event vector Rx capability pbhagavatula
2021-03-16 15:48   ` [dpdk-dev] [PATCH v2 3/8] eventdev: introduce event vector Tx capability pbhagavatula
2021-03-16 15:48   ` [dpdk-dev] [PATCH v2 4/8] eventdev: add Rx adapter event vector support pbhagavatula
2021-03-16 15:48   ` [dpdk-dev] [PATCH v2 5/8] eventdev: add Tx " pbhagavatula
2021-03-16 15:48   ` [dpdk-dev] [PATCH v2 6/8] app/eventdev: add event vector mode in pipeline test pbhagavatula
2021-03-16 15:48   ` [dpdk-dev] [PATCH v2 7/8] doc: announce event Rx adapter config changes pbhagavatula
2021-03-16 15:48   ` [dpdk-dev] [dpdk-dev v21.11] [PATCH v2 8/8] eventdev: simplify Rx adapter event vector config pbhagavatula
2021-03-16 20:01   ` [dpdk-dev] [PATCH v3 0/8] Introduce event vectorization pbhagavatula
2021-03-16 20:01     ` [dpdk-dev] [PATCH v3 1/8] eventdev: introduce event vector capability pbhagavatula
2021-03-18  6:19       ` Jayatheerthan, Jay
2021-03-18  6:23         ` Pavan Nikhilesh Bhagavatula
2021-03-16 20:01     ` [dpdk-dev] [PATCH v3 2/8] eventdev: introduce event vector Rx capability pbhagavatula
2021-03-16 20:01     ` [dpdk-dev] [PATCH v3 3/8] eventdev: introduce event vector Tx capability pbhagavatula
2021-03-16 20:01     ` [dpdk-dev] [PATCH v3 4/8] eventdev: add Rx adapter event vector support pbhagavatula
2021-03-16 20:01     ` [dpdk-dev] [PATCH v3 5/8] eventdev: add Tx " pbhagavatula
2021-03-16 20:01     ` [dpdk-dev] [PATCH v3 6/8] app/eventdev: add event vector mode in pipeline test pbhagavatula
2021-03-16 20:01     ` [dpdk-dev] [PATCH v3 7/8] doc: announce event Rx adapter config changes pbhagavatula
2021-03-16 20:01     ` [dpdk-dev] [dpdk-dev v21.11] [PATCH v3 8/8] eventdev: simplify Rx adapter event vector config pbhagavatula
2021-03-19 20:57     ` [dpdk-dev] [PATCH v4 0/8] Introduce event vectorization pbhagavatula
2021-03-19 20:57       ` [dpdk-dev] [PATCH v4 1/8] eventdev: introduce event vector capability pbhagavatula
2021-03-22  9:06         ` Kinsella, Ray
2021-03-22  9:10           ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-03-23 11:12         ` [dpdk-dev] " Jerin Jacob
2021-03-19 20:57       ` [dpdk-dev] [PATCH v4 2/8] eventdev: introduce event vector Rx capability pbhagavatula
2021-03-22  9:12         ` Kinsella, Ray
2021-03-22 10:07           ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-03-22 11:07             ` Kinsella, Ray
2021-03-23 16:56         ` [dpdk-dev] " Jerin Jacob
2021-03-19 20:57       ` [dpdk-dev] [PATCH v4 3/8] eventdev: introduce event vector Tx capability pbhagavatula
2021-03-19 20:57       ` [dpdk-dev] [PATCH v4 4/8] eventdev: add Rx adapter event vector support pbhagavatula
2021-03-23 18:30         ` Jerin Jacob
2021-03-19 20:57       ` pbhagavatula [this message]
2021-03-19 20:57       ` [dpdk-dev] [PATCH v4 6/8] app/eventdev: add event vector mode in pipeline test pbhagavatula
2021-03-23 18:39         ` Jerin Jacob
2021-03-19 20:57       ` [dpdk-dev] [PATCH v4 7/8] doc: announce event Rx adapter config changes pbhagavatula
2021-03-19 20:57       ` [dpdk-dev] [dpdk-dev v21.11] [PATCH v4 8/8] eventdev: simplify Rx adapter event vector config pbhagavatula
2021-03-23 18:44       ` [dpdk-dev] [PATCH v4 0/8] Introduce event vectorization Jerin Jacob
2021-03-24  5:05       ` [dpdk-dev] [PATCH v5 " pbhagavatula
2021-03-24  5:05         ` [dpdk-dev] [PATCH v5 1/8] eventdev: introduce event vector capability pbhagavatula
2021-03-24  6:48           ` Jayatheerthan, Jay
2021-03-24 18:20             ` Pavan Nikhilesh Bhagavatula
2021-03-24  9:16           ` Kinsella, Ray
2021-03-24  5:05         ` [dpdk-dev] [PATCH v5 2/8] eventdev: introduce event vector Rx capability pbhagavatula
2021-03-24  9:15           ` Kinsella, Ray
2021-03-25  8:15           ` Jayatheerthan, Jay
2021-03-25  9:24             ` Pavan Nikhilesh Bhagavatula
2021-03-25  9:50               ` Jayatheerthan, Jay
2021-03-24  5:05         ` [dpdk-dev] [PATCH v5 3/8] eventdev: introduce event vector Tx capability pbhagavatula
2021-03-25  8:16           ` Jayatheerthan, Jay
2021-03-24  5:05         ` [dpdk-dev] [PATCH v5 4/8] eventdev: add Rx adapter event vector support pbhagavatula
2021-03-25 10:37           ` Jayatheerthan, Jay
2021-03-25 13:14             ` Pavan Nikhilesh Bhagavatula
2021-03-26  6:26               ` Jayatheerthan, Jay
2021-03-26  9:00                 ` Pavan Nikhilesh Bhagavatula
2021-03-24  5:05         ` [dpdk-dev] [PATCH v5 5/8] eventdev: add Tx " pbhagavatula
2021-03-25 11:44           ` Jayatheerthan, Jay
2021-03-24  5:05         ` [dpdk-dev] [PATCH v5 6/8] app/eventdev: add event vector mode in pipeline test pbhagavatula
2021-03-24  5:05         ` [dpdk-dev] [PATCH v5 7/8] doc: announce event Rx adapter config changes pbhagavatula
2021-03-24  9:16           ` Kinsella, Ray
2021-03-24  5:05         ` [dpdk-dev] [dpdk-dev v21.11] [PATCH v5 8/8] eventdev: simplify Rx adapter event vector config pbhagavatula
2021-03-25 12:27           ` Jayatheerthan, Jay
2021-03-25 13:55             ` Pavan Nikhilesh Bhagavatula
2021-03-26  7:09               ` Jayatheerthan, Jay
2021-03-26  9:44                 ` Pavan Nikhilesh Bhagavatula
2021-03-24  5:39         ` [dpdk-dev] [PATCH v5 0/8] Introduce event vectorization Jayatheerthan, Jay
2021-03-24  6:44           ` Pavan Nikhilesh Bhagavatula
2021-03-24  8:10             ` Jayatheerthan, Jay
2021-03-24 19:28         ` [dpdk-dev] [PATCH v6 " pbhagavatula
2021-03-24 19:28           ` [dpdk-dev] [PATCH v6 1/8] eventdev: introduce event vector capability pbhagavatula
2021-03-24 19:28           ` [dpdk-dev] [PATCH v6 2/8] eventdev: introduce event vector Rx capability pbhagavatula
2021-03-24 19:28           ` [dpdk-dev] [PATCH v6 3/8] eventdev: introduce event vector Tx capability pbhagavatula
2021-03-24 19:28           ` [dpdk-dev] [PATCH v6 4/8] eventdev: add Rx adapter event vector support pbhagavatula
2021-03-24 19:28           ` [dpdk-dev] [PATCH v6 5/8] eventdev: add Tx " pbhagavatula
2021-03-24 19:28           ` [dpdk-dev] [PATCH v6 6/8] app/eventdev: add event vector mode in pipeline test pbhagavatula
2021-03-24 19:28           ` [dpdk-dev] [PATCH v6 7/8] doc: announce event Rx adapter config changes pbhagavatula
2021-03-24 19:28           ` [dpdk-dev] [dpdk-dev v21.11] [PATCH v6 8/8] eventdev: simplify Rx adapter event vector config pbhagavatula
2021-03-25 17:10           ` [dpdk-dev] [PATCH v7 0/8] Introduce event vectorization pbhagavatula
2021-03-25 17:10             ` [dpdk-dev] [PATCH v7 1/8] eventdev: introduce event vector capability pbhagavatula
2021-03-25 17:10             ` [dpdk-dev] [PATCH v7 2/8] eventdev: introduce event vector Rx capability pbhagavatula
2021-03-25 17:10             ` [dpdk-dev] [PATCH v7 3/8] eventdev: introduce event vector Tx capability pbhagavatula
2021-03-25 17:10             ` [dpdk-dev] [PATCH v7 4/8] eventdev: add Rx adapter event vector support pbhagavatula
2021-03-25 17:10             ` [dpdk-dev] [PATCH v7 5/8] eventdev: add Tx " pbhagavatula
2021-03-25 17:10             ` [dpdk-dev] [PATCH v7 6/8] app/eventdev: add event vector mode in pipeline test pbhagavatula
2021-03-25 17:10             ` [dpdk-dev] [PATCH v7 7/8] doc: announce event Rx adapter config changes pbhagavatula
2021-03-25 17:10             ` [dpdk-dev] [dpdk-dev v21.11] [PATCH v7 8/8] eventdev: simplify Rx adapter event vector config pbhagavatula
2021-03-26 14:08             ` [dpdk-dev] [PATCH v8 0/8] Introduce event vectorization pbhagavatula
2021-03-26 14:08               ` [dpdk-dev] [PATCH v8 1/8] eventdev: introduce event vector capability pbhagavatula
2021-03-27 12:07                 ` Jayatheerthan, Jay
2021-03-26 14:08               ` [dpdk-dev] [PATCH v8 2/8] eventdev: introduce event vector Rx capability pbhagavatula
2021-03-26 14:08               ` [dpdk-dev] [PATCH v8 3/8] eventdev: introduce event vector Tx capability pbhagavatula
2021-03-26 14:08               ` [dpdk-dev] [PATCH v8 4/8] eventdev: add Rx adapter event vector support pbhagavatula
2021-03-28  8:18                 ` Jerin Jacob
2021-03-29  6:09                   ` Jayatheerthan, Jay
2021-03-26 14:08               ` [dpdk-dev] [PATCH v8 5/8] eventdev: add Tx " pbhagavatula
2021-03-26 14:08               ` [dpdk-dev] [PATCH v8 6/8] app/eventdev: add event vector mode in pipeline test pbhagavatula
2021-03-26 14:08               ` [dpdk-dev] [PATCH v8 7/8] doc: announce event Rx adapter config changes pbhagavatula
2021-03-26 14:43                 ` Jerin Jacob
2021-03-27 12:07                   ` Jayatheerthan, Jay
2021-03-26 14:08               ` [dpdk-dev] [dpdk-dev v21.11] [PATCH v8 8/8] eventdev: simplify Rx adapter event vector config pbhagavatula
2021-03-30  8:22               ` [dpdk-dev] [PATCH v9 0/8] Introduce event vectorization pbhagavatula
2021-03-30  8:22                 ` [dpdk-dev] [PATCH v9 1/8] eventdev: introduce event vector capability pbhagavatula
2021-03-30  8:22                 ` [dpdk-dev] [PATCH v9 2/8] eventdev: introduce event vector Rx capability pbhagavatula
2021-03-30  8:22                 ` [dpdk-dev] [PATCH v9 3/8] eventdev: introduce event vector Tx capability pbhagavatula
2021-03-30  8:22                 ` [dpdk-dev] [PATCH v9 4/8] eventdev: add Rx adapter event vector support pbhagavatula
2021-03-31  6:35                   ` Jayatheerthan, Jay
2021-03-31  6:40                     ` Pavan Nikhilesh Bhagavatula
2021-03-31  6:55                       ` Jayatheerthan, Jay
2021-03-30  8:22                 ` [dpdk-dev] [PATCH v9 5/8] eventdev: add Tx " pbhagavatula
2021-03-30  8:22                 ` [dpdk-dev] [PATCH v9 6/8] app/eventdev: add event vector mode in pipeline test pbhagavatula
2021-03-30  8:22                 ` [dpdk-dev] [PATCH v9 7/8] doc: announce event Rx adapter config changes pbhagavatula
2021-03-30  8:22                 ` [dpdk-dev] [dpdk-dev v21.11] [PATCH v9 8/8] eventdev: simplify Rx adapter event vector config pbhagavatula
2021-03-31  6:55                   ` Jayatheerthan, Jay
2021-03-31  9:29                 ` [dpdk-dev] [PATCH v10 0/8] Introduce event vectorization pbhagavatula
2021-03-31  9:29                   ` [dpdk-dev] [PATCH v10 1/8] eventdev: introduce event vector capability pbhagavatula
2021-03-31  9:29                   ` [dpdk-dev] [PATCH v10 2/8] eventdev: introduce event vector Rx capability pbhagavatula
2021-03-31  9:29                   ` [dpdk-dev] [PATCH v10 3/8] eventdev: introduce event vector Tx capability pbhagavatula
2021-03-31  9:29                   ` [dpdk-dev] [PATCH v10 4/8] eventdev: add Rx adapter event vector support pbhagavatula
2021-03-31  9:29                   ` [dpdk-dev] [PATCH v10 5/8] eventdev: add Tx " pbhagavatula
2021-03-31  9:30                   ` [dpdk-dev] [PATCH v10 6/8] app/eventdev: add event vector mode in pipeline test pbhagavatula
2021-03-31  9:30                   ` [dpdk-dev] [PATCH v10 7/8] doc: announce event Rx adapter config changes pbhagavatula
2021-03-31  9:30                   ` [dpdk-dev] [dpdk-dev v21.11] [PATCH v10 8/8] eventdev: simplify Rx adapter event vector config pbhagavatula
2021-04-03  9:44                   ` [dpdk-dev] [PATCH v10 0/8] Introduce event vectorization Jerin Jacob

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=20210319205718.1436-6-pbhagavatula@marvell.com \
    --to=pbhagavatula@marvell.com \
    --cc=abhinandan.gujjar@intel.com \
    --cc=dev@dpdk.org \
    --cc=erik.g.carrillo@intel.com \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jay.jayatheerthan@intel.com \
    --cc=jerinj@marvell.com \
    --cc=liang.j.ma@intel.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=timothy.mcdaniel@intel.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git