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 B5366A0524 for ; Fri, 5 Feb 2021 12:36:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9FF434067B; Fri, 5 Feb 2021 12:36:48 +0100 (CET) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mails.dpdk.org (Postfix) with ESMTP id CB2274067B for ; Fri, 5 Feb 2021 12:36:47 +0100 (CET) Received: by mail-wm1-f43.google.com with SMTP id f16so5739172wmq.5 for ; Fri, 05 Feb 2021 03:36:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=koeJXKzIXumsd4WS8rKi22pVpbAxPNB34ZSrabPxHeA=; b=ZQ11ylAPkFps44UWkcJdHH3Nd5m3LdN8/E2fIUmlwBeErZ8bgVKD0r9uK5fPDZG9z1 /5g1TR2p1E/pFRVPYoVJWTxD1Y3FWlKaMw73yuN2fxJ8prnh/h+yHVUjlRUNd4rvPbf0 kRLHmqiIljOwfXpC/DVoUjjQcVup9ZAxCF3w77s92jKcyfckVecSgLV5xJh79eyB9K8A NZp/8L9/KFoL1v0rF6O4PKJvbE/S8bAa8zFuGOeUAcJXlfaVDXiGn2vKnVp5/Z5Jie1t 09lqDL5F/SrtK5GwyD9mwkI7wn3ExMJJG7HDix7uI3qvHZnhQ4Mw4f1HS33EoX2WGIBy 6G/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=koeJXKzIXumsd4WS8rKi22pVpbAxPNB34ZSrabPxHeA=; b=IIfYbxBEJhKoFvOFYBC1mg5CF/jZ99ua4Dhvu4V5fKeFES60uv+/S00WDmk7HBD3Vk imgVjTqm0RZ75dCTR67YFTh7rg+DZKnKfno/jjYzSj61KlgzvsjYOuGQB9rjVE7yHGPW GaRhOWiHe05o35XI7lo5ZNM/zkS20MxqhUEQJgTSjztlROASwOT4wVJTyfs3xp0TppPk nNiPCh0TrLW8zRl5EorFZKMx4KaV9Ys1BmE5NYkQPuZgpBp0Ud6jpgSuy026vnh9vOo2 a0nKidX5ago5efRF3tIV351R3FQwkCqe9FZDVJKzRg96zeGJZ0fVMkvCOKSVQC7GfL7S 2AkA== X-Gm-Message-State: AOAM530VuNZzbA1xk0oTINaceci801jOzZYU2et8oyD6DRc2wGhmsrZj rZomoolw4Jv2OqPuKpEyG6s= X-Google-Smtp-Source: ABdhPJz4op2IsL6sszlcE5oqZ/9Pb2PzhBsAXfyoQ/nObQISqw12CljE5hqRwub5A0xUNkAeDE6VlA== X-Received: by 2002:a1c:7f83:: with SMTP id a125mr3144370wmd.141.1612525007599; Fri, 05 Feb 2021 03:36:47 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id k15sm8520014wmj.6.2021.02.05.03.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:36:46 -0800 (PST) From: luca.boccassi@gmail.com To: Fan Zhang Cc: dpdk stable Date: Fri, 5 Feb 2021 11:18:22 +0000 Message-Id: <20210205111920.1272063-216-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'crypto/qat: fix digest in buffer' has been queued to stable release 20.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/2b0467f2a39588ed78a27a05ba2f2ba136936f80 Thanks. Luca Boccassi --- >From 2b0467f2a39588ed78a27a05ba2f2ba136936f80 Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Wed, 20 Jan 2021 17:33:51 +0000 Subject: [PATCH] crypto/qat: fix digest in buffer [ upstream commit 7a13a3939dc82819e47bb89384dcad469ed7a61c ] This patch fixes the missed digest in buffer support to QAT symmetric raw API. Originally digest in buffer is supported only for wireless algorithms Fixes: 728c76b0e50f ("crypto/qat: support raw datapath API") Signed-off-by: Fan Zhang --- drivers/crypto/qat/qat_sym_hw_dp.c | 97 +++++++++++++++--------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/drivers/crypto/qat/qat_sym_hw_dp.c b/drivers/crypto/qat/qat_sym_hw_dp.c index dfbbad59b6..01afb883e3 100644 --- a/drivers/crypto/qat/qat_sym_hw_dp.c +++ b/drivers/crypto/qat/qat_sym_hw_dp.c @@ -558,55 +558,6 @@ enqueue_one_chain_job(struct qat_sym_session *ctx, case ICP_QAT_HW_AUTH_ALGO_KASUMI_F9: case ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3: auth_param->u1.aad_adr = auth_iv->iova; - - if (unlikely(n_data_vecs > 1)) { - int auth_end_get = 0, i = n_data_vecs - 1; - struct rte_crypto_vec *cvec = &data[0]; - uint32_t len; - - len = data_len - ofs.ofs.auth.tail; - - while (i >= 0 && len > 0) { - if (cvec->len >= len) { - auth_iova_end = cvec->iova + - (cvec->len - len); - len = 0; - auth_end_get = 1; - break; - } - len -= cvec->len; - i--; - cvec++; - } - - if (unlikely(auth_end_get == 0)) - return -1; - } else - auth_iova_end = data[0].iova + auth_param->auth_off + - auth_param->auth_len; - - /* Then check if digest-encrypted conditions are met */ - if ((auth_param->auth_off + auth_param->auth_len < - cipher_param->cipher_offset + - cipher_param->cipher_length) && - (digest->iova == auth_iova_end)) { - /* Handle partial digest encryption */ - if (cipher_param->cipher_offset + - cipher_param->cipher_length < - auth_param->auth_off + - auth_param->auth_len + - ctx->digest_length) - req->comn_mid.dst_length = - req->comn_mid.src_length = - auth_param->auth_off + - auth_param->auth_len + - ctx->digest_length; - struct icp_qat_fw_comn_req_hdr *header = - &req->comn_hdr; - ICP_QAT_FW_LA_DIGEST_IN_BUFFER_SET( - header->serv_specif_flags, - ICP_QAT_FW_LA_DIGEST_IN_BUFFER); - } break; case ICP_QAT_HW_AUTH_ALGO_GALOIS_128: case ICP_QAT_HW_AUTH_ALGO_GALOIS_64: @@ -615,6 +566,54 @@ enqueue_one_chain_job(struct qat_sym_session *ctx, break; } + if (unlikely(n_data_vecs > 1)) { + int auth_end_get = 0, i = n_data_vecs - 1; + struct rte_crypto_vec *cvec = &data[0]; + uint32_t len; + + len = data_len - ofs.ofs.auth.tail; + + while (i >= 0 && len > 0) { + if (cvec->len >= len) { + auth_iova_end = cvec->iova + len; + len = 0; + auth_end_get = 1; + break; + } + len -= cvec->len; + i--; + cvec++; + } + + if (unlikely(auth_end_get == 0)) + return -1; + } else + auth_iova_end = data[0].iova + auth_param->auth_off + + auth_param->auth_len; + + /* Then check if digest-encrypted conditions are met */ + if ((auth_param->auth_off + auth_param->auth_len < + cipher_param->cipher_offset + + cipher_param->cipher_length) && + (digest->iova == auth_iova_end)) { + /* Handle partial digest encryption */ + if (cipher_param->cipher_offset + + cipher_param->cipher_length < + auth_param->auth_off + + auth_param->auth_len + + ctx->digest_length) + req->comn_mid.dst_length = + req->comn_mid.src_length = + auth_param->auth_off + + auth_param->auth_len + + ctx->digest_length; + struct icp_qat_fw_comn_req_hdr *header = + &req->comn_hdr; + ICP_QAT_FW_LA_DIGEST_IN_BUFFER_SET( + header->serv_specif_flags, + ICP_QAT_FW_LA_DIGEST_IN_BUFFER); + } + return 0; } -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:38.732019688 +0000 +++ 0216-crypto-qat-fix-digest-in-buffer.patch 2021-02-05 11:18:29.170698042 +0000 @@ -1 +1 @@ -From 7a13a3939dc82819e47bb89384dcad469ed7a61c Mon Sep 17 00:00:00 2001 +From 2b0467f2a39588ed78a27a05ba2f2ba136936f80 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7a13a3939dc82819e47bb89384dcad469ed7a61c ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org