DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anoob Joseph <anoobj@marvell.com>
To: "Zhang, Fan" <fanzhang.oss@gmail.com>
Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	Aakash Sasidharan <asasidharan@marvell.com>,
	Akhil Goyal <gakhil@marvell.com>
Subject: RE: [EXT] Re: [PATCH] test/crypto: add cryptodev reconfig test
Date: Mon, 10 Apr 2023 07:19:17 +0000	[thread overview]
Message-ID: <PH0PR18MB467262B1EC81BFD0FBD1B695DF959@PH0PR18MB4672.namprd18.prod.outlook.com> (raw)
In-Reply-To: <a8ca6699-4efc-0abc-4a6b-39795991fc1f@gmail.com>

Hi Fan,

Please see inline.

Thanks,
Anoob

> -----Original Message-----
> From: Zhang, Fan <fanzhang.oss@gmail.com>
> Sent: Thursday, April 6, 2023 7:51 PM
> To: Aakash Sasidharan <asasidharan@marvell.com>; Akhil Goyal
> <gakhil@marvell.com>
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> <anoobj@marvell.com>; dev@dpdk.org
> Subject: [EXT] Re: [PATCH] test/crypto: add cryptodev reconfig test
> 
> External Email
> 
> ----------------------------------------------------------------------
> Hi Aakash,
> 
> I really like the idea to create a test for device reconfiguration.
> 
> I am wondering if we need to test all PMDs against this patch first.

[Anoob] We have tested the patch with Marvell PMDs, crypto_cn9k & crypto_cn10k as well as with openSSL PMD, cryptodev_openssl. We can wait for few days to see if any PMD owner has any objections. 

Can you review the patch and see if it aligns with DPDK spec?

