From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id DFA506CA8 for ; Wed, 5 Oct 2016 02:34:35 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 04 Oct 2016 17:34:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,446,1473145200"; d="scan'208";a="1066209636" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by fmsmga002.fm.intel.com with ESMTP; 04 Oct 2016 17:34:33 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.164]) by IRSMSX107.ger.corp.intel.com ([169.254.10.95]) with mapi id 14.03.0248.002; Wed, 5 Oct 2016 01:34:33 +0100 From: "De Lara Guarch, Pablo" To: "Gonzalez Monroy, Sergio" , "akhil.goyal@nxp.com" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] examples/ipsec-secgw: Update checksum while decrementing ttl Thread-Index: AQHSF/nrOQlLMCj+7028sGTT1byDWqCZECwA Date: Wed, 5 Oct 2016 00:34:31 +0000 Message-ID: References: <20160926163300.22990-1-akhil.goyal@nxp.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTEzODdiNmYtZjAyMi00MmU5LTg3YjAtYTY4M2ZlYmZmM2ZiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IklxQ3Z3bjBBR29YUHRPOEFcL0YwbnlhV1wvM1g1SjNhcGlzOWFpcUVvcW1Haz0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] examples/ipsec-secgw: Update checksum while decrementing ttl X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Oct 2016 00:34:36 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Sergio Gonzalez > Monroy > Sent: Monday, September 26, 2016 6:28 AM > To: akhil.goyal@nxp.com; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] examples/ipsec-secgw: Update checksum > while decrementing ttl >=20 > Hi Akhil, >=20 > This application relies on checksum offload in both outbound and inbound > paths (PKT_TX_IP_CKSUM flag). >=20 > Because we assume that we always forward the packet in both paths, we > decrement the ttl in both inbound and outbound. > You seem to only increment (recalculate) the checksum of the inner IP > header in the outbound path but not the inbound path. >=20 > Also, in the inbound path you have to consider a possible ECN value updat= e. Any further comments here, Akhil? Thanks, Pablo >=20 > Sergio >=20 >=20 > On 26/09/2016 17:32, akhil.goyal@nxp.com wrote: > > From: Akhil Goyal > > > > In IPsec-secgw application when TTL is decremented in IP header > > before forwarding the packet, checksum needs to be updated. > > > > In this patch an incremental checksum is added. > > Other applications(like l3fwd) are also doing so. > > > > Signed-off-by: Akhil Goyal > > --- > > examples/ipsec-secgw/ipip.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/examples/ipsec-secgw/ipip.h b/examples/ipsec-secgw/ipip.h > > index ff1dccd..ef059a9 100644 > > --- a/examples/ipsec-secgw/ipip.h > > +++ b/examples/ipsec-secgw/ipip.h > > @@ -56,6 +56,7 @@ ipip_outbound(struct rte_mbuf *m, uint32_t offset, > uint32_t is_ipv6, > > if (inip4->ip_v =3D=3D IPVERSION) { > > /* XXX This should be done by the forwarding engine instead > */ > > inip4->ip_ttl -=3D 1; > > + inip4->ip_sum +=3D 1; > > ds_ecn =3D inip4->ip_tos; > > } else { > > inip6 =3D (struct ip6_hdr *)inip4; >=20 >=20