From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH 01/13] mbuf: replace data pointer by an offset Date: Mon, 08 Sep 2014 11:55:42 +0200 Message-ID: <540D7D1E.1020500@6wind.com> References: <1409759378-10113-1-git-send-email-bruce.richardson@intel.com> <1409759378-10113-2-git-send-email-bruce.richardson@intel.com> <540D7C5F.8000406@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit To: Bruce Richardson , dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <540D7C5F.8000406-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> 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" >> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h >> index 32e8474..669e7f5 100644 >> --- a/lib/librte_mbuf/rte_mbuf.h >> +++ b/lib/librte_mbuf/rte_mbuf.h >> @@ -119,6 +119,13 @@ struct rte_mbuf { >> void *buf_addr; /**< Virtual address of segment buffer. */ >> phys_addr_t buf_physaddr; /**< Physical address of segment buffer. */ >> uint16_t buf_len; /**< Length of segment buffer. */ >> + >> + /* valid for any segment */ >> + struct rte_mbuf *next; /**< Next segment of scattered packet. */ >> + uint16_t data_off; >> + uint16_t data_len; /**< Amount of data in segment buffer. */ >> + uint32_t pkt_len; /**< Total pkt len: sum of all segments. */ >> + > > Here, the compiler will add some padding between "buf_len" and "next" > (6 bytes in 64bits, 2 in 32bits). Shouldn't we add "reserved" fields > or at least a comment ? Another idea would be to reorganize the fields > to avoid padding, if possible. I've just seen that patch 02/13 reorders the mbuf fields. So maybe this remarq is useless. Olivier