DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ganapati Kundapura <ganapati.kundapura@intel.com>
To: jay.jayatheerthan@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] eventdev: configure the Rx event buffer size
Date: Fri, 16 Jul 2021 12:02:36 -0500	[thread overview]
Message-ID: <20210716170236.2297967-1-ganapati.kundapura@intel.com> (raw)

As of now Rx event buffer size is static and set to 128.

This patch sets the Rx event buffer size to 192, configurable
at compile time and also errors out at run time if Rx event
buffer size is configured more than 16 bits.

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
---
 config/rte_config.h                     |  1 +
 lib/eventdev/rte_event_eth_rx_adapter.c | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/config/rte_config.h b/config/rte_config.h
index 590903c..3d938c8 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -77,6 +77,7 @@
 #define RTE_EVENT_ETH_INTR_RING_SIZE 1024
 #define RTE_EVENT_CRYPTO_ADAPTER_MAX_INSTANCE 32
 #define RTE_EVENT_ETH_TX_ADAPTER_MAX_INSTANCE 32
+#define RTE_EVENT_ETH_RX_ADAPTER_BUFFER_SIZE 128
 
 /* rawdev defines */
 #define RTE_RAWDEV_MAX_DEVS 64
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
index 13dfb28..0fe265e 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -25,7 +25,12 @@
 
 #define BATCH_SIZE		32
 #define BLOCK_CNT_THRESHOLD	10
-#define ETH_EVENT_BUFFER_SIZE	(4*BATCH_SIZE)
+
+#define ETH_EVENT_BUFFER_SIZE \
+		(RTE_EVENT_ETH_RX_ADAPTER_BUFFER_SIZE + BATCH_SIZE + BATCH_SIZE)
+
+#define MAX_ETH_EVENT_BUFFER_SIZE (USHRT_MAX - BATCH_SIZE - BATCH_SIZE)
+
 #define MAX_VECTOR_SIZE		1024
 #define MIN_VECTOR_SIZE		4
 #define MAX_VECTOR_NS		1E9
@@ -2165,6 +2170,13 @@ rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id,
 		return -EEXIST;
 	}
 
+	if (RTE_DIM(rx_adapter->event_enqueue_buffer.events) > USHRT_MAX) {
+		RTE_EDEV_LOG_ERR("CONFIG_RTE_ADPTR_ETH_EVENT_BUFFER_SIZE is "
+				 "greater than max allowed value %u",
+				 MAX_ETH_EVENT_BUFFER_SIZE);
+		return -EINVAL;
+	}
+
 	socket_id = rte_event_dev_socket_id(dev_id);
 	snprintf(mem_name, ETH_RX_ADAPTER_MEM_NAME_LEN,
 		"rte_event_eth_rx_adapter_%d",
-- 
2.6.4


             reply	other threads:[~2021-07-16 17:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 17:02 Ganapati Kundapura [this message]
2021-07-19  6:43 ` Jerin Jacob
2021-07-19 15:26   ` Kundapura, Ganapati
2021-07-19 16:13     ` 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=20210716170236.2297967-1-ganapati.kundapura@intel.com \
    --to=ganapati.kundapura@intel.com \
    --cc=dev@dpdk.org \
    --cc=jay.jayatheerthan@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).