DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Naga Harish K, S V" <s.v.naga.harish.k@intel.com>
To: Shijith Thotton <sthotton@marvell.com>,
	"jerinj@marvell.com" <jerinj@marvell.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"pbhagavatula@marvell.com" <pbhagavatula@marvell.com>
Subject: RE: [PATCH v3 3/3] test/event: unit test to burst add Rx queues to adapter
Date: Sat, 1 Mar 2025 09:29:18 +0000	[thread overview]
Message-ID: <SN7PR11MB7044552A0E652B0E6A5133F2A1CF2@SN7PR11MB7044.namprd11.prod.outlook.com> (raw)
In-Reply-To: <c4e02d3a45f8583ad4f91a5b5d98609612d34b60.1740383918.git.sthotton@marvell.com>



> -----Original Message-----
> From: Shijith Thotton <sthotton@marvell.com>
> Sent: Monday, February 24, 2025 2:12 PM
> To: Naga Harish K, S V <s.v.naga.harish.k@intel.com>; jerinj@marvell.com
> Cc: Shijith Thotton <sthotton@marvell.com>; dev@dpdk.org;
> pbhagavatula@marvell.com
> Subject: [PATCH v3 3/3] test/event: unit test to burst add Rx queues to
> adapter
> 
> Added unit test for adding queues to Rx adapter in bursts using
> rte_event_eth_rx_adapter_queues_add().
> 
> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
> ---
>  app/test/test_event_eth_rx_adapter.c | 86
> ++++++++++++++++++++++++++++
>  1 file changed, 86 insertions(+)
> 
> diff --git a/app/test/test_event_eth_rx_adapter.c
> b/app/test/test_event_eth_rx_adapter.c
> index 0233c87779..92b7ff6d99 100644
> --- a/app/test/test_event_eth_rx_adapter.c
> +++ b/app/test/test_event_eth_rx_adapter.c
> @@ -9,6 +9,7 @@
>  #include <rte_mempool.h>
>  #include <rte_mbuf.h>
>  #include <rte_ethdev.h>
> +#include <rte_malloc.h>
> 
>  #ifdef RTE_EXEC_ENV_WINDOWS
>  static int
> @@ -819,6 +820,89 @@ adapter_queue_add_del(void)
>  	return TEST_SUCCESS;
>  }
> 
> +static int
> +adapter_queues_add_del(void)
> +{
> +	struct rte_event_eth_rx_adapter_queue_conf *queue_conf;
> +	struct rte_event_dev_info event_dev_info;
> +	struct rte_eth_dev_info dev_info;
> +	uint16_t i, max_rx_queues;
> +	int32_t *rx_queue_ids;
> +	struct rte_event ev;
> +	uint32_t cap;
> +	int err;
> +
> +	err = rte_event_eth_rx_adapter_caps_get(TEST_DEV_ID,
> TEST_ETHDEV_ID, &cap);
> +	TEST_ASSERT(err == 0, "Expected 0 got %d", err);
> +
> +	err = rte_eth_dev_info_get(TEST_ETHDEV_ID, &dev_info);
> +	TEST_ASSERT(err == 0, "Expected 0 got %d", err);
> +
> +	max_rx_queues = RTE_MIN(dev_info.max_rx_queues,
> MAX_NUM_RX_QUEUE);
> +
> +	err = rte_event_dev_info_get(TEST_DEV_ID, &event_dev_info);
> +	TEST_ASSERT(err == 0, "Expected 0 got %d", err);
> +
> +	queue_conf = rte_zmalloc(NULL, sizeof(*queue_conf) *
> max_rx_queues, 0);
> +	TEST_ASSERT(queue_conf != NULL, "Failed to allocate memory");
> +
> +	rx_queue_ids = rte_zmalloc(NULL, sizeof(*rx_queue_ids) *
> max_rx_queues, 0);
> +	TEST_ASSERT(rx_queue_ids != NULL, "Failed to allocate memory");
> +
> +	ev.sched_type = RTE_SCHED_TYPE_ATOMIC;
> +	for (i = 0; i < max_rx_queues; i++) {
> +		rx_queue_ids[i] = i;
> +		ev.queue_id = i % event_dev_info.max_event_queues;
> +		if (cap &
> RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID) {
> +			ev.flow_id = 1;
> +			queue_conf[i].rx_queue_flags =
> +
> 	RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID;
> +		}
> +		queue_conf[i].ev = ev;
> +		queue_conf[i].servicing_weight = 1;
> +	}
> +
> +	err = rte_event_eth_rx_adapter_queues_add(TEST_INST_ID,
> +						  rte_eth_dev_count_total(),
> +						  rx_queue_ids, queue_conf,
> 0);
> +	TEST_ASSERT(err == -EINVAL, "Expected -EINVAL got %d", err);
> +
> +	err = rte_event_eth_rx_adapter_queues_add(TEST_INST_ID + 1,
> TEST_ETHDEV_ID,
> +						  NULL, queue_conf, 0);
> +	TEST_ASSERT(err == -EINVAL, "Expected -EINVAL got %d", err);
> +
> +	err = rte_event_eth_rx_adapter_queues_add(TEST_INST_ID,
> TEST_ETHDEV_ID,
> +						  rx_queue_ids, queue_conf,
> 1);
> +	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);
> +
> +	if (cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ) {
> +		err = rte_event_eth_rx_adapter_queues_add(
> +			TEST_INST_ID, TEST_ETHDEV_ID, rx_queue_ids,
> queue_conf,
> +			max_rx_queues);
> +		TEST_ASSERT(err == 0, "Expected 0 got %d", err);
> +
> +		err = rte_event_eth_rx_adapter_queue_del(TEST_INST_ID,
> +							 TEST_ETHDEV_ID, -
> 1);
> +		TEST_ASSERT(err == 0, "Expected 0 got %d", err);
> +	} else {
> +		err = rte_event_eth_rx_adapter_queues_add(
> +			TEST_INST_ID, TEST_ETHDEV_ID, NULL, queue_conf,
> 0);
> +		TEST_ASSERT(err == 0, "Expected 0 got %d", err);
> +
> +		err = rte_event_eth_rx_adapter_queue_del(TEST_INST_ID,
> +							 TEST_ETHDEV_ID, -
> 1);
> +		TEST_ASSERT(err == 0, "Expected 0 got %d", err);
> +	}
> +
> +	rte_free(rx_queue_ids);
> +	rte_free(queue_conf);
> +
> +	return TEST_SUCCESS;
> +}
> +
>  static int
>  adapter_multi_eth_add_del(void)
>  {
> @@ -1423,6 +1507,8 @@ static struct unit_test_suite event_eth_rx_tests = {
>  		TEST_CASE_ST(NULL, NULL,
> adapter_create_free_with_params),
>  		TEST_CASE_ST(adapter_create, adapter_free,
>  					adapter_queue_add_del),
> +		TEST_CASE_ST(adapter_create, adapter_free,
> +					adapter_queues_add_del),
>  		TEST_CASE_ST(adapter_create, adapter_free,
>  					adapter_multi_eth_add_del),
>  		TEST_CASE_ST(adapter_create, adapter_free,
> adapter_start_stop),
> --
> 2.25.1


  reply	other threads:[~2025-03-01  9:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-07 14:09 [PATCH 0/3] Rx adapter API to add Rx queues in burst Shijith Thotton
2025-02-07 14:09 ` [PATCH 1/3] eventdev/eth_rx: add API to burst add queues to Rx adapter Shijith Thotton
2025-02-17 16:15   ` Naga Harish K, S V
2025-02-18  4:52     ` Shijith Thotton
2025-02-07 14:09 ` [PATCH 2/3] event/cnxk: enable PMD op " Shijith Thotton
2025-02-07 14:09 ` [PATCH 3/3] test/event: unit test to burst add Rx queues to adapter Shijith Thotton
2025-02-17 16:17 ` [PATCH 0/3] Rx adapter API to add Rx queues in burst Naga Harish K, S V
2025-02-18  4:44   ` Shijith Thotton
2025-02-18  9:15 ` [PATCH v2 " Shijith Thotton
2025-02-24  8:42   ` [PATCH v3 " Shijith Thotton
2025-02-24  8:42     ` [PATCH v3 1/3] eventdev/eth_rx: add API to burst add queues to Rx adapter Shijith Thotton
2025-03-01  9:28       ` Naga Harish K, S V
2025-02-24  8:42     ` [PATCH v3 2/3] event/cnxk: enable PMD op " Shijith Thotton
2025-02-24  8:42     ` [PATCH v3 3/3] test/event: unit test to burst add Rx queues to adapter Shijith Thotton
2025-03-01  9:29       ` Naga Harish K, S V [this message]
2025-02-18  9:15 ` [PATCH v2 1/3] eventdev/eth_rx: add API to burst add queues to Rx adapter Shijith Thotton
2025-02-20  4:59   ` Naga Harish K, S V
2025-02-20  6:28     ` Shijith Thotton
2025-02-18  9:15 ` [PATCH v2 2/3] event/cnxk: enable PMD op " Shijith Thotton
2025-02-18  9:15 ` [PATCH v2 3/3] test/event: unit test to burst add Rx queues to adapter Shijith Thotton

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=SN7PR11MB7044552A0E652B0E6A5133F2A1CF2@SN7PR11MB7044.namprd11.prod.outlook.com \
    --to=s.v.naga.harish.k@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=pbhagavatula@marvell.com \
    --cc=sthotton@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).