From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 3D6A5282 for ; Thu, 16 Feb 2017 08:59:22 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2017 23:59:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,168,1484035200"; d="scan'208";a="66443983" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga006.fm.intel.com with ESMTP; 15 Feb 2017 23:59:21 -0800 Date: Thu, 16 Feb 2017 16:01:38 +0800 From: Yuanhan Liu To: Pablo de Lara Cc: Fan Zhang , dpdk stable Message-ID: <20170216080138.GC20916@yliu-dev.sh.intel.com> References: <1487140012-13314-1-git-send-email-yuanhan.liu@linux.intel.com> <1487140012-13314-28-git-send-email-yuanhan.liu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1487140012-13314-28-git-send-email-yuanhan.liu@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-stable] patch 'examples/l2fwd-crypto: fix padding' has been queued to stable release 16.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 07:59:23 -0000 It introduced a build error. I will drop it. If you think this patch is still needed, please do the backport. examples/l2fwd-crypto/main.c: In function ‘l2fwd_simple_crypto_enqueue’: examples/l2fwd-crypto/main.c:467:8: error: ‘RTE_CRYPTO_CIPHER_DES_CBC’ undeclared (first use in this function) case RTE_CRYPTO_CIPHER_DES_CBC: ^ compilation terminated due to -Wfatal-errors. Thanks! --yliu On Wed, Feb 15, 2017 at 02:26:40PM +0800, Yuanhan Liu wrote: > Hi, > > FYI, your patch has been queued to stable release 16.11.1 > > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable > yet. It will be pushed if I get no objections before 02/18/17. > So please shout if anyone has objections. > > Thanks. > > --yliu > > --- > >From b672755e7af6f234c40e761335ebee2a2d78d1d2 Mon Sep 17 00:00:00 2001 > From: Pablo de Lara > Date: Thu, 9 Feb 2017 12:27:45 +0000 > Subject: [PATCH] examples/l2fwd-crypto: fix padding > > [ upstream commit 5839fd20e7323850f3a411d9b5642d914fa2d3f0 ] > > L2fwd-crypto app was padding an incoming buffer, > to be aligned with the algorithm block size, in all cases. > This was not the right approach, as padding is only necessary > when using block cipher algorithms, such as AES-CBC. > In case of using a stream cipher algorithm, such as SNOW3G UEA2, > there is no need to include padding and increase the buffer size. > > Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application") > > Signed-off-by: Pablo de Lara > Acked-by: Fan Zhang > --- > examples/l2fwd-crypto/main.c | 36 +++++++++++++++++++++++++++--------- > 1 file changed, 27 insertions(+), 9 deletions(-) > > diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c > index bc88be5..62ee933 100644 > --- a/examples/l2fwd-crypto/main.c > +++ b/examples/l2fwd-crypto/main.c > @@ -432,7 +432,8 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m, > struct ether_hdr *eth_hdr; > struct ipv4_hdr *ip_hdr; > > - unsigned ipdata_offset, pad_len, data_len; > + uint32_t ipdata_offset, data_len; > + uint32_t pad_len = 0; > char *padding; > > eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); > @@ -455,16 +456,33 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m, > if (cparams->do_hash && cparams->hash_verify) > data_len -= cparams->digest_length; > > - pad_len = data_len % cparams->block_size ? cparams->block_size - > - (data_len % cparams->block_size) : 0; > + if (cparams->do_cipher) { > + /* > + * Following algorithms are block cipher algorithms, > + * and might need padding > + */ > + switch (cparams->cipher_algo) { > + case RTE_CRYPTO_CIPHER_AES_CBC: > + case RTE_CRYPTO_CIPHER_AES_ECB: > + case RTE_CRYPTO_CIPHER_DES_CBC: > + case RTE_CRYPTO_CIPHER_3DES_CBC: > + case RTE_CRYPTO_CIPHER_3DES_ECB: > + if (data_len % cparams->block_size) > + pad_len = cparams->block_size - > + (data_len % cparams->block_size); > + break; > + default: > + pad_len = 0; > + } > > - if (pad_len) { > - padding = rte_pktmbuf_append(m, pad_len); > - if (unlikely(!padding)) > - return -1; > + if (pad_len) { > + padding = rte_pktmbuf_append(m, pad_len); > + if (unlikely(!padding)) > + return -1; > > - data_len += pad_len; > - memset(padding, 0, pad_len); > + data_len += pad_len; > + memset(padding, 0, pad_len); > + } > } > > /* Set crypto operation data parameters */ > -- > 1.9.0