DPDK patches and discussions
 help / color / mirror / Atom feed
From: <pbhagavatula@marvell.com>
To: <jerinj@marvell.com>, Jay Jayatheerthan <jay.jayatheerthan@intel.com>
Cc: <dev@dpdk.org>, <erik.g.carrillo@intel.com>,
	<abhinandan.gujjar@intel.com>, <timothy.mcdaniel@intel.com>,
	<sthotton@marvell.com>, <hemant.agrawal@nxp.com>,
	<nipun.gupta@nxp.com>, <harry.van.haaren@intel.com>,
	<mattias.ronnblom@ericsson.com>, <liangma@liangbit.com>,
	<peter.mccarthy@intel.com>,
	Pavan Nikhilesh <pbhagavatula@marvell.com>
Subject: [PATCH 1/3] eventdev: add element offset to event vector
Date: Tue, 16 Aug 2022 21:19:30 +0530	[thread overview]
Message-ID: <20220816154932.10168-1-pbhagavatula@marvell.com> (raw)

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add ``elem_offset:12`` bit field event vector structure
the bits are taken from ``rsvd:15``.
The element offset defines the offset into the vector array
at which valid elements start.
The valid elements count will be equal to nb_elem - elem_offset.

Update Rx/Tx adapter SW implementation to use elem_offset.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 lib/eventdev/rte_event_eth_rx_adapter.c | 1 +
 lib/eventdev/rte_event_eth_tx_adapter.c | 7 ++++---
 lib/eventdev/rte_eventdev.h             | 8 ++++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
index bf8741d2ea..bd72f9b845 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -855,6 +855,7 @@ rxa_init_vector(struct event_eth_rx_adapter *rx_adapter,
 	vec->vector_ev->port = vec->port;
 	vec->vector_ev->queue = vec->queue;
 	vec->vector_ev->attr_valid = true;
+	vec->vector_ev->elem_offset = 0;
 	TAILQ_INSERT_TAIL(&rx_adapter->vector_list, vec, next);
 }

diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c
index b4b37f1cae..da70883e0d 100644
--- a/lib/eventdev/rte_event_eth_tx_adapter.c
+++ b/lib/eventdev/rte_event_eth_tx_adapter.c
@@ -524,16 +524,17 @@ txa_process_event_vector(struct txa_service_data *txa,
 		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_pktmbuf_free_bulk(&mbufs[vec->elem_offset],
+					      vec->nb_elem - vec->elem_offset);
 			rte_mempool_put(rte_mempool_from_obj(vec), vec);
 			return 0;
 		}
-		for (i = 0; i < vec->nb_elem; i++) {
+		for (i = vec->elem_offset; 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++) {
+		for (i = vec->elem_offset; 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);
diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index 6a6f6ea4c1..b0698fe748 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -1060,8 +1060,12 @@ rte_event_dev_close(uint8_t dev_id);
  */
 struct rte_event_vector {
 	uint16_t nb_elem;
-	/**< Number of elements in this event vector. */
-	uint16_t rsvd : 15;
+	/**< Total number of elements in this event vector. */
+	uint16_t elem_offset : 12;
+	/**< Offset into the vector array where valid elements start from.
+	 * The valid elements count would be nb_elem - elem_offset.
+	 */
+	uint16_t rsvd : 3;
 	/**< Reserved for future use */
 	uint16_t attr_valid : 1;
 	/**< Indicates that the below union attributes have valid information.
--
2.25.1


             reply	other threads:[~2022-08-16 15:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 15:49 pbhagavatula [this message]
2022-08-16 15:49 ` [PATCH 2/3] examples: update event vector free routine pbhagavatula
2022-08-16 15:49 ` [PATCH 3/3] event/cnxk: update event vector Tx routine pbhagavatula
2022-08-18 16:28 ` [PATCH 1/3] eventdev: add element offset to event vector Mattias Rönnblom
2022-08-23 20:39   ` [EXT] " Pavan Nikhilesh Bhagavatula
2022-08-24  8:41     ` Mattias Rönnblom
2022-08-29  8:47       ` Pavan Nikhilesh Bhagavatula
2022-09-14 13:02         ` Jerin Jacob
2022-09-14 14:55           ` Mattias Rönnblom
2022-09-21 16:43 ` [PATCH v2 " pbhagavatula
2022-09-21 16:43   ` [PATCH v2 2/3] examples: update event vector free routine pbhagavatula
2022-09-21 16:43   ` [PATCH v2 3/3] event/cnxk: update event vector Tx routine pbhagavatula
2022-09-22  5:40   ` [PATCH v2 1/3] eventdev: add element offset to event vector Mattias Rönnblom
2022-09-27 13:42     ` 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=20220816154932.10168-1-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=liangma@liangbit.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=nipun.gupta@nxp.com \
    --cc=peter.mccarthy@intel.com \
    --cc=sthotton@marvell.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
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).