DPDK patches and discussions
 help / color / mirror / Atom feed
From: nipun.gupta@nxp.com
To: dev@dpdk.org, gakhil@marvell.com, nicolas.chautru@intel.com
Cc: david.marchand@redhat.com, hemant.agrawal@nxp.com,
	Nipun Gupta <nipun.gupta@nxp.com>
Subject: [dpdk-dev] [PATCH v6 8/9] app/bbdev: handle endianness of test data
Date: Fri, 24 Sep 2021 10:07:21 +0530
Message-ID: <20210924043722.27980-9-nipun.gupta@nxp.com> (raw)
In-Reply-To: <20210924043722.27980-1-nipun.gupta@nxp.com>

From: Nipun Gupta <nipun.gupta@nxp.com>

With data input, output and harq also supported in big
endian format, this patch updates the testbbdev application
to handle the endianness conversion as directed by the
the driver being used.

If the driver supports big endian data processing, conversion
from little endian to big is handled by the testbbdev application.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 app/test-bbdev/test_bbdev_perf.c | 62 ++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 469597b8b3..a0f565ee3f 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -227,6 +227,64 @@ clear_soft_out_cap(uint32_t *op_flags)
 	*op_flags &= ~RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT;
 }
 
+static inline void
+reverse_op(struct op_data_entries *op)
+{
+	uint8_t nb_segs = op->nb_segments;
+	uint32_t *data, len;
+	int complete, rem, i, j;
+	uint8_t *rem_data, temp;
+
+	/* Validate each mbuf segment length */
+	for (i = 0; i < nb_segs; ++i) {
+		len = op->segments[i].length;
+		data = op->segments[i].addr;
+
+		/* Swap complete u32 bytes */
+		complete = len / 4;
+		for (j = 0; j < complete; j++)
+			data[j] = rte_bswap32(data[j]);
+
+		/* Swap any remaining data for last seg */
+		if (i == (nb_segs - 1)) {
+			rem = len % 4;
+			rem_data = (uint8_t *)&data[j];
+			for (j = 0; j < rem/2; j++) {
+				temp = rem_data[j];
+				rem_data[j] = rem_data[rem - j - 1];
+				rem_data[rem - j - 1] = temp;
+			}
+		}
+	}
+}
+
+static inline void
+reverse_all_ops(void)
+{
+	unsigned int nb_inputs, nb_soft_outputs, nb_hard_outputs,
+		nb_harq_inputs, nb_harq_outputs;
+
+	nb_inputs = test_vector.entries[DATA_INPUT].nb_segments;
+	if (nb_inputs)
+		reverse_op(&test_vector.entries[DATA_INPUT]);
+
+	nb_soft_outputs = test_vector.entries[DATA_SOFT_OUTPUT].nb_segments;
+	if (nb_soft_outputs)
+		reverse_op(&test_vector.entries[DATA_SOFT_OUTPUT]);
+
+	nb_hard_outputs = test_vector.entries[DATA_HARD_OUTPUT].nb_segments;
+	if (nb_hard_outputs)
+		reverse_op(&test_vector.entries[DATA_HARD_OUTPUT]);
+
+	nb_harq_inputs  = test_vector.entries[DATA_HARQ_INPUT].nb_segments;
+	if (nb_harq_inputs)
+		reverse_op(&test_vector.entries[DATA_HARQ_INPUT]);
+
+	nb_harq_outputs = test_vector.entries[DATA_HARQ_OUTPUT].nb_segments;
+	if (nb_harq_outputs)
+		reverse_op(&test_vector.entries[DATA_HARQ_OUTPUT]);
+}
+
 static int
 check_dev_cap(const struct rte_bbdev_info *dev_info)
 {
@@ -234,6 +292,7 @@ check_dev_cap(const struct rte_bbdev_info *dev_info)
 	unsigned int nb_inputs, nb_soft_outputs, nb_hard_outputs,
 		nb_harq_inputs, nb_harq_outputs;
 	const struct rte_bbdev_op_cap *op_cap = dev_info->drv.capabilities;
+	uint8_t be_data = dev_info->drv.support_be_data;
 
 	nb_inputs = test_vector.entries[DATA_INPUT].nb_segments;
 	nb_soft_outputs = test_vector.entries[DATA_SOFT_OUTPUT].nb_segments;
@@ -245,6 +304,9 @@ check_dev_cap(const struct rte_bbdev_info *dev_info)
 		if (op_cap->type != test_vector.op_type)
 			continue;
 
+		if (be_data)
+			reverse_all_ops();
+
 		if (op_cap->type == RTE_BBDEV_OP_TURBO_DEC) {
 			const struct rte_bbdev_op_cap_turbo_dec *cap =
 					&op_cap->cap.turbo_dec;
-- 
2.17.1


  parent reply	other threads:[~2021-09-24  4:39 UTC|newest]

Thread overview: 157+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18  6:34 [dpdk-dev] [PATCH 1/6] baseband: introduce NXP LA12xx driver Hemant Agrawal
2021-03-18  6:34 ` [dpdk-dev] [PATCH 2/6] baseband/la12xx: add devargs for max queues Hemant Agrawal
2021-03-18  6:34 ` [dpdk-dev] [PATCH 3/6] baseband/la12xx: add support for multiple modems Hemant Agrawal
2021-03-18  6:34 ` [dpdk-dev] [PATCH 4/6] baseband/la12xx: add queue and modem config support Hemant Agrawal
2021-03-18  6:34 ` [dpdk-dev] [PATCH 5/6] baseband/la12xx: add enqueue and dequeue support Hemant Agrawal
2021-03-18  6:34 ` [dpdk-dev] [PATCH 6/6] baseband/la12xx: add documentation support Hemant Agrawal
2021-03-18 14:53 ` [dpdk-dev] [PATCH 1/6] baseband: introduce NXP LA12xx driver David Marchand
2021-03-19  5:54   ` Hemant Agrawal
2021-04-08  8:55     ` [dpdk-dev] [EXT] " Akhil Goyal
2021-04-08  8:57       ` Hemant Agrawal
2021-04-08 15:29       ` Chautru, Nicolas
2021-04-10 17:02 ` [dpdk-dev] [PATCH v2 0/8] baseband: add " Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 1/8] baseband: introduce " Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 2/8] baseband/la12xx: add devargs for max queues Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 3/8] baseband/la12xx: add support for multiple modems Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 4/8] baseband/la12xx: add queue and modem config support Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 5/8] baseband/la12xx: add enqueue and dequeue support Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 6/8] baseband/la12xx: add documentation support Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 7/8] app/bbdev: add parameter to take input in network order Hemant Agrawal
2021-04-12  7:22     ` David Marchand
2021-04-12  7:29       ` Hemant Agrawal
2021-04-10 17:02   ` [dpdk-dev] [PATCH v2 8/8] app/bbdev: add test vectors for transport blocks Hemant Agrawal
2021-04-13  5:17   ` [dpdk-dev] [PATCH v3 0/8] baseband: add NXP LA12xx driver Hemant Agrawal
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 1/8] baseband: introduce " Hemant Agrawal
2021-04-24 10:36       ` [dpdk-dev] [PATCH v4 0/8] baseband: add " Hemant Agrawal
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 1/8] bbdev: add network order data capability Hemant Agrawal
2021-04-24 21:59           ` Chautru, Nicolas
2021-04-25 16:14             ` Thomas Monjalon
2021-04-26 17:01           ` Dave Burley
2021-04-28 13:03             ` Hemant Agrawal
2021-04-28 13:34             ` Hemant Agrawal
2021-04-28 15:19               ` Chautru, Nicolas
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 2/8] baseband: introduce NXP LA12xx driver Hemant Agrawal
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 3/8] baseband/la12xx: add devargs for max queues Hemant Agrawal
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 4/8] baseband/la12xx: add support for multiple modems Hemant Agrawal
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 5/8] baseband/la12xx: add queue and modem config support Hemant Agrawal
2021-04-24 22:12           ` Chautru, Nicolas
2021-05-13 11:01             ` Nipun Gupta
2021-05-13 14:51               ` Chautru, Nicolas
2021-05-17 17:00                 ` Nipun Gupta
2021-05-17 17:53                   ` Chautru, Nicolas
2021-05-19 18:43                     ` Nipun Gupta
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 6/8] baseband/la12xx: add enqueue and dequeue support Hemant Agrawal
2021-04-24 10:36         ` [dpdk-dev] [PATCH v4 7/8] app/bbdev: enable la12xx for bbdev Hemant Agrawal
2021-04-24 10:37         ` [dpdk-dev] [PATCH v4 8/8] app/bbdev: add test vectors for transport blocks Hemant Agrawal
2021-04-24 22:05           ` Chautru, Nicolas
2021-05-05 12:31         ` [dpdk-dev] [EXT] [PATCH v4 0/8] baseband: add NXP LA12xx driver Akhil Goyal
2021-06-16 20:35           ` Akhil Goyal
2021-06-26  9:59             ` Hemant Agrawal
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 2/8] baseband/la12xx: add devargs for max queues Hemant Agrawal
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 3/8] baseband/la12xx: add support for multiple modems Hemant Agrawal
2021-04-14  0:02       ` Chautru, Nicolas
2021-04-14 12:10         ` Hemant Agrawal
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 4/8] baseband/la12xx: add queue and modem config support Hemant Agrawal
2021-04-14  0:41       ` Chautru, Nicolas
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 5/8] baseband/la12xx: add enqueue and dequeue support Hemant Agrawal
2021-04-14  0:53       ` Chautru, Nicolas
2021-04-14 12:06         ` Hemant Agrawal
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 6/8] baseband/la12xx: add documentation support Hemant Agrawal
2021-04-14  0:57       ` Chautru, Nicolas
2021-04-14 11:59         ` Hemant Agrawal
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 7/8] app/bbdev: add parameter to take input in network order Hemant Agrawal
2021-04-14  1:00       ` Chautru, Nicolas
2021-04-14 12:15         ` Nipun Gupta
2021-04-13  5:17     ` [dpdk-dev] [PATCH v3 8/8] app/bbdev: add test vectors for transport blocks Hemant Agrawal
2021-04-14  1:09       ` Chautru, Nicolas
2021-04-14 12:16         ` Nipun Gupta
2021-04-14 15:48           ` Chautru, Nicolas
2021-04-13 10:06     ` [dpdk-dev] [EXT] [PATCH v3 0/8] baseband: add NXP LA12xx driver Akhil Goyal
2021-09-12 12:15 ` [dpdk-dev] [PATCH v5 0/9] " Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 1/9] bbdev: add big endian processing data capability Nipun Gupta
2021-09-13 18:39     ` Chautru, Nicolas
2021-09-17  8:30       ` Nipun Gupta
2021-09-17 14:23         ` Chautru, Nicolas
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 2/9] baseband: introduce NXP LA12xx driver Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 3/9] baseband/la12xx: add devargs for max queues Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 4/9] baseband/la12xx: add support for multiple modems Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 5/9] baseband/la12xx: add queue and modem config support Nipun Gupta
2021-09-13 18:56     ` Chautru, Nicolas
2021-09-17  8:33       ` Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 6/9] baseband/la12xx: add enqueue and dequeue support Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 7/9] app/bbdev: enable la12xx for bbdev Nipun Gupta
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 8/9] app/bbdev: handle endianness of test data Nipun Gupta
2021-09-13 18:45     ` Chautru, Nicolas
2021-09-12 12:15   ` [dpdk-dev] [PATCH v5 9/9] app/bbdev: add test vectors for transport blocks Nipun Gupta
2021-09-13 19:01     ` Chautru, Nicolas
2021-09-17  8:37       ` Nipun Gupta
2021-09-17 14:20         ` Chautru, Nicolas
2021-09-24  4:37 ` [dpdk-dev] [PATCH v6 0/9] baseband: add NXP LA12xx driver nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 1/9] bbdev: add big endian processing data processing info nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 2/9] baseband: introduce NXP LA12xx driver nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 3/9] baseband/la12xx: add devargs for max queues nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 4/9] baseband/la12xx: add support for multiple modems nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 5/9] baseband/la12xx: add queue and modem config support nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 6/9] baseband/la12xx: add enqueue and dequeue support nipun.gupta
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 7/9] app/bbdev: enable la12xx for bbdev nipun.gupta
2021-09-24  4:37   ` nipun.gupta [this message]
2021-09-24  4:37   ` [dpdk-dev] [PATCH v6 9/9] app/bbdev: add test vectors for transport blocks nipun.gupta
2021-09-28  8:29 ` [dpdk-dev] [PATCH v7 0/9] baseband: add NXP LA12xx driver nipun.gupta
2021-09-28  8:29   ` [dpdk-dev] [PATCH v7 1/9] bbdev: add big endian processing data processing info nipun.gupta
2021-10-04 23:09     ` Chautru, Nicolas
2021-09-28  8:29   ` [dpdk-dev] [PATCH v7 2/9] baseband: introduce NXP LA12xx driver nipun.gupta
2021-09-28  8:29   ` [dpdk-dev] [PATCH v7 3/9] baseband/la12xx: add devargs for max queues nipun.gupta
2021-09-28  8:29   ` [dpdk-dev] [PATCH v7 4/9] baseband/la12xx: add support for multiple modems nipun.gupta
2021-09-28  8:29   ` [dpdk-dev] [PATCH v7 5/9] baseband/la12xx: add queue and modem config support nipun.gupta
2021-10-04 23:19     ` Chautru, Nicolas
2021-09-28  8:29   ` [dpdk-dev] [PATCH v7 6/9] baseband/la12xx: add enqueue and dequeue support nipun.gupta
2021-10-04 23:23     ` Chautru, Nicolas
2021-09-28  8:29   ` [dpdk-dev] [PATCH v7 7/9] app/bbdev: enable la12xx for bbdev nipun.gupta
2021-09-28  8:29   ` [dpdk-dev] [PATCH v7 8/9] app/bbdev: handle endianness of test data nipun.gupta
2021-10-04 23:38     ` Chautru, Nicolas
2021-09-28  8:29   ` [dpdk-dev] [PATCH v7 9/9] app/bbdev: add test vectors for transport blocks nipun.gupta
2021-10-04 23:31     ` Chautru, Nicolas
2021-10-06 11:31 ` [dpdk-dev] [PATCH v8 0/8] baseband: add NXP LA12xx driver nipun.gupta
2021-10-06 11:31   ` [dpdk-dev] [PATCH v8 1/8] bbdev: add big endian processing data processing info nipun.gupta
2021-10-06 21:02     ` Chautru, Nicolas
2021-10-06 11:31   ` [dpdk-dev] [PATCH v8 2/8] baseband: introduce NXP LA12xx driver nipun.gupta
2021-10-06 11:31   ` [dpdk-dev] [PATCH v8 3/8] baseband/la12xx: add devargs for max queues nipun.gupta
2021-10-06 11:31   ` [dpdk-dev] [PATCH v8 4/8] baseband/la12xx: add support for multiple modems nipun.gupta
2021-10-06 11:31   ` [dpdk-dev] [PATCH v8 5/8] baseband/la12xx: add queue and modem config support nipun.gupta
2021-10-06 11:31   ` [dpdk-dev] [PATCH v8 6/8] baseband/la12xx: add enqueue and dequeue support nipun.gupta
2021-10-06 11:31   ` [dpdk-dev] [PATCH v8 7/8] app/bbdev: enable la12xx for bbdev nipun.gupta
2021-10-06 11:31   ` [dpdk-dev] [PATCH v8 8/8] app/bbdev: handle endianness of test data nipun.gupta
2021-10-06 20:24     ` Chautru, Nicolas
2021-10-07  9:33 ` [dpdk-dev] [PATCH v9 0/8] baseband: add NXP LA12xx driver nipun.gupta
2021-10-07  9:33   ` [dpdk-dev] [PATCH v9 1/8] bbdev: add device info related to data endianness assumption nipun.gupta
2021-10-07  9:33   ` [dpdk-dev] [PATCH v9 2/8] baseband: introduce NXP LA12xx driver nipun.gupta
2021-10-07  9:33   ` [dpdk-dev] [PATCH v9 3/8] baseband/la12xx: add devargs for max queues nipun.gupta
2021-10-07  9:33   ` [dpdk-dev] [PATCH v9 4/8] baseband/la12xx: add support for multiple modems nipun.gupta
2021-10-07  9:33   ` [dpdk-dev] [PATCH v9 5/8] baseband/la12xx: add queue and modem config support nipun.gupta
2021-10-07  9:33   ` [dpdk-dev] [PATCH v9 6/8] baseband/la12xx: add enqueue and dequeue support nipun.gupta
2021-10-07  9:33   ` [dpdk-dev] [PATCH v9 7/8] app/bbdev: enable la12xx for bbdev nipun.gupta
2021-10-07  9:33   ` [dpdk-dev] [PATCH v9 8/8] app/bbdev: handle endianness of test data nipun.gupta
2021-10-11  4:32 ` [dpdk-dev] [PATCH v10 0/8] baseband: add NXP LA12xx driver nipun.gupta
2021-10-11  4:32   ` [dpdk-dev] [PATCH v10 1/8] bbdev: add device info related to data endianness nipun.gupta
2021-10-11  4:32   ` [dpdk-dev] [PATCH v10 2/8] baseband: introduce NXP LA12xx driver nipun.gupta
2021-10-16 13:58     ` [dpdk-dev] [EXT] " Akhil Goyal
2021-10-11  4:32   ` [dpdk-dev] [PATCH v10 3/8] baseband/la12xx: add devargs for max queues nipun.gupta
2021-10-16 14:00     ` [dpdk-dev] [EXT] " Akhil Goyal
2021-10-11  4:32   ` [dpdk-dev] [PATCH v10 4/8] baseband/la12xx: add support for multiple modems nipun.gupta
2021-10-11  4:32   ` [dpdk-dev] [PATCH v10 5/8] baseband/la12xx: add queue and modem config support nipun.gupta
2021-10-16 14:13     ` [dpdk-dev] [EXT] " Akhil Goyal
2021-10-11  4:32   ` [dpdk-dev] [PATCH v10 6/8] baseband/la12xx: add enqueue and dequeue support nipun.gupta
2021-10-11  4:32   ` [dpdk-dev] [PATCH v10 7/8] app/bbdev: enable la12xx for bbdev nipun.gupta
2021-10-11  4:32   ` [dpdk-dev] [PATCH v10 8/8] app/bbdev: handle endianness of test data nipun.gupta
2021-10-17  6:53 ` [dpdk-dev] [PATCH v11 0/8] baseband: add NXP LA12xx driver nipun.gupta
2021-10-17  6:53   ` [dpdk-dev] [PATCH v11 1/8] bbdev: add device info related to data endianness nipun.gupta
2021-10-17  6:53   ` [dpdk-dev] [PATCH v11 2/8] baseband: introduce NXP LA12xx driver nipun.gupta
2021-10-17  6:53   ` [dpdk-dev] [PATCH v11 3/8] baseband/la12xx: add devargs for max queues nipun.gupta
2021-10-17  6:53   ` [dpdk-dev] [PATCH v11 4/8] baseband/la12xx: add support for multiple modems nipun.gupta
2021-10-17  6:53   ` [dpdk-dev] [PATCH v11 5/8] baseband/la12xx: add queue and modem config support nipun.gupta
2021-10-17  6:53   ` [dpdk-dev] [PATCH v11 6/8] baseband/la12xx: add enqueue and dequeue support nipun.gupta
2021-10-17  6:53   ` [dpdk-dev] [PATCH v11 7/8] app/bbdev: enable la12xx for bbdev nipun.gupta
2021-10-17  6:53   ` [dpdk-dev] [PATCH v11 8/8] app/bbdev: handle endianness of test data nipun.gupta
2021-10-18 15:23   ` [dpdk-dev] [EXT] [PATCH v11 0/8] baseband: add NXP LA12xx driver Akhil Goyal
2021-10-18 18:08     ` Chautru, Nicolas
2021-10-18 18:13       ` Akhil Goyal

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=20210924043722.27980-9-nipun.gupta@nxp.com \
    --to=nipun.gupta@nxp.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=nicolas.chautru@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