From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 03070A0C45; Mon, 13 Sep 2021 20:45:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6DCDA40151; Mon, 13 Sep 2021 20:45:58 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 116204014F for ; Mon, 13 Sep 2021 20:45:55 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10106"; a="201942159" X-IronPort-AV: E=Sophos;i="5.85,290,1624345200"; d="scan'208";a="201942159" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2021 11:45:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,290,1624345200"; d="scan'208";a="433354051" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga003.jf.intel.com with ESMTP; 13 Sep 2021 11:45:54 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 13 Sep 2021 11:45:54 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 13 Sep 2021 11:45:53 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 13 Sep 2021 11:45:53 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.170) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 13 Sep 2021 11:45:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ePKZSV1LSeQIAw0sIwY1006HI3AAHyEv0JG9I9X3xKzF8qYcxnqOEepWi6HfHEeOwXhisVifOgcaKhgTa1PWY3Wv8t0TBG1ft44tKmhwgg8SYwZezjNy4HCpyGKwN1xZSE6zm8i/9JtvQhsE8baoV6SzFsOv0Gl36VCMyNdRrAEk24QDM3uW+YPTT5cApl/1xlYui8D88FDlM6QyBd301HXrND0oyd3Q42Oc28mMqwWGL8eYRUA4WGLnKnotPblg3nZmHfkKCVrTD7Oh0gOGo2hDB7/BjbGwI0wxOFyl/tf++bDCN7yMwEwn49ckFbh/sqMzz/yW3SHAd2QSLDT7aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LEEIQQpnhHjIppkZZ0HYRkk4EVu/Aj+at7zCEt8NY4k=; b=dGNaPCrV5lmHoFpAnyetjdoCz9kWhbRAw222zeLsy/C5DcuN7P9K6XdDCOvUEh7wT4iiS4XtBQwh96+h+WN8RlNKFnZANF8BiVpg9bdvJk+VORUFi+UyXXgYE5Fk3v37uFA/z0/kywLLWy9sbIcBvTSrM3L1cx8AZn0FYyh8T2SiF6K4xc+3X03mP53mLFpsNSZgj5EkcrucpuzlWBF5DAjvnLj+SsywkWR1OZiWP7X4n/I76oRXpiwJD56mMN+r+IVR4wN3Un7MjHCyB+frdgoa5N4dD7AsDvplDAoBlTic+rmiIaCC6ITnmPxR7MN/OOHGkbRBX1TV/aAzm3CObA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LEEIQQpnhHjIppkZZ0HYRkk4EVu/Aj+at7zCEt8NY4k=; b=Tz8McjgliFFfRCXGHzf/YpbSpxBerRoMOe1A5z4AaEWAcAY8xwZaCbe5sYczKLrxqjzWm4ShppYK/ZgwTDkEbv/52IUa8f8pyVbIvO20ozCHyAypAAxCYWTJJ+681ADkeIoQ0S7OZLvbB94eCdpTkElFYOEX572AUYKPUhtr5TM= Received: from BY5PR11MB4451.namprd11.prod.outlook.com (2603:10b6:a03:1cb::30) by SJ0PR11MB5056.namprd11.prod.outlook.com (2603:10b6:a03:2d5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Mon, 13 Sep 2021 18:45:50 +0000 Received: from BY5PR11MB4451.namprd11.prod.outlook.com ([fe80::4821:5aee:4cc4:75c9]) by BY5PR11MB4451.namprd11.prod.outlook.com ([fe80::4821:5aee:4cc4:75c9%5]) with mapi id 15.20.4500.018; Mon, 13 Sep 2021 18:45:50 +0000 From: "Chautru, Nicolas" To: Nipun Gupta , "dev@dpdk.org" , "gakhil@marvell.com" CC: "david.marchand@redhat.com" , "hemant.agrawal@nxp.com" Thread-Topic: [PATCH v5 8/9] app/bbdev: handle endianness of test data Thread-Index: AQHXp8/1r4GWA+rfAUmL64Di2MlMlKuiTtiw Date: Mon, 13 Sep 2021 18:45:50 +0000 Message-ID: References: <20210318063421.14895-1-hemant.agrawal@nxp.com> <20210912121510.22699-1-nipun.gupta@nxp.com> <20210912121510.22699-9-nipun.gupta@nxp.com> In-Reply-To: <20210912121510.22699-9-nipun.gupta@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0cbf5d86-0f38-4d42-3fe8-08d976e6b553 x-ms-traffictypediagnostic: SJ0PR11MB5056: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: necgLdfCf6PhkXjjBLzqoHakxW+rU/XlJ1Ih0YVKt7p2UZKpe7xuzDGUwY7SQqlx5RKBFy+XE4lIri5S8pBFe68WXg2iX0Ggc7Qp1gsSJRfXSC5s4zCrPwPhQg8j4KaSRyGzXoXIKCCkTMJkQJZMRYFp+Rcv4cuD86Tx3l8MeTm7p5vE20w2ulvTd/V2kBuvmu0oD/F+7gVL3hNpZJU9L++YuvopORYXTcs2CnmDUHRBKtaN60MbweGPqtFCMlguThAzpOR1XcGy7eDAApmRxHzWcWeorLMovdKibq9xvSSXfK5stvyOYBx5cCD+8EGQhP2Pd5OCU1BSptoK9giPLYbRZqEeteaiShP3g+V/KaKTkRJAvVaVGIECgFN0k4TjA++8IMZbH7XFHvJrEQb9BlRvksKqeKVpvYQ0DhHWZ7qTet1Lkw2L5YUtYa+imThdMjZtQh+foxWGChqhXLWA1PeR3+nKm/c+X3+EKJM708+3Oc2dn7R+LsDhQ2hfnbsEbDFC9+nqZD9T/ObMorXLzfMJrESksjYK0yB2Tyh1onNMUKLD7vzDVJojczNBUBb49k3v/XKVVWH/6KJLASa8SyeK/SZsmWDz2z9CGzrfjQOecd5o+GzI+iIrC/RnWGab1TXi08yF1nsP2BnK7+o/QWBpySvMG4judJSVTF0DaFzEJqgxK3jPhqCcYc1ENlVqtL5gr+QO+9tVPddAISVBRg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR11MB4451.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(8676002)(71200400001)(54906003)(4326008)(66556008)(64756008)(52536014)(66946007)(26005)(66446008)(7696005)(110136005)(508600001)(5660300002)(76116006)(66476007)(53546011)(38100700002)(9686003)(8936002)(122000001)(186003)(2906002)(6506007)(33656002)(83380400001)(316002)(86362001)(55016002)(38070700005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?TUikuBD0709k1D49AsdvluREM2wdvYUKfDL16Vg3UFnWGM8tV15b7Z1CXfxE?= =?us-ascii?Q?f1iLikRS+/nRpGe7n4hjEsrD60GS2lBUUdMtnB1pb03EQPZns3h8DHfX8L/1?= =?us-ascii?Q?Y71WywmFYzMHWF0Gyj0UFXc6yKuLhwkxY+ISb37D/R3KztIeXcZJZ65yE2Z4?= =?us-ascii?Q?4X12ozOerzow2EPYSSQRAaxTwjnhdHlnnn/w8UhEe7YpcsfZaaQ4Kk82FTvt?= =?us-ascii?Q?l++kJGmeT2e7a2rj3886GHUzAdEFz2xXyjCqqiGC52oI934aQoZXcQIu4kjY?= =?us-ascii?Q?qSxLbVJXq2rcMrqF6jZk7wUMolDQlcrs3YqgINCBF74b0NoyjWcL9ixbPmb5?= =?us-ascii?Q?qmVXGiqSbQC84r5LRmXqny6l/9wL4cmkyuQKI9VyfQBWTUIM3wbhpYUM8xeg?= =?us-ascii?Q?03fe4Ze9h/Gx2J9cVdQ9BzADp430iXG0e5mCTp8f8VUsADoNU2AUslYf/qw7?= =?us-ascii?Q?4WMaNtuOyZYPs+gaZ7HqLPbD4/pgN+5OkN0xsyCs4Lq43eUW2QC6W7I+VQ+s?= =?us-ascii?Q?l0IY+wPWVVsCp+Bi6JrUD9rTW5/Apu+mRIWnJ5CN++HmQaH0mYSblC2824sq?= =?us-ascii?Q?R3UNCku/mc2PinkDuiaq4ifuHalvocrtk9RBZ0rrScF5f3U6FMTfTe9ZmaBJ?= =?us-ascii?Q?zI7zWp9vUJHiCSh5HIjbKV13/jUHYWJ041AtOyJtGALIi/l2ZLohZXLcFCaS?= =?us-ascii?Q?8zxjeXFm1/Vp1ruUPgSFXzJMXZHJDgRb8aokgHH75LN7H49C0lru6jgSLISq?= =?us-ascii?Q?2cal2FSkeptKWPZ8TJOA9v5/x7fn8847hqMB/J7Ycy3El7e3ZzkTGo8mf0wG?= =?us-ascii?Q?KiEQftLEhnIVoEf/gYTvmLB0Oj7lhCgLd7m754/BZ3w4oXPqAHfyg5a5NkCP?= =?us-ascii?Q?vTB/jPJBiKRjFRKWngyOFNXNsRIO1E2ANwL7DYECysGDisI6FNFlhP4HqrZr?= =?us-ascii?Q?VRWkg5peC05TAHu9MlDmrXrSp3bRECYHpE+M9uJfYrek9dZVFzdUjiqDARhn?= =?us-ascii?Q?8ZSZm29cicRE7tA2vF9hcbyrA7/8nQ10WGQyoj/TfTF/U+PLJ0uvNI57sfta?= =?us-ascii?Q?cTm4CfukLuEItQigEjvp5CXkBG5sywWd00p0wFEECzcGQtN6gutdi5/opF3V?= =?us-ascii?Q?OGS2I6C637X0v6Mg3P2GLN03GmIMLiRrLY3A2IA4Qbx89u/leUBZVNOGIJVS?= =?us-ascii?Q?dlSjwRBFySF/pgwJjWVScE7VP+JzT52wujNAwj1hu3gcwJSAp3g3llMuAjt1?= =?us-ascii?Q?lfSaU1ZNjFnPBORDgohHxPR8pXbJBlAiAvgSOeGtnqCExBxCfB5kFqvJkOgR?= =?us-ascii?Q?78ZN+x+v/QKo3tH+bBoL7NL2?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR11MB4451.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cbf5d86-0f38-4d42-3fe8-08d976e6b553 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2021 18:45:50.5733 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rRQeq/NOrY68ZCkA0SCWmDC8q+LFRcLCowdKVm2KzLoBScAruOjKZj4Tf4gnKioa+fDdxgRJ95E0MCvkwF5J3gOIRvAkLh24wIiiPcJ4Ico= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5056 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v5 8/9] app/bbdev: handle endianness of test data X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Nipun Gupta > Sent: Sunday, September 12, 2021 5:15 AM > To: dev@dpdk.org; gakhil@marvell.com; Chautru, Nicolas > > Cc: david.marchand@redhat.com; hemant.agrawal@nxp.com; Nipun Gupta > > Subject: [PATCH v5 8/9] app/bbdev: handle endianness of test data >=20 > With data input, output and harq also supported in big endian format, thi= s > patch updates the testbbdev application to handle the endianness > conversion as directed by the test vector and the driver being used. >=20 > For instance, if the driver supports big endian data processing, but the = test > vector does not mention the data as a big endian format, conversion from > little endian to big will be handled by the testbbdev application. See command on the 1/9 with regards to how to expose the endianness. This w= ill also simplify some of that code, as same vectors can be used any varian= t of PMD. >=20 > Signed-off-by: Nipun Gupta > --- > app/test-bbdev/test_bbdev_perf.c | 84 > ++++++++++++++++++++++++++++++ > app/test-bbdev/test_bbdev_vector.c | 4 ++ > 2 files changed, 88 insertions(+) >=20 > diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test- > bbdev/test_bbdev_perf.c > index 469597b8b3..836e07d747 100644 > --- a/app/test-bbdev/test_bbdev_perf.c > +++ b/app/test-bbdev/test_bbdev_perf.c > @@ -227,6 +227,71 @@ clear_soft_out_cap(uint32_t *op_flags) > *op_flags &=3D ~RTE_BBDEV_TURBO_NEG_LLR_1_BIT_SOFT_OUT; > } >=20 > +static void > +clear_ldpc_endianness_flag(uint32_t *op_flags) { > + *op_flags &=3D ~RTE_BBDEV_LDPC_ENC_BIG_ENDIAN; > + *op_flags &=3D ~RTE_BBDEV_LDPC_DEC_BIG_ENDIAN; } > + > +static inline void > +reverse_op(struct op_data_entries *op) > +{ > + uint8_t nb_segs =3D op->nb_segments; > + uint32_t *data, len; > + int complete, rem, i, j; > + uint8_t *rem_data, temp; > + > + /* Validate each mbuf segment length */ > + for (i =3D 0; i < nb_segs; ++i) { > + len =3D op->segments[i].length; > + data =3D op->segments[i].addr; > + > + /* Swap complete u32 bytes */ > + complete =3D len / 4; > + for (j =3D 0; j < complete; j++) > + data[j] =3D rte_bswap32(data[j]); > + > + /* Swap any remaining data for last seg */ > + if (i =3D=3D (nb_segs - 1)) { > + rem =3D len % 4; > + rem_data =3D (uint8_t *)&data[j]; > + for (j =3D 0; j < rem/2; j++) { > + temp =3D rem_data[j]; > + rem_data[j] =3D rem_data[rem - j - 1]; > + rem_data[rem - j - 1] =3D 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 =3D test_vector.entries[DATA_INPUT].nb_segments; > + if (nb_inputs) > + reverse_op(&test_vector.entries[DATA_INPUT]); > + > + nb_soft_outputs =3D > test_vector.entries[DATA_SOFT_OUTPUT].nb_segments; > + if (nb_soft_outputs) > + reverse_op(&test_vector.entries[DATA_SOFT_OUTPUT]); > + > + nb_hard_outputs =3D > test_vector.entries[DATA_HARD_OUTPUT].nb_segments; > + if (nb_hard_outputs) > + reverse_op(&test_vector.entries[DATA_HARD_OUTPUT]); > + > + nb_harq_inputs =3D > test_vector.entries[DATA_HARQ_INPUT].nb_segments; > + if (nb_harq_inputs) > + reverse_op(&test_vector.entries[DATA_HARQ_INPUT]); > + > + nb_harq_outputs =3D > 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) { @@ -324,6 > +389,16 @@ check_dev_cap(const struct rte_bbdev_info *dev_info) > const struct rte_bbdev_op_cap_ldpc_enc *cap =3D > &op_cap->cap.ldpc_enc; >=20 > + if ((test_vector.ldpc_enc.op_flags & > + > RTE_BBDEV_LDPC_ENC_BIG_ENDIAN) !=3D > + (cap->capability_flags & > + > RTE_BBDEV_LDPC_ENC_BIG_ENDIAN)) { > + reverse_all_ops(); > + clear_ldpc_endianness_flag( > + &test_vector.ldpc_enc.op_flags); > + > + } > + > if (!flags_match(test_vector.ldpc_enc.op_flags, > cap->capability_flags)){ > printf("Flag Mismatch\n"); > @@ -352,6 +427,15 @@ check_dev_cap(const struct rte_bbdev_info > *dev_info) > const struct rte_bbdev_op_cap_ldpc_dec *cap =3D > &op_cap->cap.ldpc_dec; >=20 > + if ((test_vector.ldpc_dec.op_flags & > + > RTE_BBDEV_LDPC_DEC_BIG_ENDIAN) !=3D > + (cap->capability_flags & > + > RTE_BBDEV_LDPC_DEC_BIG_ENDIAN)) { > + reverse_all_ops(); > + clear_ldpc_endianness_flag( > + &test_vector.ldpc_dec.op_flags); > + } > + > if (!flags_match(test_vector.ldpc_dec.op_flags, > cap->capability_flags)){ > printf("Flag Mismatch\n"); > diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test- > bbdev/test_bbdev_vector.c > index 614dbd1a6d..b2e7a9008d 100644 > --- a/app/test-bbdev/test_bbdev_vector.c > +++ b/app/test-bbdev/test_bbdev_vector.c > @@ -191,6 +191,8 @@ op_ldpc_decoder_flag_strtoul(char *token, uint32_t > *op_flag_value) > *op_flag_value =3D > RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION; > else if (!strcmp(token, "RTE_BBDEV_LDPC_LLR_COMPRESSION")) > *op_flag_value =3D RTE_BBDEV_LDPC_LLR_COMPRESSION; > + else if (!strcmp(token, "RTE_BBDEV_LDPC_DEC_BIG_ENDIAN")) > + *op_flag_value =3D RTE_BBDEV_LDPC_DEC_BIG_ENDIAN; > else if (!strcmp(token, >=20 > "RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE")) > *op_flag_value =3D > RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_IN_ENABLE; > @@ -248,6 +250,8 @@ op_ldpc_encoder_flag_strtoul(char *token, uint32_t > *op_flag_value) > *op_flag_value =3D RTE_BBDEV_LDPC_ENC_INTERRUPTS; > else if (!strcmp(token, > "RTE_BBDEV_LDPC_ENC_SCATTER_GATHER")) > *op_flag_value =3D > RTE_BBDEV_LDPC_ENC_SCATTER_GATHER; > + else if (!strcmp(token, "RTE_BBDEV_LDPC_ENC_BIG_ENDIAN")) > + *op_flag_value =3D RTE_BBDEV_LDPC_ENC_BIG_ENDIAN; > else { > printf("The given value is not a turbo encoder flag\n"); > return -1; > -- > 2.17.1