From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CC61BA0526; Mon, 20 Jan 2020 23:55:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 46B391C01B; Mon, 20 Jan 2020 23:55:15 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id B45901C014 for ; Mon, 20 Jan 2020 23:55:13 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5BB0C21B8C; Mon, 20 Jan 2020 17:55:13 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 20 Jan 2020 17:55:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=YjkbbXRF06MuZ2fLFYljyYdO7oPIATtAlP9AMnAhgR0=; b=REVdPfImPjW7 BvEMk0oir0uLU58vGiOle1zleJf5gmkTFUABbz/KsGRqE2W1shjstPP/EMMgPwBo wYv2dhCh6JIWFXTSSRdT5uPR7wQj8rpOsX7hOCjfOqquLndGHLfW8MeZQ2sr7z8C 5V0vvIrKIMH9WRROdNhF7F56to6TsRM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=YjkbbXRF06MuZ2fLFYljyYdO7oPIATtAlP9AMnAhg R0=; b=vv2kc+LmniA04pKGy0cVywG2zS1pbKXE5v3ZD0t19hsL14fojW+vZzN6Z GJcwHp9c24NQwnxo70T8c21qZ/oxClwear76EY93X+WxcssVtla7RbDq6xGqUFN9 gBu8Ayfplvg17FQH6vIGMrblGY6v45YYq27EFTT7w3zA75Yngu3bobp7uRqQxnrH 3Uz3DzdnCt0pswoLmsccSdEykUQZKg/XTZ13EuYIr7PFIRF6qjWNzkAZMSyA9G7d trQLAGIBVaBLwGAakrSYVYvFXB7tdlsjGXUbzQPjBCyN5OlwyQYTrXgC6FbR2vdl pKHmPQXPZkDGbUYbE1VRoY2yR4TPA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudejgddtudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucffoh hmrghinhepughpughkrdhorhhgnecukfhppeejjedrudefgedrvddtfedrudekgeenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrsh esmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D97B53060BCB; Mon, 20 Jan 2020 17:55:11 -0500 (EST) From: Thomas Monjalon To: Viacheslav Ovsiienko Cc: dev@dpdk.org, matan@mellanox.com, rasland@mellanox.com, orika@mellanox.com, shahafs@mellanox.com, olivier.matz@6wind.com, stephen@networkplumber.org Date: Mon, 20 Jan 2020 23:55:10 +0100 Message-ID: <1626118.M3retTD8dW@xps> In-Reply-To: <1579547786-7650-1-git-send-email-viacheslavo@mellanox.com> References: <20191118094938.192850-1-shahafs@mellanox.com> <1579547786-7650-1-git-send-email-viacheslavo@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v6 0/5] mbuf: detach mbuf with pinned external buffer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 20/01/2020 20:16, Viacheslav Ovsiienko: > Today's pktmbuf pool contains only mbufs with no external buffers. > This means data buffer for the mbuf should be placed right after the > mbuf structure (+ the private data when enabled). > > On some cases, the application would want to have the buffers allocated > from a different device in the platform. This is in order to do zero > copy for the packet directly to the device memory. Examples for such > devices can be GPU or storage device. For such cases the native pktmbuf > pool does not fit since each mbuf would need to point to external > buffer. > > To support above, the pktmbuf pool will be populated with mbuf pointing > to the device buffers using the mbuf external buffer feature. > The PMD will populate its receive queues with those buffer, so that > every packet received will be scattered directly to the device memory. > on the other direction, embedding the buffer pointer to the transmit > queues of the NIC, will make the DMA to fetch device memory > using peer to peer communication. > > Such mbuf with external buffer should be handled with care when mbuf is > freed. Mainly The external buffer should not be detached, so that it can > be reused for the next packet receive. > > This patch introduce a new flag on the rte_pktmbuf_pool_private > structure to specify this mempool is for mbuf with pinned external > buffer. Upon detach this flag is validated and buffer is not detached. > A new mempool create wrapper is also introduced to help application to > create and populate such mempool. > > The unit test (as part of test_mbuf application) will be provided > as dedicated patch. > > Signed-off-by: Shahaf Shuler > Signed-off-by: Viacheslav Ovsiienko > > RFC: http://patches.dpdk.org/patch/63077 > v1: http://patches.dpdk.org/cover/64424 > v2: - fix rte_experimantal issue on comment addressing > - rte_mbuf_has_pinned_extbuf return type is uint32_t > - fix Power9 compilation issue > v3: - fix "#include leftover > v4: - https://patches.dpdk.org/cover/64809/ > - introduce rte_pktmbuf_priv_flags > - support cloning pinned mbufs as for regular mbufs > with external buffers > - address the minor comments > v5: - http://patches.dpdk.org/cover/64979/ > - update rte_pktmbuf_prefree_seg > - rename __rte_pktmbuf_extbuf_detach > - __rte_pktmbuf_init_extmem is static > - const qualifier is specified for external memory > description parameter of rte_pktmbuf_pool_create_extbuf > - addressing minor comments > - fix typos > v6: - new lines inserted > - struct rte_pktmbuf_extmem_init_ctx is local to rte_mbuf.c > > Viacheslav Ovsiienko (5): > mbuf: introduce routine to get private mbuf pool flags > mbuf: detach mbuf with pinned external buffer > mbuf: create packet pool with external memory buffers > app/testpmd: add mempool with external data buffers > net/mlx5: allow use allocated mbuf with external buffer Applied, thanks