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 6558B428DA; Thu, 6 Apr 2023 16:21:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A90142D0E; Thu, 6 Apr 2023 16:21:21 +0200 (CEST) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) by mails.dpdk.org (Postfix) with ESMTP id 7D5CB41153 for ; Thu, 6 Apr 2023 16:21:19 +0200 (CEST) Received: by mail-qv1-f54.google.com with SMTP id m16so28332961qvi.12 for ; Thu, 06 Apr 2023 07:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680790879; x=1683382879; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=0N1PIEAX1bdG+6UtIsvXD1knbRP5yIdkUUD9EcK5Bvs=; b=fiazDOAkxzECPFjpuAQiWIoYD7pjZG5B8OfmGnKnoQ2Y6/+CspjwNlTwcD7mrZ58Lc GyeZodH8VCgvKWyjYvu4TglYpaY+5LMLpdeMnLpPaMoiFmHO1BkEcwEVEcgqhpxYcnBJ +zwCwSThwmoXuaAXnggc6QA5WmL5xkqhzf53dy03gCLK/OTifVlyG/W5O9nHZ7Ki9ioN NmGv9Rc1B7tZAn+eoiFskH6tD6vFBiHLxhhEqlNF5fNJL7PKOYDYBNUoa7v4V5IEsoKX /30s4FMpj53fRX2Jb4fMk05PJ69YyF9MJA2Pl6hcKkSdIN+tNZom1F12ixsG/EMGh2Xy WNNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680790879; x=1683382879; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0N1PIEAX1bdG+6UtIsvXD1knbRP5yIdkUUD9EcK5Bvs=; b=ydz/xcFb4E5Z5YGEEwQm5aRPO2dyF5sPjdIjJnggKadNR/DA/1hsKMPEDbdi2uV6Qn SBb0ECFv/Nqvo8/ElX1v8eG4Ah/0V2zB5APP5H4ahRb9P/tVL4cjv30d8K5yBhuKWKFN pLlBW94xhNhhjPk5Jq244q9rMZgmKtgjc1YWqHmqL6/czIh1q0HfPCc2K6fl+DrM6NAH uvP09HW6dvoXhoKmqlve+j39gNwFd1r0V2U72p/2tk7pgLWawPIwtqiucyK6QjFND5g1 c0EvmTABkxRoyTk2MaegtvwVC83FWnJ7Txw2UVcPBoibZLo3FX3h0h/70HXP6B9UA8kR 7K1A== X-Gm-Message-State: AAQBX9f6m+tPFiUd35RhDnLVccmOsVvrKsbCQnhi/k9kW1rniSOSJPm7 UXKJuSwVzPkcVupbYTgDLf5CHj6X/n+OQQ== X-Google-Smtp-Source: AKy350Z+Y3LW5vpA300F6puq42M98UikhCYaAqod8/Mcq9YTAwyjfUfZbARjZqs9l56S8Eo10NBTyg== X-Received: by 2002:a05:6214:e6b:b0:5bb:eefc:1624 with SMTP id jz11-20020a0562140e6b00b005bbeefc1624mr4193607qvb.27.1680790878833; Thu, 06 Apr 2023 07:21:18 -0700 (PDT) Received: from [10.249.159.213] (nat-216-240-30-23.netapp.com. [216.240.30.23]) by smtp.gmail.com with ESMTPSA id j5-20020a056214022500b005dd8b93459esm549945qvt.54.2023.04.06.07.21.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Apr 2023 07:21:18 -0700 (PDT) Message-ID: Date: Thu, 6 Apr 2023 15:21:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] test/crypto: add cryptodev reconfig test Content-Language: en-US To: Aakash Sasidharan , Akhil Goyal Cc: jerinj@marvell.com, anoobj@marvell.com, dev@dpdk.org References: <20230405074117.2212923-1-asasidharan@marvell.com> From: "Zhang, Fan" In-Reply-To: <20230405074117.2212923-1-asasidharan@marvell.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 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. 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 > --- > 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,