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 C868CA0350 for ; Mon, 28 Feb 2022 22:21:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C304440140; Mon, 28 Feb 2022 22:21:46 +0100 (CET) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mails.dpdk.org (Postfix) with ESMTP id B998D40140 for ; Mon, 28 Feb 2022 22:21:43 +0100 (CET) Received: by mail-ed1-f46.google.com with SMTP id q17so19410177edd.4 for ; Mon, 28 Feb 2022 13:21:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7P1I8LEI5cwikGcMd7BJmv3tCeTzYmtxQRjvYYK/GM8=; b=OwBHj+LfSbchhD7w2KDS/HPGMX+dB4YElEF9wgv7f5WFaj7L5L+FvDjX7Ew7bInQcR gknzSB5YnnlXXZcHcmn+aOjBgcqc+GUTkQQFMX7Qx1Xaw+vjxX8hXGndCMXuh0dDlH9s sRETkeKEqfmByyjQEVN1I/k2PIHbMqwfkoUCk7CU7DIH6lfeOHQZGCv0ZQLygtx1cqAJ Yq1SjF3lF0YOn5y4RT6ZsAG41GyRUU3W46O8Npcs3VKwXQ45wb/ALfB73rh5SCaHUWES d1L0iTt4hs3/tUoA5bkQ+7m1JEQYLsCpmvRBhxV1bAsgmubLMwsKGQHfngsPh2u9/XWS RZqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7P1I8LEI5cwikGcMd7BJmv3tCeTzYmtxQRjvYYK/GM8=; b=0UmvhzCURJaMSzIMDVSO8KXPQClv88SN4W5iz6mR6qthrEbAcu5hztrNn2COwU+ss8 m2EmFctZ9L3cFTN2tUT+dl4d+XbDYBtr4KC1ITCHosJbvME56lrSI6PW13bkFzQGpaWY aFi8yW5BSWOoud5NmIyBy541PFRsjfmqtuevZt3SOBXjjvDKk6SEqGBRhcLwxoZUlPBt sEbEtSYZ3VR7qLb4pMhF6T7j9+HF4l0sJ/Ttc82eZ4yB1kobp1zF1keXdsGGSXEWgT83 jL8wyLu4xaWBpXyw6j++1hBGCBCPkdhiVOPcbjI6+I0moGdDGn/eaSPKiaZwGZl97MMQ UVQQ== X-Gm-Message-State: AOAM530tdNlIsi0zMlxfIqJJWRMLYTvUwPoWRpVVG/7DLqi6ZygTJdVy 9hN0fUWfNSPJ+frQw3gfh6bNYW+o+OxVFw== X-Google-Smtp-Source: ABdhPJxP7XsqKo7LxpvqOTEeolFaSoYyahWgXnbjjYws3AnmJg9jx/4ELNnUdVSTNpLQGlq3PK62Lw== X-Received: by 2002:a05:6402:27d4:b0:412:b81a:b2dc with SMTP id c20-20020a05640227d400b00412b81ab2dcmr21279647ede.87.1646083303470; Mon, 28 Feb 2022 13:21:43 -0800 (PST) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id mu3-20020a1709068a8300b006ce8c135e10sm4601281ejc.219.2022.02.28.13.21.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 13:21:42 -0800 (PST) From: luca.boccassi@gmail.com To: Pablo de Lara Cc: dpdk stable Subject: patch 'crypto/ipsec_mb: fix ZUC operation overwrite' has been queued to stable release 20.11.5 Date: Mon, 28 Feb 2022 21:20:16 +0000 Message-Id: <20220228212047.3341966-20-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220228212047.3341966-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-122-luca.boccassi@gmail.com> <20220228212047.3341966-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 20.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/02/22. 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/92d7cb4446e4538032aa22546416ad4a05bb8e03 Thanks. Luca Boccassi --- >From 92d7cb4446e4538032aa22546416ad4a05bb8e03 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Wed, 23 Feb 2022 16:01:15 +0000 Subject: [PATCH] crypto/ipsec_mb: fix ZUC operation overwrite [ upstream commit 96d0dc2a3cd21d6f392347ae1d2ff3c21e27231a ] ZUC PMD batches crypto operations depending on their type (encryption + tag generation, tag verification + decryption, etc), to allow parallelization. The array used to store the pointers to these operations was always the same array provided by dequeue_burst() function, and it was looping around the same positions (from 0 to ZUC_MAX_BURST - 1). A new internal array is used to avoid overwriting the pointers of the array provided by dequeue_burst() function. Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library") Signed-off-by: Pablo de Lara --- drivers/crypto/zuc/rte_zuc_pmd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c index c1eb42754d..2f8a34e4f1 100644 --- a/drivers/crypto/zuc/rte_zuc_pmd.c +++ b/drivers/crypto/zuc/rte_zuc_pmd.c @@ -358,11 +358,11 @@ static uint16_t zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, uint16_t nb_ops) { - struct rte_crypto_op *c_ops[ZUC_MAX_BURST]; struct rte_crypto_op *curr_c_op; struct zuc_session *curr_sess; struct zuc_session *sessions[ZUC_MAX_BURST]; + struct rte_crypto_op *int_c_ops[ZUC_MAX_BURST]; enum zuc_operation prev_zuc_op = ZUC_OP_NOT_SUPPORTED; enum zuc_operation curr_zuc_op; struct zuc_qp *qp = queue_pair; @@ -389,11 +389,11 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, */ if (burst_size == 0) { prev_zuc_op = curr_zuc_op; - c_ops[0] = curr_c_op; + int_c_ops[0] = curr_c_op; sessions[0] = curr_sess; burst_size++; } else if (curr_zuc_op == prev_zuc_op) { - c_ops[burst_size] = curr_c_op; + int_c_ops[burst_size] = curr_c_op; sessions[burst_size] = curr_sess; burst_size++; /* @@ -401,7 +401,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, * process them, and start a new batch. */ if (burst_size == ZUC_MAX_BURST) { - processed_ops = process_ops(c_ops, curr_zuc_op, + processed_ops = process_ops(int_c_ops, curr_zuc_op, sessions, qp, burst_size, &enqueued_ops); if (processed_ops < burst_size) { @@ -416,7 +416,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, * Different operation type, process the ops * of the previous type. */ - processed_ops = process_ops(c_ops, prev_zuc_op, + processed_ops = process_ops(int_c_ops, prev_zuc_op, sessions, qp, burst_size, &enqueued_ops); if (processed_ops < burst_size) { @@ -427,7 +427,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, burst_size = 0; prev_zuc_op = curr_zuc_op; - c_ops[0] = curr_c_op; + int_c_ops[0] = curr_c_op; sessions[0] = curr_sess; burst_size++; } @@ -435,7 +435,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, if (burst_size != 0) { /* Process the crypto ops of the last operation type. */ - processed_ops = process_ops(c_ops, prev_zuc_op, + processed_ops = process_ops(int_c_ops, prev_zuc_op, sessions, qp, burst_size, &enqueued_ops); } -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-28 21:17:55.601964414 +0000 +++ 0020-crypto-ipsec_mb-fix-ZUC-operation-overwrite.patch 2022-02-28 21:17:53.860929669 +0000 @@ -1 +1 @@ -From 96d0dc2a3cd21d6f392347ae1d2ff3c21e27231a Mon Sep 17 00:00:00 2001 +From 92d7cb4446e4538032aa22546416ad4a05bb8e03 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 96d0dc2a3cd21d6f392347ae1d2ff3c21e27231a ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -21,2 +22,2 @@ - drivers/crypto/ipsec_mb/pmd_zuc.c | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) + drivers/crypto/zuc/rte_zuc_pmd.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) @@ -24,5 +25,10 @@ -diff --git a/drivers/crypto/ipsec_mb/pmd_zuc.c b/drivers/crypto/ipsec_mb/pmd_zuc.c -index 07cf1462d2..e36c7092d6 100644 ---- a/drivers/crypto/ipsec_mb/pmd_zuc.c -+++ b/drivers/crypto/ipsec_mb/pmd_zuc.c -@@ -259,6 +259,7 @@ zuc_pmd_dequeue_burst(void *queue_pair, +diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c +index c1eb42754d..2f8a34e4f1 100644 +--- a/drivers/crypto/zuc/rte_zuc_pmd.c ++++ b/drivers/crypto/zuc/rte_zuc_pmd.c +@@ -358,11 +358,11 @@ static uint16_t + zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, + uint16_t nb_ops) + { +- struct rte_crypto_op *c_ops[ZUC_MAX_BURST]; + struct rte_crypto_op *curr_c_op; @@ -33,4 +39,4 @@ - enum ipsec_mb_operation prev_zuc_op = IPSEC_MB_OP_NOT_SUPPORTED; - enum ipsec_mb_operation curr_zuc_op; - struct ipsec_mb_qp *qp = queue_pair; -@@ -290,11 +291,11 @@ zuc_pmd_dequeue_burst(void *queue_pair, + enum zuc_operation prev_zuc_op = ZUC_OP_NOT_SUPPORTED; + enum zuc_operation curr_zuc_op; + struct zuc_qp *qp = queue_pair; +@@ -389,11 +389,11 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, @@ -50 +56 @@ -@@ -302,7 +303,7 @@ zuc_pmd_dequeue_burst(void *queue_pair, +@@ -401,7 +401,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, @@ -56 +62,2 @@ - sessions, qp, burst_size); + sessions, qp, burst_size, + &enqueued_ops); @@ -58,2 +65 @@ - burst_size = 0; -@@ -316,7 +317,7 @@ zuc_pmd_dequeue_burst(void *queue_pair, +@@ -416,7 +416,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, @@ -65 +71,2 @@ - sessions, qp, burst_size); + sessions, qp, burst_size, + &enqueued_ops); @@ -67,2 +74 @@ - burst_size = 0; -@@ -326,7 +327,7 @@ zuc_pmd_dequeue_burst(void *queue_pair, +@@ -427,7 +427,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, @@ -77 +83 @@ -@@ -334,7 +335,7 @@ zuc_pmd_dequeue_burst(void *queue_pair, +@@ -435,7 +435,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, @@ -83 +89,2 @@ - sessions, qp, burst_size); + sessions, qp, burst_size, + &enqueued_ops); @@ -85 +91,0 @@ -