From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH 2/2] Remove RTE_MBUF_REFCNT references Date: Wed, 18 Feb 2015 10:16:56 +0100 Message-ID: <54E45888.7070603@6wind.com> References: <1424102913-18944-1-git-send-email-sergio.gonzalez.monroy@intel.com> <1424102913-18944-3-git-send-email-sergio.gonzalez.monroy@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit To: Sergio Gonzalez Monroy , dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1424102913-18944-3-git-send-email-sergio.gonzalez.monroy-ral2JQCrhuEAvxtiuMwx3w@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" Hi Sergio, On 02/16/2015 05:08 PM, Sergio Gonzalez Monroy wrote: > This patch removes all references to RTE_MBUF_REFCNT, setting the refcnt > field in the mbuf struct permanently. > > Signed-off-by: Sergio Gonzalez Monroy I think removing the refcount compile option goes in the right direction. However, activating the refcount will break the applications that reserve a private zone in mbufs. This is due to the macros RTE_MBUF_TO_BADDR() and RTE_MBUF_FROM_BADDR() that suppose that the beginning of the mbuf is 128 bytes (sizeof mbuf) before the data buffer. For RTE_MBUF_TO_BADDR(), it's relatively easy to replace it. The mbuf pool could store the size of the private size like it's done for mbp_priv->mbuf_data_room_size. Using rte_mempool_from_obj(m) or m->pool, we can retrieve the mbuf pool and this value, then compute the buffer address. For RTE_MBUF_FROM_BADDR(), it's more complex. We could ensure that a backpointer to the mbuf is always located before the data buffer, but it looks difficult to do. Another idea would be to add a field in indirect mbufs that stores the pointer to the "parent" mbuf. Regards, Olivier