From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by dpdk.org (Postfix) with ESMTP id 0CC64B489 for ; Wed, 18 Feb 2015 10:16:56 +0100 (CET) Received: by mail-wi0-f182.google.com with SMTP id l15so636148wiw.3 for ; Wed, 18 Feb 2015 01:16:55 -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=v5BE7u7je2VjyPtAoDnHFCPpTO81Tfn9ObnNicGyhDE=; b=EiSKkOEjImBbv8epY0SkLYqWw4KMEWMgnZ1/9jSLSStQ+80orFJm2eOU0EJmYz4CmC k0RQ6tP9JgQgQ4Psndv2xXqlp5H2wfy+m+krfUPK45dhdMYRqaSYus0NE4cXJczglsWW nypDeCXIyA03i4CgXr6AuYmhmMDnQIq50Vlj7YtJZtU9RrX1BMmGkZ7hB1373MrFFRX8 WAz6yu7YohaeDqNAhOjSJQZ2aSRDU+/PjYagp+IhxXj/P4YsgaO5zGXYljHBZvftggi9 Ii3nzPJCmE+u3pW21brQSuM8G5DEKVBGMHBBjylGRv3wjHF8qkEyArYOLVnbfLuswOV5 d/jg== X-Gm-Message-State: ALoCoQlQn85WPygxoyhosrGARu1WM3bHEAvoSe0cvArb/bL9ACEvqwmjWnB99yRrvylJnPUuV8Up X-Received: by 10.180.88.165 with SMTP id bh5mr2872988wib.35.1424251015845; Wed, 18 Feb 2015 01:16:55 -0800 (PST) Received: from [10.16.0.195] (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id bf8sm22599344wjb.37.2015.02.18.01.16.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 01:16:55 -0800 (PST) Message-ID: <54E45888.7070603@6wind.com> Date: Wed, 18 Feb 2015 10:16:56 +0100 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: Sergio Gonzalez Monroy , dev@dpdk.org References: <1424102913-18944-1-git-send-email-sergio.gonzalez.monroy@intel.com> <1424102913-18944-3-git-send-email-sergio.gonzalez.monroy@intel.com> In-Reply-To: <1424102913-18944-3-git-send-email-sergio.gonzalez.monroy@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 2/2] Remove RTE_MBUF_REFCNT references 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, 18 Feb 2015 09:16:56 -0000 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