From patchwork Mon Jul 16 08:26:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 43117 X-Patchwork-Delegate: pablo.de.lara.guarch@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 15819255; Mon, 16 Jul 2018 18:32:29 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 975DB201; Mon, 16 Jul 2018 18:32:27 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2018 09:32:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,361,1526367600"; d="scan'208";a="246138744" Received: from silpixa00399466.ir.intel.com (HELO silpixa00399466.ger.corp.intel.com) ([10.237.223.220]) by fmsmga006.fm.intel.com with ESMTP; 16 Jul 2018 09:32:24 -0700 From: Pablo de Lara To: ankur.dwivedi@cavium.com, declan.doherty@intel.com Cc: dev@dpdk.org, Pablo de Lara , stable@dpdk.org Date: Mon, 16 Jul 2018 09:26:16 +0100 Message-Id: <20180716082616.1932-1-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.14.4 Subject: [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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 = 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 -= cparams->digest_length; if (cparams->do_cipher) {