> 
> Regards,
> 
> Fan
> 
> On 4/5/2023 8:41 AM, Aakash Sasidharan wrote:
> > Add cryptodev tests to verify that the device supports reconfiguration
> > any number of times via rte_cryptodev_configure API.
> >
> > Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com>
> > ---
> >   app/test/test_cryptodev.c | 81
> +++++++++++++++++++++++++++++++++++++++
> >   1 file changed, 81 insertions(+)
> >
> > diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
> > index 9c670e9a35..3376ed91a3 100644
> > --- a/app/test/test_cryptodev.c
> > +++ b/app/test/test_cryptodev.c
> > @@ -12368,6 +12368,85 @@ test_stats(void)
> >   	return TEST_SUCCESS;
> >   }
> >
> > +static int
> > +test_device_reconfigure(void)
> > +{
> > +	struct crypto_testsuite_params *ts_params = &testsuite_params;
> > +	uint16_t orig_nb_qps = ts_params->conf.nb_queue_pairs;
> > +	struct rte_cryptodev_qp_conf qp_conf = {
> > +		.nb_descriptors = MAX_NUM_OPS_INFLIGHT,
> > +		.mp_session = ts_params->session_mpool
> > +	};
> > +	uint16_t qp_id, dev_id, num_devs = 0;
> > +
> > +	TEST_ASSERT((num_devs = rte_cryptodev_count()) >= 1,
> > +			"Need at least %d devices for test", 1);
> > +
> > +	dev_id = ts_params->valid_devs[0];
> > +
> > +	/* Stop the device in case it's started so it can be configured */
> > +	rte_cryptodev_stop(dev_id);
> > +
> > +	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id, &ts_params-
> >conf),
> > +			"Failed test for rte_cryptodev_configure: "
> > +			"dev_num %u", dev_id);
> > +
> > +	/* Reconfigure with same configure params */
> > +	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id, &ts_params-
> >conf),
> > +			"Failed test for rte_cryptodev_configure: "
> > +			"dev_num %u", dev_id);
> > +
> > +	/* Reconfigure with just one queue pair */
> > +	ts_params->conf.nb_queue_pairs = 1;
> > +
> > +	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params-
> >valid_devs[0],
> > +			&ts_params->conf),
> > +			"Failed to configure cryptodev: dev_id %u, qp_id %u",
> > +			ts_params->valid_devs[0], ts_params-
> >conf.nb_queue_pairs);
> > +
> > +	for (qp_id = 0; qp_id < ts_params->conf.nb_queue_pairs; qp_id++) {
> > +		TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
> > +				ts_params->valid_devs[0], qp_id, &qp_conf,
> > +				rte_cryptodev_socket_id(
> > +						ts_params->valid_devs[0])),
> > +				"Failed test for "
> > +				"rte_cryptodev_queue_pair_setup:
> num_inflights "
> > +				"%u on qp %u on cryptodev %u",
> > +				qp_conf.nb_descriptors, qp_id,
> > +				ts_params->valid_devs[0]);
> > +	}
> > +
> > +	/* Reconfigure with max number of queue pairs */
> > +	ts_params->conf.nb_queue_pairs = orig_nb_qps;
> > +
> > +	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params-
> >valid_devs[0],
> > +			&ts_params->conf),
> > +			"Failed to configure cryptodev: dev_id %u, qp_id %u",
> > +			ts_params->valid_devs[0], ts_params-
> >conf.nb_queue_pairs);
> > +
> > +	qp_conf.mp_session = ts_params->session_mpool;
> > +
> > +	for (qp_id = 0; qp_id < ts_params->conf.nb_queue_pairs; qp_id++) {
> > +		TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
> > +				ts_params->valid_devs[0], qp_id, &qp_conf,
> > +				rte_cryptodev_socket_id(
> > +						ts_params->valid_devs[0])),
> > +				"Failed test for "
> > +				"rte_cryptodev_queue_pair_setup:
> num_inflights "
> > +				"%u on qp %u on cryptodev %u",
> > +				qp_conf.nb_descriptors, qp_id,
> > +				ts_params->valid_devs[0]);
> > +	}
> > +
> > +	/* Start the device */
> > +	TEST_ASSERT_SUCCESS(rte_cryptodev_start(ts_params->valid_devs[0]),
> > +			"Failed to start cryptodev %u",
> > +			ts_params->valid_devs[0]);
> > +
> > +	/* Test expected values */
> > +	return test_AES_CBC_HMAC_SHA1_encrypt_digest();
> > +}
> > +
> >   static int MD5_HMAC_create_session(struct crypto_testsuite_params
> *ts_params,
> >   				   struct crypto_unittest_params *ut_params,
> >   				   enum rte_crypto_auth_operation op, @@ -
> 16022,6 +16101,8 @@
> > static struct unit_test_suite cryptodev_gen_testsuite  = {
> >   	.suite_name = "Crypto General Unit Test Suite",
> >   	.setup = crypto_gen_testsuite_setup,
> >   	.unit_test_cases = {
> > +		TEST_CASE_ST(ut_setup, ut_teardown,
> > +				test_device_reconfigure),
> >   		TEST_CASE_ST(ut_setup, ut_teardown,
> >   				test_device_configure_invalid_dev_id),
> >   		TEST_CASE_ST(ut_setup, ut_teardown,

  reply	other threads:[~2023-04-10  7:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05  7:41 Aakash Sasidharan
2023-04-06 14:21 ` Zhang, Fan
2023-04-10  7:19   ` Anoob Joseph [this message]
2023-04-18 13:29 ` Zhang, Fan
2023-04-19 13:37 ` O'Donovan, Saoirse
2023-05-03  7: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=PH0PR18MB467262B1EC81BFD0FBD1B695DF959@PH0PR18MB4672.namprd18.prod.outlook.com \
    --to=anoobj@marvell.com \
    --cc=asasidharan@marvell.com \
    --cc=dev@dpdk.org \
    --cc=fanzhang.oss@gmail.com \
    --cc=gakhil@marvell.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).