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 54464A0C47; Tue, 6 Jul 2021 09:48:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 381B740688; Tue, 6 Jul 2021 09:48:04 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 1779D4067E for ; Tue, 6 Jul 2021 09:48:02 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1667djr0031236; Tue, 6 Jul 2021 00:48:02 -0700 Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by mx0b-0016f401.pphosted.com with ESMTP id 39kt2mc29m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Jul 2021 00:48:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=edmi5FWhMJICmfM5XKKn1oGCdhrjZgrmUu3XLlHSdZTSAKdeuV4Ol0dI15ppV0AzldlOEaiAkHU7vmckhztixFHGfJjb1RK02XIINTZi2kh5B9xjX9G7/NtdQ0dUKiUtZ9gFnwjEuL/X0d5pay05wsTrt74CZhkZTjRkXOuCxAVyP5hK0hH1evk51maASs2Irv4M2jK8h4scWCCnEppc3aMfeLaFhO4IrtN2MmPi8wl8EzsgF0V6ORN8MhuTl1WcPl2y3S2TQo/sWR13o7YGz3ocxHF2DJ7d9MX0yCOqvbwV1zlM11GymQv6VpqawVZSgLNZTdrTd/pEG+P+6Jo1pA== 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:X-MS-Exchange-SenderADCheck; bh=/6d8rmf+6wvFpQOPukp4DAjWWrwH5ov3cy0gp06fDEI=; b=DNB/i+2U8K6pBRgzk+OZ5MUCe24axutXDzbrUGJl1XEOTB93a6m8uYEKHByuTKTrZTtcMYuCA7vuZH2OSmQDEKZHcnYZQgkBnL65o+SBTyihDaIsxxjJoqsW7BvkTY8TRrdDUW4N2aMsgQm/stpy2A6UAKWPrcCcVOsta/hGhxCj96fyoayywgKlJmJJnmorpfXgRx/x8MAZh386jjoGwshFfG1lzxgkx6a0hbAaaTkPUD1qrkrV+tbTjHqLhaD8JdLSpdmi0zoKw9zOMddUtKk8wxaYF0YfJu+CcnNUXtKnKFPj8w+pjrog4vmu4V7ZUfYZLDa/+FlfGLUUjd331g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/6d8rmf+6wvFpQOPukp4DAjWWrwH5ov3cy0gp06fDEI=; b=X0z8qQqsunKKaN3bL9y9piLOcKR0PcvMk6t3dZj1t2eESjprrtWVCjJSUJ61mNSrhjrETvCJz8FN03iDBdGKxLY9wXKGoysjNU91SVxL6pYy0ejTqgI9E+//TDeVQWMl+T2j0zeYTiA6IjSJhx8ItaWHUoig8IBjSogjVtV3pps= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO6PR18MB4499.namprd18.prod.outlook.com (2603:10b6:303:13e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.19; Tue, 6 Jul 2021 07:48:00 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::1455:9a67:a6e7:e557]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::1455:9a67:a6e7:e557%6]) with mapi id 15.20.4287.033; Tue, 6 Jul 2021 07:48:00 +0000 From: Akhil Goyal To: Shiri Kuzin , "dev@dpdk.org" CC: "matan@nvidia.com" , "suanmingm@nvidia.com" Thread-Topic: [EXT] [PATCH v5 15/15] test/crypto: add mlx5 multi segment tests Thread-Index: AQHXbnzWAdzsjacxxEmOrGnqAk9VbKs1kZ5A Date: Tue, 6 Jul 2021 07:48:00 +0000 Message-ID: References: <20210509160507.224644-1-matan@nvidia.com> <20210701132609.53727-1-shirik@nvidia.com> <20210701132609.53727-16-shirik@nvidia.com> In-Reply-To: <20210701132609.53727-16-shirik@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=marvell.com; x-originating-ip: [182.68.121.110] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9c34f4ef-e685-4eab-192f-08d9405260a2 x-ms-traffictypediagnostic: CO6PR18MB4499: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uRNXlbkukj1zAO6BVtopN7HE7r5EUdZ7rMgaHrnzkIiGcO/I6/TsdF+yvGcQ95haHZSrvPFGQ52Phjbu4bkH6cXCgQ4EW/Yq16jVkU+PtiT8xEhEOXOdMVxMspoHtc280aVnt30P01L4aBMlEknD4lrS+z2VwnnpR+IjEZx6SmwVvuOmEPKJ1F74NEO21xGMIBxAyGFzvCv3GOYhANhirrSwtxYjnu7pOIJBIWx/YwmHDoQCTunTePoCWDzvPlVgrHy6v1wDdaGdpfb/NAch96R65J7x5ObvVcGoTwoXxsId/719JrB77SKg3VRK60BhixF86V+dZwhw1EuwJOpJU6g0vnogCLKtPoiC7nRTrB2bXYAXj940Tg6szbPwVlGxqpHa0//DRoSx7P98+wPct1FGi7ufhMMDPbKEN8CbBZlX2YY2AQllxsc0L1x5T8gWutZMGx3frlnBuDKj2JqkMbMxUs0eI9IUCOa7Fa8AwD2eD+XT0kEUNZg8PluSyV4XCyspLM/BOot3UoaiHYviv5VihAPJQGRiklkUNO6hdIYTRQmlU319O1+iDCnBE5+hGenOJSIY8I08MWff3LXoPKmwh8i4tCs5xljkGH3vdKUC5oQM6vZ6UrXIi9XI1hiIHqKQxJL6B5eEGv2l1RTrSQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(346002)(136003)(396003)(366004)(52536014)(186003)(86362001)(38100700002)(8936002)(33656002)(26005)(9686003)(76116006)(30864003)(55016002)(66446008)(5660300002)(66476007)(64756008)(66556008)(66946007)(2906002)(83380400001)(71200400001)(110136005)(54906003)(7696005)(478600001)(122000001)(316002)(6506007)(8676002)(4326008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?0URZn/d2SjpgePJi9+slAbjNbfUjVBpvJQ/5fU4Zd9qniqI5TFUKm+4IPasF?= =?us-ascii?Q?jSoB+vMD7rMuBvuqLhXNigeQ0PMAFe9ZIET/17NLjW0GoWBhx9zn96upZZ7Y?= =?us-ascii?Q?Zvr6gEyAf5yPau50iNxNbQ1RJE95IjEBfuoIIO3IM+T6kIbeW6x2DYbCqcxa?= =?us-ascii?Q?3TZdV5HbB04wNY5ZmFMs1opEIBnHTTZLQeMsrfvf1bbJ8+BTNCZyZsPGyqdJ?= =?us-ascii?Q?JVZ8o6A0wUF7qvF3LTYLL803sfwXa9+onIIwI0BxY1TxwvTkwGam/Kwj0NzA?= =?us-ascii?Q?IHhpmYT5qznN2LISXa52VdwZTKaa6YkPQFTqnkUME8ZAHCehZ9bTO/llszyV?= =?us-ascii?Q?dz9cGK919XtsVZtZdehogxq2/37wEmcdCKYJH7kqnYwkdsfWaoqr6SkG6VLf?= =?us-ascii?Q?MUzwhUIDcV9WbqkKc/iE9haFD0o4IX29X3TICpes1/VEVZMM4sFLogOQFoFI?= =?us-ascii?Q?YspYBJNjAqvAliyEEBnyTP8voo2CxD5xyJcMcpl4COLN4cncnR7xPJ18AlHc?= =?us-ascii?Q?4aoxhr1s1gklw40LQ4XtW/GPe0+YznhsnqJ0odQTfw/1YWVbHnkHOVtlFfNn?= =?us-ascii?Q?ofvOoZ4IioccFwD7yxdJ/SgKS3EBNK8E1jcKzkdFezjw2ZVXAVZIRyqzj4tu?= =?us-ascii?Q?cB483YgJRG9N/48icXJE+jUo+Xc2pkHfFFXt2dHf67C09MTi+dX9xuzD/6rK?= =?us-ascii?Q?0vej/VSqUMX7XX5jJWYoeO0ZKo/Yuc+o3V8FTIBhpyK6m6jti8x5KSAlkyXH?= =?us-ascii?Q?AlhwYkkDYXdfdEEFZXU6hUUnFFJlTILgv36dhLR3Ukf9P6gOsIX7xXZX0wiq?= =?us-ascii?Q?5XetmXzkiRKqw6AkywOrrDaSJafYZB/Bdg19w9xgWUkqGE2KsOEZjsNmD4UM?= =?us-ascii?Q?sYv5If5S/rTQdB1gvvt6EHQ+t3IpSP+LtBAuRcnQvct+ar9qNiIbW3trHQuC?= =?us-ascii?Q?FS0hDPdYpTs3lNelLwh4UqzbksQ/Nwk52L1WOAcQJPGdoPJYvUzcVocj8PXp?= =?us-ascii?Q?v2A+CgZScBx/PY4QgPbG0fQ/Nuexl6rj1uN7+I+HBxiN/j2mO3+RDPaz3Ffa?= =?us-ascii?Q?FyQZ2PPdee6jqExkkzWl+/Ay84fplqaPEInILGJmfgIM3LurGo0FjAdmhbhw?= =?us-ascii?Q?52rcJTrWu/bHf+hI155FzyYTLkvLHt3Ex+PQKUvwfEyOi+RPErXNsW7TkQmK?= =?us-ascii?Q?wr8cdKBMjE1GHTmCmcbGn21csVW+pHNMHqnge3YTqurNkN4vo5W1qwQ1hcbD?= =?us-ascii?Q?X1Q056FI8ZM421/Vv5M3Ir7UwGfXHIJt+JUWT9eCrA4s5iyZeXS25TiQNZvY?= =?us-ascii?Q?KgI=3D?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c34f4ef-e685-4eab-192f-08d9405260a2 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2021 07:48:00.0386 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vUG16wPORI/EyVoVvBl8MpIhEesh4fhq6ryIFmz4B3k6FE2mHZ2VwG+NeSmjBS0n4R18x+73M4sycOcQUj6ipw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR18MB4499 X-Proofpoint-ORIG-GUID: S0PCjOIfSgtgEgX9V_Fu_8auab2u0acO X-Proofpoint-GUID: S0PCjOIfSgtgEgX9V_Fu_8auab2u0acO X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-06_02:2021-07-02, 2021-07-06 signatures=0 Subject: Re: [dpdk-dev] [EXT] [PATCH v5 15/15] test/crypto: add mlx5 multi segment tests 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" > The crypto mlx5 driver supports multi segment encryption and decryption > operations. >=20 > Added mlx5 multi segment encryption function and multi segment > decryption function that will both use the mlx5 vectors. >=20 > The added tests will test both data integrity and correct stat values. >=20 > Signed-off-by: Shiri Kuzin > Acked-by: Matan Azrad > --- > app/test/test_cryptodev.c | 277 ++++++++++++++++++++ > app/test/test_cryptodev_mlx5_test_vectors.h | 3 - > 2 files changed, 277 insertions(+), 3 deletions(-) >=20 > diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c > index 8dbe324b81..4d27a9444c 100644 > --- a/app/test/test_cryptodev.c > +++ b/app/test/test_cryptodev.c > @@ -6681,6 +6681,219 @@ test_mlx5_decryption(const struct > mlx5_test_data *tdata) > return 0; > } >=20 > +static int > +test_mlx5_encryption_sgl(const struct mlx5_test_data *tdata) The test cases cannot be specific to one particular device. Hence the name test_mlx5_xxxx cannot be accepted. Moreover is it not possible to add aes-xts in test_blockcipher_one_case() and add only the test vectors of aes-xts? And probably, you do not need a new file for test vectors, XTS is variant o= f AES, Hence the vectors can be part of "test_cryptodev_aes_test_vectors.h". I don't think there is need for a separate function for XTS right now. The current function test_blockcipher_one_case() covers all capability chec= ks And feature flag checks so that the test is skipped for the devices which d= o not Support a specific case. > +{ > + struct crypto_testsuite_params *ts_params =3D &testsuite_params; > + struct crypto_unittest_params *ut_params =3D &unittest_params; > + struct rte_cryptodev_sym_capability_idx cap_idx; > + struct rte_cryptodev_info dev_info; > + struct rte_cryptodev_stats stats; > + uint8_t buffer[10000]; > + const uint8_t *ciphertext; > + const uint8_t *reference_ciphertext; > + uint64_t feat_flags; > + unsigned int plaintext_pad_len; > + unsigned int plaintext_len; > + int retval; > + > + /* Verify the capabilities */ > + cap_idx.type =3D RTE_CRYPTO_SYM_XFORM_CIPHER; > + cap_idx.algo.cipher =3D RTE_CRYPTO_CIPHER_AES_XTS; > + if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0], > + &cap_idx) =3D=3D NULL) > + return TEST_SKIPPED; > + rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); > + feat_flags =3D dev_info.feature_flags; > + if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) { > + printf("Device doesn't support in-place scatter-gather. " > + "Test Skipped.\n"); > + return TEST_SKIPPED; > + } > + if ((global_api_test_type =3D=3D CRYPTODEV_RAW_API_TEST) && > + (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) > { > + printf("Device doesn't support RAW data-path APIs.\n"); > + return TEST_SKIPPED; > + } > + if (gbl_action_type =3D=3D RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) > + return TEST_SKIPPED; > + /* Create mlx5 session */ > + retval =3D create_wireless_algo_cipher_session(ts_params- > >valid_devs[0], > + RTE_CRYPTO_CIPHER_OP_ENCRYPT, > + RTE_CRYPTO_CIPHER_AES_XTS, > + tdata->key.data, tdata->key.len, > + tdata->cipher_iv.len, 0); > + if (retval < 0) > + return retval; > + plaintext_len =3D ceil_byte_length(tdata->plaintext.len); > + /* Append data which is padded to a multiple */ > + /* of the algorithms block size */ > + plaintext_pad_len =3D RTE_ALIGN_CEIL(plaintext_len, 8); > + ut_params->ibuf =3D create_segmented_mbuf(ts_params->mbuf_pool, > + plaintext_pad_len, 8, 0); > + if (unlikely(ut_params->ibuf =3D=3D NULL)) > + return -ENOMEM; > + pktmbuf_write(ut_params->ibuf, 0, plaintext_len, tdata- > >plaintext.data); > + debug_hexdump(stdout, "plaintext:", tdata->plaintext.data, > + plaintext_len); > + /* Create mlx5 operation */ > + retval =3D create_wireless_algo_cipher_operation(tdata- > >cipher_iv.data, > + tdata->cipher_iv.len, (tdata->cipher.len_bits), > + (tdata->cipher.offset_bits)); > + if (retval < 0) > + return retval; > + if (global_api_test_type =3D=3D CRYPTODEV_RAW_API_TEST) > + process_sym_raw_dp_op(ts_params->valid_devs[0], 0, > + ut_params->op, 1, 0, 1, tdata->cipher_iv.len); > + else > + ut_params->op =3D process_crypto_request(ts_params- > >valid_devs[0], > + ut_params->op); > + TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); > + ut_params->obuf =3D ut_params->op->sym->m_dst; > + if (ut_params->obuf) > + ciphertext =3D rte_pktmbuf_read(ut_params->obuf, 0, > + plaintext_len, buffer); > + else > + ciphertext =3D rte_pktmbuf_read(ut_params->ibuf, > + tdata->cipher.offset_bits, > + plaintext_len, buffer); > + if (unlikely(ciphertext =3D=3D NULL)) > + return -ENOMEM; > + /* Validate obuf */ > + debug_hexdump(stdout, "ciphertext:", ciphertext, plaintext_len); > + reference_ciphertext =3D tdata->ciphertext.data + > + tdata->cipher.offset_bits; > + /* Validate obuf */ > + TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( > + ciphertext, > + reference_ciphertext, > + tdata->validCipherLenInBits.len, > + "MLX5 Ciphertext data not as expected"); > + /* Validate stats */ > + TEST_ASSERT_SUCCESS(rte_cryptodev_stats_get(ts_params- > >valid_devs[0], > + &stats), > + "rte_cryptodev_stats_get failed"); > + TEST_ASSERT((stats.enqueued_count =3D=3D 1), > + "rte_cryptodev_stats_get returned unexpected enqueued > stat"); > + TEST_ASSERT((stats.dequeued_count =3D=3D 1), > + "rte_cryptodev_stats_get returned unexpected dequeued > stat"); > + TEST_ASSERT((stats.enqueue_err_count =3D=3D 0), > + "rte_cryptodev_stats_get returned error enqueued stat"); > + TEST_ASSERT((stats.dequeue_err_count =3D=3D 0), > + "rte_cryptodev_stats_get returned error dequeued stat"); > + return 0; > +} > + > +static int > +test_mlx5_decryption_sgl(const struct mlx5_test_data *tdata) > +{ > + struct crypto_testsuite_params *ts_params =3D &testsuite_params; > + struct crypto_unittest_params *ut_params =3D &unittest_params; > + struct rte_cryptodev_sym_capability_idx cap_idx; > + struct rte_cryptodev_stats stats; > + struct rte_cryptodev_info dev_info; > + uint8_t *ciphertext; > + const uint8_t *plaintext; > + const uint8_t *reference_plaintext; > + uint8_t buffer[10000]; > + uint64_t feat_flags; > + unsigned int ciphertext_pad_len; > + unsigned int ciphertext_len; > + int retval; > + > + rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); > + feat_flags =3D dev_info.feature_flags; > + if ((global_api_test_type =3D=3D CRYPTODEV_RAW_API_TEST) && > + (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) > { > + printf("Device doesn't support RAW data-path APIs.\n"); > + return -ENOTSUP; > + } > + if (gbl_action_type =3D=3D RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) > + return -ENOTSUP; > + /* Verify the capabilities */ > + cap_idx.type =3D RTE_CRYPTO_SYM_XFORM_CIPHER; > + cap_idx.algo.cipher =3D RTE_CRYPTO_CIPHER_AES_XTS; > + if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0], > + &cap_idx) =3D=3D NULL) > + return -ENOTSUP; > + /* Create mlx5 session */ > + retval =3D create_wireless_algo_cipher_session(ts_params- > >valid_devs[0], > + RTE_CRYPTO_CIPHER_OP_DECRYPT, > + RTE_CRYPTO_CIPHER_AES_XTS, > + tdata->key.data, tdata->key.len, > + tdata->cipher_iv.len, 0); > + if (retval < 0) > + return retval; > + ut_params->ibuf =3D rte_pktmbuf_alloc(ts_params->mbuf_pool); > + if (unlikely(ut_params->ibuf =3D=3D NULL)) > + return -ENOMEM; > + /* Clear mbuf payload */ > + memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, > + rte_pktmbuf_tailroom(ut_params->ibuf)); > + ciphertext_len =3D ceil_byte_length(tdata->ciphertext.len); > + /* Append data which is padded to a multiple */ > + /* of the algorithms block size */ > + ciphertext_pad_len =3D RTE_ALIGN_CEIL(ciphertext_len, 8); > + ciphertext =3D (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, > + ciphertext_pad_len); > + if (unlikely(ciphertext =3D=3D NULL)) > + return -ENOMEM; > + ut_params->ibuf =3D create_segmented_mbuf(ts_params->mbuf_pool, > + ciphertext_pad_len, 8, 0); > + if (unlikely(ut_params->ibuf =3D=3D NULL)) > + return -ENOMEM; > + pktmbuf_write(ut_params->ibuf, 0, ciphertext_len, > + tdata->ciphertext.data); > + memcpy(ciphertext, tdata->ciphertext.data, ciphertext_len); > + if (unlikely(ciphertext =3D=3D NULL)) > + return -ENOMEM; > + debug_hexdump(stdout, "ciphertext:", ciphertext, ciphertext_len); > + /* Create mlx5 operation */ > + retval =3D create_wireless_algo_cipher_operation(tdata- > >cipher_iv.data, > + tdata->cipher_iv.len, (tdata->cipher.len_bits), > + (tdata->cipher.offset_bits)); > + if (retval < 0) > + return retval; > + if (global_api_test_type =3D=3D CRYPTODEV_RAW_API_TEST) > + process_sym_raw_dp_op(ts_params->valid_devs[0], 0, > + ut_params->op, 1, 0, 1, 0); > + else > + ut_params->op =3D process_crypto_request(ts_params- > >valid_devs[0], > + ut_params->op); > + TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); > + ut_params->obuf =3D ut_params->op->sym->m_dst; > + if (ut_params->obuf) > + plaintext =3D rte_pktmbuf_read(ut_params->obuf, 0, > + ciphertext_len, buffer); > + else > + plaintext =3D rte_pktmbuf_read(ut_params->ibuf, > + tdata->cipher.offset_bits, > + ciphertext_len, buffer); > + debug_hexdump(stdout, "plaintext:", plaintext, ciphertext_len); > + reference_plaintext =3D tdata->plaintext.data + > + (tdata->cipher.offset_bits); > + /* Validate obuf */ > + TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT( > + plaintext, > + reference_plaintext, > + tdata->validCipherLenInBits.len, > + "MLX5 Plaintext data not as expected"); > + /* Validate stats */ > + TEST_ASSERT_SUCCESS(rte_cryptodev_stats_get(ts_params- > >valid_devs[0], > + &stats), > + "rte_cryptodev_stats_get failed"); > + TEST_ASSERT((stats.enqueued_count =3D=3D 1), > + "rte_cryptodev_stats_get returned unexpected enqueued > stat"); > + TEST_ASSERT((stats.dequeued_count =3D=3D 1), > + "rte_cryptodev_stats_get returned unexpected dequeued > stat"); > + TEST_ASSERT((stats.enqueue_err_count =3D=3D 0), > + "rte_cryptodev_stats_get returned error enqueued stat"); > + TEST_ASSERT((stats.dequeue_err_count =3D=3D 0), > + "rte_cryptodev_stats_get returned error dequeued stat"); > + return 0; > +} > + > + > static int > test_kasumi_encryption_test_case_1(void) > { > @@ -7345,6 +7558,54 @@ test_mlx5_decryption_test_case_4(void) > return test_mlx5_decryption(&mlx5_test_case_cipher_aes_xts_4); > } >=20 > +static int > +test_mlx5_encryption_test_case_1_sgl(void) > +{ > + return > test_mlx5_encryption_sgl(&mlx5_test_case_cipher_aes_xts_1); > +} > + > +static int > +test_mlx5_encryption_test_case_2_sgl(void) > +{ > + return > test_mlx5_encryption_sgl(&mlx5_test_case_cipher_aes_xts_2); > +} > + > +static int > +test_mlx5_encryption_test_case_3_sgl(void) > +{ > + return > test_mlx5_encryption_sgl(&mlx5_test_case_cipher_aes_xts_3); > +} > + > +static int > +test_mlx5_encryption_test_case_4_sgl(void) > +{ > + return > test_mlx5_encryption_sgl(&mlx5_test_case_cipher_aes_xts_4); > +} > + > +static int > +test_mlx5_decryption_test_case_1_sgl(void) > +{ > + return > test_mlx5_decryption_sgl(&mlx5_test_case_cipher_aes_xts_1); > +} > + > +static int > +test_mlx5_decryption_test_case_2_sgl(void) > +{ > + return > test_mlx5_decryption_sgl(&mlx5_test_case_cipher_aes_xts_2); > +} > + > +static int > +test_mlx5_decryption_test_case_3_sgl(void) > +{ > + return > test_mlx5_decryption_sgl(&mlx5_test_case_cipher_aes_xts_3); > +} > + > +static int > +test_mlx5_decryption_test_case_4_sgl(void) > +{ > + return > test_mlx5_decryption_sgl(&mlx5_test_case_cipher_aes_xts_4); > +} > + > static int > test_mixed_check_if_unsupported(const struct > mixed_cipher_auth_test_data *tdata) > { > @@ -14747,6 +15008,22 @@ static struct unit_test_suite > cryptodev_mlx5_testsuite =3D { > test_mlx5_encryption_test_case_3), > TEST_CASE_ST(ut_setup, ut_teardown, > test_mlx5_encryption_test_case_4), > + TEST_CASE_ST(ut_setup, ut_teardown, > + test_mlx5_decryption_test_case_1_sgl), > + TEST_CASE_ST(ut_setup, ut_teardown, > + test_mlx5_decryption_test_case_2_sgl), > + TEST_CASE_ST(ut_setup, ut_teardown, > + test_mlx5_decryption_test_case_3_sgl), > + TEST_CASE_ST(ut_setup, ut_teardown, > + test_mlx5_decryption_test_case_4_sgl), > + TEST_CASE_ST(ut_setup, ut_teardown, > + test_mlx5_encryption_test_case_1_sgl), > + TEST_CASE_ST(ut_setup, ut_teardown, > + test_mlx5_encryption_test_case_2_sgl), > + TEST_CASE_ST(ut_setup, ut_teardown, > + test_mlx5_encryption_test_case_3_sgl), > + TEST_CASE_ST(ut_setup, ut_teardown, > + test_mlx5_encryption_test_case_4_sgl), > TEST_CASES_END() > } > }; > diff --git a/app/test/test_cryptodev_mlx5_test_vectors.h > b/app/test/test_cryptodev_mlx5_test_vectors.h > index 2a05aa4626..db7e5fc744 100644 > --- a/app/test/test_cryptodev_mlx5_test_vectors.h > +++ b/app/test/test_cryptodev_mlx5_test_vectors.h > @@ -2496,7 +2496,4 @@ static struct mlx5_test_data > mlx5_test_case_cipher_aes_xts_4 =3D { > .dataunit_len =3D 0 > }; >=20 > - > - > - > #endif /*TEST_CRYPTODEV_MLX5_TEST_VECTORS_H_*/ > -- > 2.27.0