From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id C93FE1B10C for ; Mon, 14 Jan 2019 23:17:55 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 630A82212D; Mon, 14 Jan 2019 17:17:55 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 14 Jan 2019 17:17:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=lGSzWcoWXxAnWqUZeeh4jiZsYNHVNu09pMTvS+xch5o=; b=kFg+ZmHtymfl ZkjbCyDtKa6ZY2KRT73Z6dhD7ZtbPYnvg1hmp9v6RYmOn/eineRlPC2w+CMxpAto BUqT8HbE3Z4HMcYjxnT15BmHcEPvJskabB6WswwXQiSg1H8/fju4PAQnp+3Mnl+F PSkdGVea5FXgc0Q+wkC9rNmYsBQuvIU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=lGSzWcoWXxAnWqUZeeh4jiZsYNHVNu09pMTvS+xch 5o=; b=YKsr6+osY4yMZ9npLK31YmoaHbr8eUbGK9P0/qkw0sxO7txFw3szMhkhd Jm/bwt0cbCJWT5VvD+2ZgJIxo/iZrGX94ic90bbvSIrsd556+XQqTY1VJbhtWJnu d2AbBSM1encQn/Cw5XsAhTj6irOJVAzGEX4yqa5LCNu5xml0sRncJWDQrblpPvAU UfqeQ+HUCVdXf6TyfU6zHc93rQ9qELaq7RZiEPauIHeoKvH98TM/vaL3HCS+POsK 6FgSCcIXtwYebiNGYUpkzvpOKT2UHXq5s3o4dzs0xJ2VBKXFFEfcpYeFPmDsMm4g KS5FogeGUk/3z9NpoFm3rUHqr05Wg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrgedugdduheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjg hfggfgtgesthhqredttddtudenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcu oehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucffohhmrghinhepughpughkrd horhhgnecukfhppeejjedrudefgedrvddtfedrudekgeenucfrrghrrghmpehmrghilhhf rhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhushhtvghrufhiii gvpedt X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D85C310085; Mon, 14 Jan 2019 17:17:53 -0500 (EST) From: Thomas Monjalon To: Konstantin Ananyev Cc: dev@dpdk.org, akhil.goyal@nxp.com Date: Mon, 14 Jan 2019 23:17:52 +0100 Message-ID: <1875496.bnsbQ71OuB@xps> In-Reply-To: <1547481483-25978-1-git-send-email-konstantin.ananyev@intel.com> References: <1547481483-25978-1-git-send-email-konstantin.ananyev@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: Re: [dpdk-dev] [PATCH] ipsec: fix compilation problem 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, 14 Jan 2019 22:17:56 -0000 14/01/2019 16:58, Konstantin Ananyev: > gcc 6.2 and 6.4 fails to compile lib/librte_ipsec/sa.c > with the following errors: > /local/kananye1/dpdk.org/lib/librte_ipsec/sa.c: > In function =E2inline_outb_tun_pkt_process=E2: > dpdk.org/x86_64-native-linuxapp-gcc/include/rte_memcpy.h:337:2: > error: array subscript is above array bounds [-Werror=3Darray-bounds] > rte_mov32((uint8_t *)dst + 1 * 32, (const uint8_t *)src + 1 * 32); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ... >=20 > It complains about the following lines of code: > esp_outb_tun_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t > .... > /* update spi, seqn and iv */ > esph =3D (struct esp_hdr *)(ph + sa->hdr_len); > iv =3D (uint64_t *)(esph + 1); > rte_memcpy(iv, ivp, sa->iv_len); >=20 > While I believe it is a false positive, > it is too excessive to use rte_memcpy() here, > as IV length could be only 0/8/16 bytes. > So introduce small helper function to copy IV and use it > instead of rte_memcpy(). >=20 > Fixes: 4d7ea3e1459b ("ipsec: implement SA data-path API") > Signed-off-by: Konstantin Ananyev Applied, thanks