From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 36D9E68A8 for ; Mon, 8 Sep 2014 13:12:32 +0200 (CEST) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XQwzI-0007iF-T0; Mon, 08 Sep 2014 13:20:04 +0200 Message-ID: <540D903E.1060206@6wind.com> Date: Mon, 08 Sep 2014 13:17:18 +0200 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: Yerden Zhumabekov , Bruce Richardson , dev@dpdk.org References: <1409759378-10113-1-git-send-email-bruce.richardson@intel.com> <1409759378-10113-4-git-send-email-bruce.richardson@intel.com> <540D8228.809@6wind.com> <540D85E0.4030203@sts.kz> In-Reply-To: <540D85E0.4030203@sts.kz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 03/13] mbuf: add packet_type field 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: Mon, 08 Sep 2014 11:12:32 -0000 Hi Yerden, On 09/08/2014 12:33 PM, Yerden Zhumabekov wrote: > 08.09.2014 16:17, Olivier MATZ пишет: >>> --- a/lib/librte_mbuf/rte_mbuf.h >>> +++ b/lib/librte_mbuf/rte_mbuf.h >>> @@ -146,7 +146,7 @@ struct rte_mbuf { >>> uint32_t reserved1; /**< Unused field. Required for padding */ >>> >>> /* remaining bytes are set on RX when pulling packet from descriptor */ >>> - uint16_t reserved2; /**< Unused field. Required for padding */ >>> + uint16_t packet_type; /**< Type of packet, e.g. protocols used */ >>> uint16_t data_len; /**< Amount of data in segment buffer. */ >>> uint32_t pkt_len; /**< Total pkt len: sum of all segments. */ >>> uint16_t l3_len:9; /**< L3 (IP) Header Length. */ >>> >> This patch adds a new fields that nobody uses. So why should we add it ? > > I would use it :) > It's useful to store the IP protocol number (UDP, TCP etc) and version > of IP (4, 6) and then relay packet to specific handler. I'm not saying this field is useless. But even if it's useful for some applications like yours, it does not mean that it should go in the generic mbuf structure. Also, for a new field, we should define who is in charge of filling it. Is is the driver? Does it mean that all drivers have to be modified to fill it? Or is it just a placeholder for applications? In this case, shouldn't we use application-specific metadata? In the other direction (TX), we would also need to define if this field must be filled by the application before transmitting a mbuf to a driver. Regards, Olivier