From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 603BEA04DD for ; Wed, 28 Oct 2020 11:54:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5850FC9F6; Wed, 28 Oct 2020 11:54:17 +0100 (CET) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by dpdk.org (Postfix) with ESMTP id 40BB6C9F6 for ; Wed, 28 Oct 2020 11:54:15 +0100 (CET) Received: by mail-wr1-f41.google.com with SMTP id n15so5184649wrq.2 for ; Wed, 28 Oct 2020 03:54:15 -0700 (PDT) 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=3YzKsCx+5B26QfrxrfMJ1+arqZS4DbwrTSy4ZTIMuDU=; b=bbThDYSWG9ku8FBErNYzZlpOid+3XvtMGkJLiExqBicL+Pb7LR7hA57XJWcBQyWxoe ac+QGaEHJOpdyJuss35XrKHDhjSmHUk6xhI87tHt7JaIWNubAQgHKUTHdXBk7frbNJEh iLIJd/vVlUSDoxisO9jkc6b+Huq9pqS7BzBlDMfy4OaaftArbWS4KhfzcuO6Q/mkLJcB tFCIWGL/GSSf5K0ZcCflHtsp33RaIRZ7/hgZ5tw5BrKl/d+Yakn0e9TCg8jUfEf3DuES wyaBIfToN3bd6oTMsbncb8zjE/VrV/BnlgR+q968QbNNRdmPFHPDujjrkvJwVS2RvfpI CTMA== 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=3YzKsCx+5B26QfrxrfMJ1+arqZS4DbwrTSy4ZTIMuDU=; b=lgS0HGDqx9ZAkvjwayp0iFvNC2qAVZWMWI2SfN/fcw8FnhGWlL0QGFCTVpsOytv98a MZ1ZNJsqnkEkv7ZigefBTmrAvrF3SLH1Ya7pY+zJ3SyODG066X4gW0QAHr6DZDRc0y1F sKlOI8kNTfxg3YvXupsLlny69MLk9rd0btjlczVcwZyYF1H9DvsQAqWoc0if/w6T0HiP BF6Aw0u0tUjrrQUeO9zo9XmBHp368YYnwtlzpHvL+yDPUdPofdS/E8EuhRhTVqttSEyx Jql5sZidhVSfQ+lSetjWOsMCR7ReUubkYSmBKDSBybTXfED4xRtc70E8yCqTqh5XgLGP sdjw== X-Gm-Message-State: AOAM5308eRqlz4pKvKKazoJETgIo7woHtdTqeekn368jg48QylzQY3Ly IGnQiCaOTh+sHY87XB4Qe3I6Uvf4DRUov1mS X-Google-Smtp-Source: ABdhPJyCLpe+KkJNFYStObLnWRiuNwVy6EFE/Y/+OWPy3pKlmRR8Yre3v3ExkM1YLRxuaewIYlsLGQ== X-Received: by 2002:a5d:458c:: with SMTP id p12mr8083397wrq.329.1603882453977; Wed, 28 Oct 2020 03:54:13 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id l16sm6538241wrx.5.2020.10.28.03.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:54:13 -0700 (PDT) From: luca.boccassi@gmail.com To: Archana Muniganti Cc: Fan Zhang , Yu Jiang , dpdk stable Date: Wed, 28 Oct 2020 10:45:10 +0000 Message-Id: <20201028104606.3504127-151-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'examples/fips_validation: fix version compatibility' has been queued to stable release 19.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/20. 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. Thanks. Luca Boccassi --- >From 1184955296710562d30501b5457a1e24a7b7a04f Mon Sep 17 00:00:00 2001 From: Archana Muniganti Date: Wed, 9 Sep 2020 21:56:35 +0530 Subject: [PATCH] examples/fips_validation: fix version compatibility [ upstream commit 79365018409917a1bf3222cb3352d7c06a878e87 ] Separate out CAVS request file version 21.4 code to support lower versions. Fixes: 32440cdf2af9 ("examples/fips_validation: fix parsing of TDES vectors") Fixes: 2b84d2bd47df ("examples/fips_validation: fix count overwrite for TDES") Signed-off-by: Archana Muniganti Acked-by: Fan Zhang Tested-by: Yu Jiang --- examples/fips_validation/fips_validation.c | 40 ++++++++++++++++------ examples/fips_validation/fips_validation.h | 1 + examples/fips_validation/main.c | 6 ++-- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c index 778c734fb2..910f012e36 100644 --- a/examples/fips_validation/fips_validation.c +++ b/examples/fips_validation/fips_validation.c @@ -92,6 +92,15 @@ error_exit: return -ENOMEM; } +static void +fips_test_parse_version(void) +{ + int len = strlen(info.vec[0]); + char *ptr = info.vec[0]; + + info.version = strtof(ptr + len - 4, NULL); +} + static int fips_test_parse_header(void) { @@ -106,7 +115,10 @@ fips_test_parse_header(void) if (ret < 0) return ret; - for (i = 0; i < info.nb_vec_lines; i++) { + if (info.nb_vec_lines) + fips_test_parse_version(); + + for (i = 1; i < info.nb_vec_lines; i++) { if (!algo_parsed) { if (strstr(info.vec[i], "AESVS")) { algo_parsed = 1; @@ -346,6 +358,8 @@ fips_test_parse_one_case(void) uint32_t interim_cnt = 0; int ret; + info.vec_start_off = 0; + if (info.interim_callbacks) { for (i = 0; i < info.nb_vec_lines; i++) { is_interim = 0; @@ -367,17 +381,24 @@ fips_test_parse_one_case(void) } } - info.vec_start_off = interim_cnt; - if (interim_cnt) { - for (i = 0; i < interim_cnt; i++) - fprintf(info.fp_wr, "%s\n", info.vec[i]); - fprintf(info.fp_wr, "\n"); + if (info.version == 21.4f) { + for (i = 0; i < interim_cnt; i++) + fprintf(info.fp_wr, "%s\n", info.vec[i]); + fprintf(info.fp_wr, "\n"); - if (info.nb_vec_lines == interim_cnt) + if (info.nb_vec_lines == interim_cnt) + return 1; + } else { + for (i = 0; i < info.nb_vec_lines; i++) + fprintf(info.fp_wr, "%s\n", info.vec[i]); + fprintf(info.fp_wr, "\n"); return 1; + } } + info.vec_start_off = interim_cnt; + for (i = info.vec_start_off; i < info.nb_vec_lines; i++) { for (j = 0; info.callbacks[j].key != NULL; j++) if (strstr(info.vec[i], info.callbacks[j].key)) { @@ -642,7 +663,7 @@ update_info_vec(uint32_t count) cb = &info.writeback_callbacks[0]; - if (!(strstr(info.vec[0], cb->key))) { + if ((info.version == 21.4f) && (!(strstr(info.vec[0], cb->key)))) { fprintf(info.fp_wr, "%s%u\n", cb->key, count); i = 0; } else { @@ -650,9 +671,8 @@ update_info_vec(uint32_t count) count); i = 1; } - snprintf(info.vec[0], strlen(info.vec[0]) + 4, "%s%u", cb->key, count); - for (i = 1; i < info.nb_vec_lines; i++) { + for (; i < info.nb_vec_lines; i++) { for (j = 1; info.writeback_callbacks[j].key != NULL; j++) { cb = &info.writeback_callbacks[j]; if (strstr(info.vec[i], cb->key)) { diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h index fb0194d57b..295624b1b5 100644 --- a/examples/fips_validation/fips_validation.h +++ b/examples/fips_validation/fips_validation.h @@ -165,6 +165,7 @@ struct fips_test_interim_info { uint32_t nb_vec_lines; char device_name[MAX_STRING_SIZE]; char file_name[MAX_FILE_NAME_SIZE]; + float version; union { struct aesavs_interim_data aes_data; diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c index 693ad9b483..eadfdb4bac 100644 --- a/examples/fips_validation/main.c +++ b/examples/fips_validation/main.c @@ -1030,10 +1030,12 @@ fips_mct_tdes_test(void) int test_mode = info.interim_info.tdes_data.test_mode; for (i = 0; i < TDES_EXTERN_ITER; i++) { - if (i == 0) { + if ((i == 0) && (info.version == 21.4f)) { if (!(strstr(info.vec[0], "COUNT"))) fprintf(info.fp_wr, "%s%u\n", "COUNT = ", 0); - } else + } + + if (i != 0) update_info_vec(i); fips_test_write_one_case(); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:16.426311087 +0000 +++ 0151-examples-fips_validation-fix-version-compatibility.patch 2020-10-28 10:35:11.744833557 +0000 @@ -1,14 +1,15 @@ -From 79365018409917a1bf3222cb3352d7c06a878e87 Mon Sep 17 00:00:00 2001 +From 1184955296710562d30501b5457a1e24a7b7a04f Mon Sep 17 00:00:00 2001 From: Archana Muniganti Date: Wed, 9 Sep 2020 21:56:35 +0530 Subject: [PATCH] examples/fips_validation: fix version compatibility +[ upstream commit 79365018409917a1bf3222cb3352d7c06a878e87 ] + Separate out CAVS request file version 21.4 code to support lower versions. Fixes: 32440cdf2af9 ("examples/fips_validation: fix parsing of TDES vectors") Fixes: 2b84d2bd47df ("examples/fips_validation: fix count overwrite for TDES") -Cc: stable@dpdk.org Signed-off-by: Archana Muniganti Acked-by: Fan Zhang @@ -20,7 +21,7 @@ 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c -index 13f763c9aa..7454a03b16 100644 +index 778c734fb2..910f012e36 100644 --- a/examples/fips_validation/fips_validation.c +++ b/examples/fips_validation/fips_validation.c @@ -92,6 +92,15 @@ error_exit: @@ -51,7 +52,7 @@ if (!algo_parsed) { if (strstr(info.vec[i], "AESVS")) { algo_parsed = 1; -@@ -352,6 +364,8 @@ fips_test_parse_one_case(void) +@@ -346,6 +358,8 @@ fips_test_parse_one_case(void) uint32_t interim_cnt = 0; int ret; @@ -60,7 +61,7 @@ if (info.interim_callbacks) { for (i = 0; i < info.nb_vec_lines; i++) { is_interim = 0; -@@ -373,17 +387,24 @@ fips_test_parse_one_case(void) +@@ -367,17 +381,24 @@ fips_test_parse_one_case(void) } } @@ -91,7 +92,7 @@ for (i = info.vec_start_off; i < info.nb_vec_lines; i++) { for (j = 0; info.callbacks[j].key != NULL; j++) if (strstr(info.vec[i], info.callbacks[j].key)) { -@@ -648,7 +669,7 @@ update_info_vec(uint32_t count) +@@ -642,7 +663,7 @@ update_info_vec(uint32_t count) cb = &info.writeback_callbacks[0]; @@ -100,7 +101,7 @@ fprintf(info.fp_wr, "%s%u\n", cb->key, count); i = 0; } else { -@@ -656,9 +677,8 @@ update_info_vec(uint32_t count) +@@ -650,9 +671,8 @@ update_info_vec(uint32_t count) count); i = 1; } @@ -112,10 +113,10 @@ cb = &info.writeback_callbacks[j]; if (strstr(info.vec[i], cb->key)) { diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h -index deba83eada..ca8964aaa1 100644 +index fb0194d57b..295624b1b5 100644 --- a/examples/fips_validation/fips_validation.h +++ b/examples/fips_validation/fips_validation.h -@@ -166,6 +166,7 @@ struct fips_test_interim_info { +@@ -165,6 +165,7 @@ struct fips_test_interim_info { uint32_t nb_vec_lines; char device_name[MAX_STRING_SIZE]; char file_name[MAX_FILE_NAME_SIZE]; @@ -124,10 +125,10 @@ union { struct aesavs_interim_data aes_data; diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c -index 9e46307bb2..2a7a3fb5e0 100644 +index 693ad9b483..eadfdb4bac 100644 --- a/examples/fips_validation/main.c +++ b/examples/fips_validation/main.c -@@ -1088,10 +1088,12 @@ fips_mct_tdes_test(void) +@@ -1030,10 +1030,12 @@ fips_mct_tdes_test(void) int test_mode = info.interim_info.tdes_data.test_mode; for (i = 0; i < TDES_EXTERN_ITER; i++) {