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 B55C3A00BE; Mon, 6 Jul 2020 07:37:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 494081D6B4; Mon, 6 Jul 2020 07:36:59 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id C07991D621 for ; Mon, 6 Jul 2020 07:36:54 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9816B20150B; Mon, 6 Jul 2020 07:36:54 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id DF0E52003E5; Mon, 6 Jul 2020 07:36:52 +0200 (CEST) Received: from lsv03273.swis.in-blr01.nxp.com (lsv03273.swis.in-blr01.nxp.com [92.120.147.113]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 87B09402F0; Mon, 6 Jul 2020 13:36:50 +0800 (SGT) From: Akhil Goyal To: dev@dpdk.org Cc: hemant.agrawal@nxp.com, Akhil Goyal Date: Mon, 6 Jul 2020 11:06:47 +0530 Message-Id: <20200706053648.13271-3-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706053648.13271-1-akhil.goyal@nxp.com> References: <20200706052142.12116-2-akhil.goyal@nxp.com> <20200706053648.13271-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3 2/3] test/crypto: update PDCP HFN scenarios X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" As per current framework of PDCP testing, app can only support either HFN override or fixed session HFN values but not both. Now to enable both, either we duplicate all PDCP cases(>100) for both override and fixed HFN. It will look clumsy as the number of cases will be very high without much value addition. Now to overcome this, we can do HFN override for Downlink cases and fixed HFN for uplink cases. This way we will not loose the test coverage and there will not be duplicacy in the test cases. Signed-off-by: Akhil Goyal --- app/test/test_cryptodev.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index f1c11bcd8..d63958ddd 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -7161,7 +7161,9 @@ test_pdcp_proto(int i, int oop, ut_params->cipher_xform.cipher.key.data = pdcp_test_crypto_key[i]; ut_params->cipher_xform.cipher.key.length = pdcp_test_params[i].cipher_key_len; - ut_params->cipher_xform.cipher.iv.length = 0; + ut_params->cipher_xform.cipher.iv.length = + pdcp_test_packet_direction[i] ? 4 : 0; + ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET; /* Setup HMAC Parameters if ICV header is required */ if (pdcp_test_params[i].auth_alg != 0) { @@ -7186,8 +7188,18 @@ test_pdcp_proto(int i, int oop, .domain = pdcp_test_params[i].domain, .pkt_dir = pdcp_test_packet_direction[i], .sn_size = pdcp_test_data_sn_size[i], - .hfn = pdcp_test_hfn[i], + .hfn = pdcp_test_packet_direction[i] ? + 0 : pdcp_test_hfn[i], + /** + * hfn can be set as pdcp_test_hfn[i] + * if hfn_ovrd is not set. Here, PDCP + * packet direction is just used to + * run half of the cases with session + * HFN and other half with per packet + * HFN. + */ .hfn_threshold = pdcp_test_hfn_threshold[i], + .hfn_ovrd = pdcp_test_packet_direction[i] ? 1 : 0, } }, .crypto_xform = &ut_params->cipher_xform }; @@ -7214,6 +7226,10 @@ test_pdcp_proto(int i, int oop, goto on_err; } + uint32_t *per_pkt_hfn = rte_crypto_op_ctod_offset(ut_params->op, + uint32_t *, IV_OFFSET); + *per_pkt_hfn = pdcp_test_packet_direction[i] ? pdcp_test_hfn[i] : 0; + rte_security_attach_session(ut_params->op, ut_params->sec_session); /* set crypto operation source mbuf */ @@ -7445,6 +7461,7 @@ test_pdcp_proto_SGL(int i, int oop, .sn_size = pdcp_test_data_sn_size[i], .hfn = pdcp_test_hfn[i], .hfn_threshold = pdcp_test_hfn_threshold[i], + .hfn_ovrd = 0, } }, .crypto_xform = &ut_params->cipher_xform }; -- 2.17.1