From: Naga Harish K S V <s.v.naga.harish.k@intel.com>
To: jerinj@marvell.com, jay.jayatheerthan@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v4 5/5] test/event: add unit test for Rx adapter
Date: Thu, 30 Sep 2021 03:29:01 -0500 [thread overview]
Message-ID: <20210930082901.293541-5-s.v.naga.harish.k@intel.com> (raw)
In-Reply-To: <20210930082901.293541-1-s.v.naga.harish.k@intel.com>
this patch adds unit tests for checking per rx queue event buffer
feature using rte_event_eth_rx_adapter_queue_add api.
fix segfault in adapter_queue_conf unit test
Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
---
app/test/test_event_eth_rx_adapter.c | 129 ++++++++++++++++++++++++++-
1 file changed, 126 insertions(+), 3 deletions(-)
diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c
index 7c2cf0dd70..5e69971b54 100644
--- a/app/test/test_event_eth_rx_adapter.c
+++ b/app/test/test_event_eth_rx_adapter.c
@@ -387,6 +387,90 @@ adapter_create(void)
return err;
}
+static int
+adapter_create_with_params(void)
+{
+ int err;
+ struct rte_event_dev_info dev_info;
+ struct rte_event_port_conf rx_p_conf;
+ struct rte_event_eth_rx_adapter_params rxa_params;
+
+ memset(&rx_p_conf, 0, sizeof(rx_p_conf));
+
+ err = rte_event_dev_info_get(TEST_DEV_ID, &dev_info);
+ TEST_ASSERT(err == 0, "Expected 0 got %d", err);
+
+ rx_p_conf.new_event_threshold = dev_info.max_num_events;
+ rx_p_conf.dequeue_depth = dev_info.max_event_port_dequeue_depth;
+ rx_p_conf.enqueue_depth = dev_info.max_event_port_enqueue_depth;
+
+ rxa_params.use_queue_event_buf = false;
+ rxa_params.event_buf_size = 0;
+
+ err = rte_event_eth_rx_adapter_create_with_params(TEST_INST_ID,
+ TEST_DEV_ID, &rx_p_conf, &rxa_params);
+ TEST_ASSERT(err == -EINVAL, "Expected -EINVAL got %d", err);
+
+ rxa_params.use_queue_event_buf = true;
+
+ err = rte_event_eth_rx_adapter_create_with_params(TEST_INST_ID,
+ TEST_DEV_ID, &rx_p_conf, &rxa_params);
+ TEST_ASSERT(err == 0, "Expected 0 got %d", err);
+
+ err = rte_event_eth_rx_adapter_create_with_params(TEST_INST_ID,
+ TEST_DEV_ID, &rx_p_conf, &rxa_params);
+ TEST_ASSERT(err == -EEXIST, "Expected -EEXIST got %d", err);
+
+ return TEST_SUCCESS;
+}
+
+static int
+adapter_queue_event_buf_test(void)
+{
+ int err;
+ struct rte_event ev;
+ uint32_t cap;
+
+ struct rte_event_eth_rx_adapter_queue_conf queue_config = {0};
+
+ err = rte_event_eth_rx_adapter_caps_get(TEST_DEV_ID, TEST_ETHDEV_ID,
+ &cap);
+ TEST_ASSERT(err == 0, "Expected 0 got %d", err);
+
+ ev.queue_id = 0;
+ ev.sched_type = RTE_SCHED_TYPE_ATOMIC;
+ ev.priority = 0;
+
+ queue_config.rx_queue_flags = 0;
+ if (cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) {
+ ev.flow_id = 1;
+ queue_config.rx_queue_flags =
+ RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID;
+ }
+ queue_config.ev = ev;
+ queue_config.servicing_weight = 1;
+ queue_config.event_buf_size = 0;
+
+ err = rte_event_eth_rx_adapter_queue_add(TEST_INST_ID,
+ TEST_ETHDEV_ID, 0,
+ &queue_config);
+ TEST_ASSERT(err == -EINVAL, "Expected -EINVAL got %d", err);
+
+ queue_config.event_buf_size = 1024;
+
+ err = rte_event_eth_rx_adapter_queue_add(TEST_INST_ID,
+ TEST_ETHDEV_ID, 0,
+ &queue_config);
+ TEST_ASSERT(err == 0, "Expected 0 got %d", err);
+
+ err = rte_event_eth_rx_adapter_queue_del(TEST_INST_ID,
+ TEST_ETHDEV_ID,
+ 0);
+ TEST_ASSERT(err == 0, "Expected 0 got %d", err);
+
+ return TEST_SUCCESS;
+}
+
static void
adapter_free(void)
{
@@ -795,20 +879,57 @@ static int
adapter_queue_conf(void)
{
int err;
- struct rte_event_eth_rx_adapter_queue_conf queue_conf;
+ struct rte_event ev;
+ uint32_t cap;
+ struct rte_event_eth_rx_adapter_queue_conf queue_config = {0};
+
+ err = rte_event_eth_rx_adapter_caps_get(TEST_DEV_ID, TEST_ETHDEV_ID,
+ &cap);
+ TEST_ASSERT(err == 0, "Expected 0 got %d", err);
+
+ ev.queue_id = 0;
+ ev.sched_type = RTE_SCHED_TYPE_ATOMIC;
+ ev.priority = 0;
+
+ queue_config.rx_queue_flags = 0;
+ if (cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) {
+ ev.flow_id = 1;
+ queue_config.rx_queue_flags =
+ RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID;
+ }
+ queue_config.ev = ev;
+ queue_config.servicing_weight = 1;
+ queue_config.event_buf_size = 1024;
+
+ err = rte_event_eth_rx_adapter_queue_add(TEST_INST_ID,
+ TEST_ETHDEV_ID, 0,
+ &queue_config);
+ TEST_ASSERT(err == -EINVAL, "Expected -EINVAL got %d", err);
+
+ queue_config.event_buf_size = 0;
+
+ err = rte_event_eth_rx_adapter_queue_add(TEST_INST_ID,
+ TEST_ETHDEV_ID, 0,
+ &queue_config);
+ TEST_ASSERT(err == 0, "Expected 0 got %d", err);
err = rte_event_eth_rx_adapter_queue_conf_get(TEST_INST_ID, TEST_DEV_ID,
- 0, &queue_conf);
+ 0, &queue_config);
TEST_ASSERT(err == 0, "Expected 0 got %d", err);
err = rte_event_eth_rx_adapter_queue_conf_get(TEST_INST_ID, TEST_DEV_ID,
- -1, &queue_conf);
+ -1, &queue_config);
TEST_ASSERT(err == -EINVAL, "Expected -EINVAL got %d", err);
err = rte_event_eth_rx_adapter_queue_conf_get(TEST_INST_ID, TEST_DEV_ID,
0, NULL);
TEST_ASSERT(err == -EINVAL, "Expected -EINVAL got %d", err);
+ err = rte_event_eth_rx_adapter_queue_del(TEST_INST_ID,
+ TEST_ETHDEV_ID,
+ 0);
+ TEST_ASSERT(err == 0, "Expected 0 got %d", err);
+
return TEST_SUCCESS;
}
@@ -826,6 +947,8 @@ static struct unit_test_suite event_eth_rx_tests = {
TEST_CASE_ST(adapter_create, adapter_free, adapter_start_stop),
TEST_CASE_ST(adapter_create, adapter_free, adapter_stats),
TEST_CASE_ST(adapter_create, adapter_free, adapter_queue_conf),
+ TEST_CASE_ST(adapter_create_with_params, adapter_free,
+ adapter_queue_event_buf_test),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
--
2.25.1
next prev parent reply other threads:[~2021-09-30 8:29 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-18 13:11 [dpdk-dev] [PATCH v1 1/5] eventdev: rx_adapter: add support to configure event buffer size Naga Harish K S V
2021-09-18 13:11 ` [dpdk-dev] [PATCH v1 2/5] test/event: add unit test for rte_event_eth_rx_adapter_create2 api Naga Harish K S V
2021-09-18 13:11 ` [dpdk-dev] [PATCH v1 3/5] eventdev:rx_adapter:add per queue event buffer configure support Naga Harish K S V
2021-09-20 6:23 ` Jerin Jacob
2021-09-21 13:46 ` Naga Harish K, S V
2021-09-18 13:11 ` [dpdk-dev] [PATCH v1 4/5] eventdev:rx_adapter: implement per queue event buffer Naga Harish K S V
2021-09-18 13:11 ` [dpdk-dev] [PATCH v1 5/5] test/eventdev: add per rx queue event buffer unit Naga Harish K S V
2021-09-20 6:20 ` [dpdk-dev] [PATCH v1 1/5] eventdev: rx_adapter: add support to configure event buffer size Jerin Jacob
2021-09-21 13:45 ` Naga Harish K, S V
2021-09-21 9:21 ` [dpdk-dev] [PATCH v2 1/5] eventdev/rx_adapter: " Naga Harish K S V
2021-09-21 9:21 ` [dpdk-dev] [PATCH v2 2/5] test/event: add unit test for event buffer size config api Naga Harish K S V
2021-09-21 9:21 ` [dpdk-dev] [PATCH v2 3/5] eventdev/rx_adapter:add per queue event buffer configure support Naga Harish K S V
2021-09-21 16:24 ` Jerin Jacob
2021-09-22 15:21 ` Naga Harish K, S V
2021-09-21 20:32 ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-09-22 15:39 ` Naga Harish K, S V
2021-09-21 9:21 ` [dpdk-dev] [PATCH v2 4/5] eventdev/rx_adapter: implement per queue event buffer Naga Harish K S V
2021-09-21 9:21 ` [dpdk-dev] [PATCH v2 5/5] test/eventdev: add per rx queue event buffer unit Naga Harish K S V
2021-09-21 9:45 ` [dpdk-dev] [PATCH v2 1/5] eventdev/rx_adapter: add support to configure event buffer size Naga Harish K S V
2021-09-21 9:45 ` [dpdk-dev] [PATCH v2 2/5] test/event: add unit test for event buffer size config api Naga Harish K S V
2021-09-21 20:28 ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-09-22 15:37 ` Naga Harish K, S V
2021-09-21 9:45 ` [dpdk-dev] [PATCH v2 3/5] eventdev/rx_adapter:add per queue event buffer configure support Naga Harish K S V
2021-09-21 9:45 ` [dpdk-dev] [PATCH v2 4/5] eventdev/rx_adapter: implement per queue event buffer Naga Harish K S V
2021-09-21 20:51 ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-09-22 15:45 ` Naga Harish K, S V
2021-09-21 9:45 ` [dpdk-dev] [PATCH v2 5/5] test/eventdev: add per rx queue event buffer unit Naga Harish K S V
2021-09-21 20:24 ` [dpdk-dev] [EXT] [PATCH v2 1/5] eventdev/rx_adapter: add support to configure event buffer size Pavan Nikhilesh Bhagavatula
2021-09-22 15:36 ` Naga Harish K, S V
2021-09-22 15:13 ` [dpdk-dev] [PATCH v3 1/5] eventdev/rx_adapter: add event buffer size configurability Naga Harish K S V
2021-09-22 15:13 ` [dpdk-dev] [PATCH v3 2/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-09-22 15:13 ` [dpdk-dev] [PATCH v3 3/5] eventdev/rx_adapter: introduce per queue event buffer Naga Harish K S V
2021-09-22 15:13 ` [dpdk-dev] [PATCH v3 4/5] eventdev/rx_adapter: implement " Naga Harish K S V
2021-09-22 15:14 ` [dpdk-dev] [PATCH v3 5/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-09-29 5:16 ` [dpdk-dev] [PATCH v3 1/5] eventdev/rx_adapter: add event buffer size configurability Jerin Jacob
2021-09-30 8:34 ` Jayatheerthan, Jay
2021-09-30 8:28 ` [dpdk-dev] [PATCH v4 " Naga Harish K S V
2021-09-30 8:28 ` [dpdk-dev] [PATCH v4 2/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-09-30 8:28 ` [dpdk-dev] [PATCH v4 3/5] eventdev/rx_adapter: introduce per queue event buffer Naga Harish K S V
2021-09-30 8:29 ` [dpdk-dev] [PATCH v4 4/5] eventdev/rx_adapter: implement " Naga Harish K S V
2021-09-30 8:29 ` Naga Harish K S V [this message]
2021-10-04 5:41 ` [dpdk-dev] [PATCH v5 1/5] eventdev/rx_adapter: add event buffer size configurability Naga Harish K S V
2021-10-04 5:41 ` [dpdk-dev] [PATCH v5 2/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-10-05 7:36 ` Jayatheerthan, Jay
2021-10-04 5:41 ` [dpdk-dev] [PATCH v5 3/5] eventdev/rx_adapter: introduce per queue event buffer Naga Harish K S V
2021-10-05 7:39 ` Jayatheerthan, Jay
2021-10-04 5:41 ` [dpdk-dev] [PATCH v5 4/5] eventdev/rx_adapter: implement " Naga Harish K S V
2021-10-05 7:55 ` Jayatheerthan, Jay
2021-10-05 14:47 ` Naga Harish K, S V
2021-10-05 15:01 ` Jayatheerthan, Jay
2021-10-06 4:06 ` Naga Harish K, S V
2021-10-04 5:41 ` [dpdk-dev] [PATCH v5 5/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-10-05 8:03 ` Jayatheerthan, Jay
2021-10-05 7:19 ` [dpdk-dev] [PATCH v5 1/5] eventdev/rx_adapter: add event buffer size configurability Jayatheerthan, Jay
2021-10-05 14:45 ` Naga Harish K, S V
2021-10-05 14:38 ` [dpdk-dev] [PATCH v6 " Naga Harish K S V
2021-10-05 14:38 ` [dpdk-dev] [PATCH v6 2/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-10-05 14:38 ` [dpdk-dev] [PATCH v6 3/5] eventdev/rx_adapter: introduce per queue event buffer Naga Harish K S V
2021-10-05 14:38 ` [dpdk-dev] [PATCH v6 4/5] eventdev/rx_adapter: implement " Naga Harish K S V
2021-10-05 14:38 ` [dpdk-dev] [PATCH v6 5/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-10-06 4:02 ` [dpdk-dev] [PATCH v7 1/5] eventdev/rx_adapter: add event buffer size configurability Naga Harish K S V
2021-10-06 4:02 ` [dpdk-dev] [PATCH v7 2/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-10-06 4:02 ` [dpdk-dev] [PATCH v7 3/5] eventdev/rx_adapter: introduce per queue event buffer Naga Harish K S V
2021-10-06 4:02 ` [dpdk-dev] [PATCH v7 4/5] eventdev/rx_adapter: implement " Naga Harish K S V
2021-10-06 6:42 ` Jayatheerthan, Jay
2021-10-06 7:53 ` Naga Harish K, S V
2021-10-06 4:02 ` [dpdk-dev] [PATCH v7 5/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-10-06 6:19 ` [dpdk-dev] [PATCH v7 1/5] eventdev/rx_adapter: add event buffer size configurability Jayatheerthan, Jay
2021-10-06 7:47 ` [dpdk-dev] [PATCH v8 " Naga Harish K S V
2021-10-06 7:47 ` [dpdk-dev] [PATCH v8 2/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-10-06 7:47 ` [dpdk-dev] [PATCH v8 3/5] eventdev/rx_adapter: introduce per queue event buffer Naga Harish K S V
2021-10-06 7:47 ` [dpdk-dev] [PATCH v8 4/5] eventdev/rx_adapter: implement " Naga Harish K S V
2021-10-06 7:47 ` [dpdk-dev] [PATCH v8 5/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-10-06 7:55 ` [dpdk-dev] [PATCH v8 1/5] eventdev/rx_adapter: add event buffer size configurability Naga Harish K S V
2021-10-06 7:55 ` [dpdk-dev] [PATCH v8 2/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-10-06 7:55 ` [dpdk-dev] [PATCH v8 3/5] eventdev/rx_adapter: introduce per queue event buffer Naga Harish K S V
2021-10-06 7:55 ` [dpdk-dev] [PATCH v8 4/5] eventdev/rx_adapter: implement " Naga Harish K S V
2021-10-06 9:11 ` Jayatheerthan, Jay
2021-10-06 7:55 ` [dpdk-dev] [PATCH v8 5/5] test/event: add unit test for Rx adapter Naga Harish K S V
2021-10-07 8:52 ` Jerin Jacob
2021-10-07 8:51 ` [dpdk-dev] [PATCH v3 1/5] eventdev/rx_adapter: add event buffer size configurability 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=20210930082901.293541-5-s.v.naga.harish.k@intel.com \
--to=s.v.naga.harish.k@intel.com \
--cc=dev@dpdk.org \
--cc=jay.jayatheerthan@intel.com \
--cc=jerinj@marvell.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).