From patchwork Thu Apr 8 08:49:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiri Kuzin X-Patchwork-Id: 90852 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4FC4FA0579; Thu, 8 Apr 2021 10:50:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 38E5814115D; Thu, 8 Apr 2021 10:50:19 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id E9B1314115D for ; Thu, 8 Apr 2021 10:50:16 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shirik@nvidia.com) with SMTP; 8 Apr 2021 11:50:13 +0300 Received: from nvidia.com (c-236-0-60-063.mtl.labs.mlnx [10.236.0.63]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 1388oClN019672; Thu, 8 Apr 2021 11:50:12 +0300 From: Shiri Kuzin To: dev@dpdk.org Cc: matan@nvidia.com, declan.doherty@intel.com Date: Thu, 8 Apr 2021 11:49:58 +0300 Message-Id: <20210408084958.4443-1-shirik@nvidia.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] examples/l2fwd-crypto: remove key size validation 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" In the example application the key can be provided by the user or generated randomly by the example application. Then a validation is done in order to check if the key size is supported in the algorithm capabilities. As a result of patch [1] application should support the case where a user supplies a wrapped key. In order to align with this patch and be able to use the app with wrapped keys, app should remove the validation of key size in the application and rely on a PMD key size validation. The validation is removed in case the key is provided by by user, and kept in case the key should be generated by the application. [1] https://www.mail-archive.com/dev@dpdk.org/msg201281.html Signed-off-by: Shiri Kuzin Acked-by: Matan Azrad --- examples/l2fwd-crypto/main.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index a96cb94cc4..5ae2569065 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -2111,13 +2111,11 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id) cap->sym.cipher.key_size.min, cap->sym.cipher.key_size.max, cap->sym.cipher.key_size.increment) - != 0) { + != 0) RTE_LOG(DEBUG, USER1, - "Device %u does not support cipher " - "key length\n", + "Key length does not match the device " + "%u capability\n", cdev_id); - return -1; - } /* * Check if length of the cipher key to be randomly generated * is supported by the algorithm chosen.