From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 6A112A05D3 for ; Wed, 27 Mar 2019 12:53:46 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4FE2D1B293; Wed, 27 Mar 2019 12:53:39 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140078.outbound.protection.outlook.com [40.107.14.78]) by dpdk.org (Postfix) with ESMTP id 37C4C1B216; Wed, 27 Mar 2019 12:53:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uOXUsHosUGYhZXKk+zynO2vtGsASYeOIAQl0wqP+9k4=; b=F9R9LcMu0cbOumQFyVo8lR3w0FGABa95L/uDGiptqNAYQheD/t6aF687xkv8b6eykDfArurEFWsQblynFiETUkA5INL2WC2D1j568hByBzlx31kwwxJA5Mr0HjuDjnhWnyY5WP3fGyI/nvRvuvUba+PBsB8bx7kcC49E4kYSJ8A= Received: from VI1PR04MB4893.eurprd04.prod.outlook.com (20.177.49.154) by VI1PR04MB3261.eurprd04.prod.outlook.com (10.170.231.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.19; Wed, 27 Mar 2019 11:53:32 +0000 Received: from VI1PR04MB4893.eurprd04.prod.outlook.com ([fe80::d81a:c2cb:6bce:30bb]) by VI1PR04MB4893.eurprd04.prod.outlook.com ([fe80::d81a:c2cb:6bce:30bb%4]) with mapi id 15.20.1750.014; Wed, 27 Mar 2019 11:53:32 +0000 From: Akhil Goyal To: "dev@dpdk.org" CC: Hemant Agrawal , Akhil Goyal , "stable@dpdk.org" Thread-Topic: [PATCH 2/6] crypto/dpaa2_sec: fix offset calculation for gcm Thread-Index: AQHU5JOzDqHafYaOU0aWQj+5CUErwQ== Date: Wed, 27 Mar 2019 11:53:32 +0000 Message-ID: <20190327114407.13697-3-akhil.goyal@nxp.com> References: <20190327114407.13697-1-akhil.goyal@nxp.com> In-Reply-To: <20190327114407.13697-1-akhil.goyal@nxp.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BMXPR01CA0061.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:2c::25) To VI1PR04MB4893.eurprd04.prod.outlook.com (2603:10a6:803:56::26) x-mailer: git-send-email 2.17.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.120.1.68] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 26de1a24-03ed-46a6-bb13-08d6b2aad5c5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB3261; x-ms-traffictypediagnostic: VI1PR04MB3261: x-microsoft-antispam-prvs: x-forefront-prvs: 0989A7979C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(346002)(39860400002)(136003)(189003)(199004)(478600001)(6512007)(1076003)(52116002)(76176011)(44832011)(6486002)(50226002)(2501003)(14454004)(6916009)(36756003)(6436002)(305945005)(99286004)(7736002)(186003)(3846002)(2906002)(6116002)(97736004)(102836004)(25786009)(386003)(6506007)(26005)(4326008)(446003)(71190400001)(1730700003)(256004)(68736007)(8676002)(71200400001)(5660300002)(2616005)(476003)(316002)(11346002)(81156014)(486006)(8936002)(5640700003)(86362001)(2351001)(53936002)(66066001)(105586002)(106356001)(81166006)(54906003)(450100002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB3261; H:VI1PR04MB4893.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: zHOTP5gF5v3rnvBJmQqgh/0dOMtaDYFocD/iXdJjQN6yCOR/Qih4Kz9lc9+aQ5mWYR71ILUtcbJZY5HNvd634z9kWhy93R5DNQ1Ips2SWMRDlMqLOiCF0o2ojHSgG/lU+3bypzkiEbu4+BQbnNHLLqNnM0xcBm8UXeU/fRKH5FmPpFDmWCkVpQv1IBY0lYUkskrMnjmT8CMcPevAr+SDXJuAGK9u7FSl4hPIEFwSp7UfU73Jm9Dw+G7SsECyg3ApP6lZeAjKcceg5cu11umwKTG8gLMkRnJP1qBq/IXhdzjsEs5ZGVaNO6seQ+nmZBl8TfD8O7BGK5jboY0jO4dDd1GRIXkT82PoQUZRMLTmsIcvslJ1f1ll6r+JLrCcHQD7mTEZjZA83/SqM8PCaSuxmh2MExR62K2S7fD86q+k86Y= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26de1a24-03ed-46a6-bb13-08d6b2aad5c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2019 11:53:32.2985 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3261 Subject: [dpdk-dev] [PATCH 2/6] crypto/dpaa2_sec: fix offset calculation for gcm 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" Message-ID: <20190327115332.RBwm_BvaOINXPBvqODJwA-4p_xaeZbivVT-Bs4lJH5k@z> In case of gcm, output buffer should have aad space before the actual buffer which needs to be written. CAAM will not write into the aad anything, it will skip auth_only_len (aad) and write the buffer afterwards. Fixes: 37f96eb01bce ("crypto/dpaa2_sec: support scatter gather") Cc: stable@dpdk.org Signed-off-by: Akhil Goyal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/d= paa2_sec/dpaa2_sec_dpseci.c index d955ffc45..7e762d4b8 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -236,8 +236,8 @@ build_authenc_gcm_sg_fd(dpaa2_sec_session *sess, =20 /* Configure Output SGE for Encap/Decap */ DPAA2_SET_FLE_ADDR(sge, DPAA2_MBUF_VADDR_TO_IOVA(mbuf)); - DPAA2_SET_FLE_OFFSET(sge, mbuf->data_off + sym_op->aead.data.offset - - auth_only_len); + DPAA2_SET_FLE_OFFSET(sge, mbuf->data_off + + RTE_ALIGN_CEIL(auth_only_len, 16) - auth_only_len); sge->length =3D mbuf->data_len - sym_op->aead.data.offset + auth_only_len= ; =20 mbuf =3D mbuf->next; @@ -400,8 +400,8 @@ build_authenc_gcm_fd(dpaa2_sec_session *sess, =20 /* Configure Output SGE for Encap/Decap */ DPAA2_SET_FLE_ADDR(sge, DPAA2_MBUF_VADDR_TO_IOVA(dst)); - DPAA2_SET_FLE_OFFSET(sge, sym_op->aead.data.offset + - dst->data_off - auth_only_len); + DPAA2_SET_FLE_OFFSET(sge, dst->data_off + + RTE_ALIGN_CEIL(auth_only_len, 16) - auth_only_len); sge->length =3D sym_op->aead.data.length + auth_only_len; =20 if (sess->dir =3D=3D DIR_ENC) { --=20 2.17.1