From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730051.outbound.protection.outlook.com [40.107.73.51]) by dpdk.org (Postfix) with ESMTP id F2E8D160; Tue, 17 Jul 2018 07:42:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l3Qxu2tCrlISHjS2OREkzqspt1X5Ol5YJJotTtyfkqs=; b=hBG5ONnzuAMADTjbQubxK5E1+HfJETHFuhER0MwZ3WDB3qJ0t6i1wO3mLbVangrQ7fo/0IYJChf38TvWLq7hhYQSKoXWjYY3u5mvg2v2i9B2CkjdSJjiG6ObU2T5bz0mveTjKDNaI88D+zbhase40cUcDb9CPmJ8Xlb3RSfCgFc= Received: from DM5PR07MB3545.namprd07.prod.outlook.com (10.164.153.143) by DM5PR07MB2873.namprd07.prod.outlook.com (10.168.102.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.18; Tue, 17 Jul 2018 05:42:38 +0000 Received: from DM5PR07MB3545.namprd07.prod.outlook.com ([fe80::20f9:c987:c025:f7ea]) by DM5PR07MB3545.namprd07.prod.outlook.com ([fe80::20f9:c987:c025:f7ea%2]) with mapi id 15.20.0952.021; Tue, 17 Jul 2018 05:42:38 +0000 From: "Dwivedi, Ankur" To: Pablo de Lara , "declan.doherty@intel.com" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] examples/l2fwd-crypto: fix digest with AEAD algorithms Thread-Index: AQHUHSKWZLrK0NpWLk6fNpQkGY+i16SS51Tt Date: Tue, 17 Jul 2018 05:42:38 +0000 Message-ID: References: <20180716082616.1932-1-pablo.de.lara.guarch@intel.com> In-Reply-To: <20180716082616.1932-1-pablo.de.lara.guarch@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Ankur.Dwivedi@cavium.com; x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR07MB2873; 7:zZfgoKJFEhUXSnH9hZuR/4LdvBmXXiNqu7t84WtzSn2BlDZXiK1TPM/nYOn/LG/QEQfIfa5Y1l+8iwKshxYQrsPEzQK8uDKIXiag6e3d1qdnru59swJz6OhKRh9n1Gz58BdyCyo36lojR0/1ozJkvPlOM9prS3BQKJB2io83reb8Zd81vLmNej6TdqSNuiewf+LPpRadBOJTUyFWN5Zayy/O6kuFUtb3WqDT4Ad7uyEp8Pu/7Rp9OZ9B5+VcmBLn x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 8f67a821-c3be-4712-b0a5-08d5eba81b32 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:DM5PR07MB2873; x-ms-traffictypediagnostic: DM5PR07MB2873: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:DM5PR07MB2873; BCL:0; PCL:0; RULEID:; SRVR:DM5PR07MB2873; x-forefront-prvs: 073631BD3D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(366004)(346002)(396003)(136003)(199004)(189003)(18543002)(11346002)(186003)(4326008)(26005)(81156014)(476003)(86362001)(14454004)(486006)(25786009)(106356001)(102836004)(6436002)(8676002)(54896002)(446003)(9686003)(6606003)(55016002)(68736007)(2501003)(76176011)(55236004)(6506007)(8936002)(7696005)(66066001)(5250100002)(105586002)(53546011)(19627405001)(2900100001)(81166006)(97736004)(316002)(6246003)(72206003)(74316002)(14444005)(256004)(99286004)(478600001)(2906002)(53936002)(110136005)(6116002)(3846002)(54906003)(7736002)(5660300001)(33656002)(229853002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB2873; H:DM5PR07MB3545.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: rLBdbl5bXiTRYZUXnFsZd2Vr9IavrBS7Mw/x+B1kaNPVLchjn3/JGMZyB0VlYCVlhb2bEl7LZcG8j9jFhAuedYcsQy4CIga7xMpsUOBHNApxpAPU2k8z3k6uQuJWPwXWjeMzlYk0ZpzZfL5upGnMupShbpSwmFYZU4d5XNvddx/zvMvGIZLCBdwXd4AaTnKNizc1/Hk/qMSkwH4TUQdzS5MVRhY0woYGhe8wLOUtFj5GnOmoFIgnE8JnRHYhWU2d89VfqO3Tfk/gfz1Afvot8op761vSmTDl39X1M9gxmunrzQF2btQbkE35jTUdeLPtKWyoj5AWa7M22rUkkSD5eiq7udA4erNYtE/FWgxS8z8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f67a821-c3be-4712-b0a5-08d5eba81b32 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2018 05:42:38.4912 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB2873 X-Mailman-Approved-At: Wed, 18 Jul 2018 23:29:35 +0200 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] examples/l2fwd-crypto: fix digest with AEAD algorithms 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: , X-List-Received-Date: Tue, 17 Jul 2018 05:42:40 -0000 Hi Pablo, This patch solves the bug. Thanks Ankur ________________________________ From: Pablo de Lara Sent: Monday, July 16, 2018 1:56:16 PM To: Dwivedi, Ankur; declan.doherty@intel.com Cc: dev@dpdk.org; Pablo de Lara; stable@dpdk.org Subject: [PATCH] examples/l2fwd-crypto: fix digest with AEAD algorithms External Email When performing authentication verification (both for AEAD algorithms, such as AES-GCM, or for authentication algorithms, such as SHA1-HMAC), the digest address is calculated based on the packet size and the algorithm used (substracting digest size and IP header to the packet size). However, for AEAD algorithms, this was not calculated correctly, since the digest size was not being substracted. Signed-off-by: Pablo de Lara Bugzilla ID: 44 Fixes: 2661f4fbe93d ("examples/l2fwd-crypto: add AEAD parameters") Cc: stable@dpdk.org --- examples/l2fwd-crypto/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 9d6bb7857..9ac06a697 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -408,7 +408,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m, /* Zero pad data to be crypto'd so it is block aligned */ data_len =3D rte_pktmbuf_data_len(m) - ipdata_offset; - if (cparams->do_hash && cparams->hash_verify) + if ((cparams->do_hash || cparams->do_aead) && cparams->hash_verify) data_len -=3D cparams->digest_length; if (cparams->do_cipher) { -- 2.14.4