From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH 01/17] mbuf: add definitions of unified packet types Date: Tue, 03 Feb 2015 10:12:10 +0100 Message-ID: <54D090EA.4040002@6wind.com> References: <1421637666-16872-1-git-send-email-helin.zhang@intel.com> <1422501365-12643-1-git-send-email-helin.zhang@intel.com> <1422501365-12643-2-git-send-email-helin.zhang@intel.com> <54CB8D81.2050205@6wind.com> <54CF5CF8.2090605@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit To: "Zhang, Helin" , "'dev-VfR2kkLFssw@public.gmane.org'" Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hi Helin, On 02/03/2015 07:37 AM, Zhang, Helin wrote: >>> When your application decapsulates tunnels, you can just do outer = >>> inner and enter into the same code. >> Expanding packet_type is not easy, as there is no free bits in the first cache >> line. >> Is there any tunnel type in inner packet? Is it a waste? >> Is L2 type really needed? I don't know. > If it is now not short of space in mbuf, the definition as yours might be good. > But tun_type is not required for inner packet, I'd prefer to define it as needed > with taking into account the Vector PMD support. It seems 32 bits might be enough, > like below, > struct pkt_type { > uint32_t l2_type:4; > uint32_t l3_type:4; > uint32_t l4_type:4; > uint32_t tun_type:4; > uint32_t inner_l2_type:4; > uint32_t inner_l3_type:4; > uint32_t inner_l4_type:4; > } Yes, I think a structure like this would be much better! Maybe a union with a u32 could also help to assign the value in one operation. Thanks, Olivier