From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 745AE7EB0 for ; Wed, 3 Dec 2014 09:57:23 +0100 (CET) Received: by mail-wg0-f41.google.com with SMTP id y19so19162262wgg.14 for ; Wed, 03 Dec 2014 00:57:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=JyhzbD9Q59fuXsSVxquhFRFli9jt4TQYi5m4leHaLs0=; b=BSDX/LysCE6yzifqJv9M3UFReliiBEi5Z4ghdEDvoACw1F90gNfuCuDsq6nuphES5o wTMybiL89UhsurT56IoBoxNyObI4vBDMGhkebOyIhoBgOoZoqpfi4vQXqCuRS0MHe9o+ HqreT6EBqA9437syopk4of16n1iRJMGJo70LpUrSIaHfV7a6QKp5D5vhfb8fwKGnbPOU KFw9rjJ4nPPHh9HCgH02arU1ct3Ztc9c13EgAm5x1MrJq3lfSrdsfGL3fEk0ErZhFSEU rv/oOO1C/ej9ppzPnCFpAv7zvOZlICoXtN/4At92b4NoAfeHqcTN6N4Sh1csn1TfoNTk z43Q== X-Gm-Message-State: ALoCoQnhGPwQuc/WN0H2fQN+71TO8smGUCz2fYyOinPIEtgsYK9h/AGFkWnYqqwlxGVo0RZwq5Yp X-Received: by 10.180.98.138 with SMTP id ei10mr14610463wib.32.1417597043231; Wed, 03 Dec 2014 00:57:23 -0800 (PST) Received: from [10.16.0.195] (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id wz5sm35356088wjc.29.2014.12.03.00.57.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 00:57:22 -0800 (PST) Message-ID: <547ED071.3080101@6wind.com> Date: Wed, 03 Dec 2014 09:57:21 +0100 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 To: "Ananyev, Konstantin" , "didier.pallard" , "Liu, Jijiang" , "dev@dpdk.org" References: <1417503172-18642-1-git-send-email-jijiang.liu@intel.com> <1417503172-18642-4-git-send-email-jijiang.liu@intel.com> <547DD269.2080500@6wind.com> <2601191342CEEE43887BDE71AB977258213BC075@IRSMSX105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258213BC075@IRSMSX105.ger.corp.intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 3/3] mbuf:replace the inner_l2_len and the inner_l3_len fields 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, 03 Dec 2014 08:57:23 -0000 Hi Didier, Konstantin, Jijiang, On 12/02/2014 04:36 PM, Ananyev, Konstantin wrote: > Hi Didier > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of didier.pallard >> Sent: Tuesday, December 02, 2014 2:53 PM >> To: Liu, Jijiang; dev@dpdk.org >> Subject: Re: [dpdk-dev] [PATCH v4 3/3] mbuf:replace the inner_l2_len and the inner_l3_len fields >> >> Hello, >> >> On 12/02/2014 07:52 AM, Jijiang Liu wrote: >>> Replace the inner_l2_len and the inner_l3_len field with the outer_l2_len and outer_l3_len field, and rework csum forward engine >> and i40e PMD due to these changes. >>> >>> Signed-off-by: Jijiang Liu >> [...] >>> --- a/lib/librte_mbuf/rte_mbuf.h >>> +++ b/lib/librte_mbuf/rte_mbuf.h >>> @@ -276,8 +276,8 @@ struct rte_mbuf { >>> uint64_t tso_segsz:16; /**< TCP TSO segment size */ >>> >>> /* fields for TX offloading of tunnels */ >>> - uint64_t inner_l3_len:9; /**< inner L3 (IP) Hdr Length. */ >>> - uint64_t inner_l2_len:7; /**< inner L2 (MAC) Hdr Length. */ >>> + uint64_t outer_l3_len:9; /**< Outer L3 (IP) Hdr Length. */ >>> + uint64_t outer_l2_len:7; /**< Outer L2 (MAC) Hdr Length. */ >>> >>> /* uint64_t unused:8; */ >>> }; >> >> Sorry for entering lately this discussion, but i'm not convinced by the >> choice of outer_lx_len rather than inner_lx_len for new fields. >> I agree with Olivier that new flags should only be related to the use of >> new fields, to maintain coherency with oldest implementations. >> But from a stack point of view, i think it is better to have lx_len >> fields that target the outer layers, and to name new fields inner_lx_len. >> >> Let's discuss the two possibilities. >> >> 1) outer_lx_len fields are introduced. >> In this case, the stack should have knowledge that it is processing >> tunneled packets to use outer_lx_len rather than lx_len, >> or stack should always use outer_lx_len packet and move those fields to >> lx_len packets if no tunneling occurs... >> I think it will induce extra processing that does not seem to be really >> needed. >> >> 2) inner_lx_len fields are introduced. >> In this case, the stack first uses lx_len fields. When packet should be >> tunneled, lx_len fields are moved to inner_lx_len fields. >> Then the stack can process the outer layer and still use the lx_len fields. > > Not sure, that I understood why 2) is better than 1). > Let say, you have a 'normal' (non-tunnelling) packet: ether/IP/TCP > In that case you still use mbuf's l2_len/l3_len/l4_len fields and setup ol_flags as usual. > Then later, you decided to 'tunnel' that packet. > So you just fill mbuf's outer_l2_len/outer_l3_len, setup TX_OUTER_* and TX_TUNNEL_* bits in ol_flags and probably update l2_len. > l3_len/l4_len and ol_flags bits set for them remain intact. > That's with 1) > > With 2) - you'll have to move l3_len/l4_len to inner_lx_len. > And I suppose ol_flags values too: > ol_flags &= ~PKT_ IP_CKSUM; > ol_flgas |= PKT_INNER_IP_CKSUM > ? > And same for L4_CKSUM flags too? After reading Didier's mail, I start to be convinced that keeping inner may be better than outer. From a network stack architecture point of view, 2) looks better: - the functions in the network stack that write the Ether/IP header always deal with l2_len/l3_len, whatever it's a tunnel or not. - the function that adds the tunnel header moves the l2_len/l3_len and the flags to inner_l2_len/inner_l3_len and inner_flags. Althought it was my first idea, now I cannot find a better argument in favor of outer_lX_len. The initial argument was that the correspondance between a flag and a lX_len should always remain the same, but it is still possible with Didier's approach: - PKT_IP_CKSUM uses l2_len and l3_len - PKT_INNER_CKSUM uses inner_l2_len and inner_l3_len Jijiang, I'm sorry to change my mind about this. If you want (and if Konstantin is also ok with that), I can try to rebase your patches to match this. Or do you prefer to do it by yourself? Regards, Olivier