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 6208CA00C5; Mon, 6 Jul 2020 20:35:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 94EE11DC21; Mon, 6 Jul 2020 20:35:11 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id E28621DC09 for ; Mon, 6 Jul 2020 20:35:08 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BDF68200725; Mon, 6 Jul 2020 20:35:08 +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 117CA200541; Mon, 6 Jul 2020 20:35:07 +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 AFE49402F0; Tue, 7 Jul 2020 02:35:04 +0800 (SGT) From: Akhil Goyal To: dev@dpdk.org, hemant.agrawal@nxp.com Cc: Akhil Goyal Date: Tue, 7 Jul 2020 00:04:58 +0530 Message-Id: <20200706183500.29862-2-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200706183500.29862-1-akhil.goyal@nxp.com> References: <20200706183500.29862-1-akhil.goyal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/4] crypto/dpaa2_sec: fix HFN override 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" HFN is set as a uint32_t but the value retrieved is uint8_t. Fixed the type casting to get the correct value. Signed-off-by: Akhil Goyal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index c56fb2152..109e61ae1 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. - * Copyright 2016-2019 NXP + * Copyright 2016-2020 NXP * */ @@ -164,7 +164,8 @@ build_proto_compound_sg_fd(dpaa2_sec_session *sess, * mbuf priv after sym_op. */ if (sess->ctxt_type == DPAA2_SEC_PDCP && sess->pdcp.hfn_ovd) { - uint32_t hfn_ovd = *((uint8_t *)op + sess->pdcp.hfn_ovd_offset); + uint32_t hfn_ovd = *(uint32_t *)((uint8_t *)op + + sess->pdcp.hfn_ovd_offset); /*enable HFN override override */ DPAA2_SET_FLE_INTERNAL_JD(ip_fle, hfn_ovd); DPAA2_SET_FLE_INTERNAL_JD(op_fle, hfn_ovd); @@ -239,7 +240,8 @@ build_proto_compound_fd(dpaa2_sec_session *sess, * mbuf priv after sym_op. */ if (sess->ctxt_type == DPAA2_SEC_PDCP && sess->pdcp.hfn_ovd) { - uint32_t hfn_ovd = *((uint8_t *)op + sess->pdcp.hfn_ovd_offset); + uint32_t hfn_ovd = *(uint32_t *)((uint8_t *)op + + sess->pdcp.hfn_ovd_offset); /*enable HFN override override */ DPAA2_SET_FLE_INTERNAL_JD(ip_fle, hfn_ovd); DPAA2_SET_FLE_INTERNAL_JD(op_fle, hfn_ovd); -- 2.17.1