From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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: , X-List-Received-Date: Mon, 16 Jul 2018 16:32:28 -0000 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) { -- 2.14.4