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 8C7C4A0526; Mon, 20 Jan 2020 18:30:48 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 34FB21BFFB; Mon, 20 Jan 2020 18:30:48 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2076.outbound.protection.outlook.com [40.107.21.76]) by dpdk.org (Postfix) with ESMTP id B08891BFF1 for ; Mon, 20 Jan 2020 18:30:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ST0Pc4aGxrBliCinK6xFHsPotO2Ce47iLQUTsedbtag6LRvDGAAxy3fMR3Dym8e9fciAjhHgQaSGXFZ1YOZmqjUiqiduN+XDgBmtqZUth6Zkt9sIhOPgiZoUO0ux1uqWXXjDHRxhMQzfx1MgKHqyRJ0E0ZQwwAhvUb/iOzOF+So6sOUgq89ZmauOIki57sUxCUQhKlB22AbMxWUVlp7vr3ZbBciy1e/pMV9RDgSBgBYhmGlf4YzHvwlUX077iXdLLQlHH5KolySht+6kibDNV4okvXzGiaKJKU+1w1/XoeDfi7119B1VLZvFDFDavRmLg0UlkuOJkcoeufF4h5cijw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=izMBoso/qKkmgZfjaJdPoBtsTQKM2AilHNLxowOlIM8=; b=TlSN2T5T8pTu+IvizBO0mYjbb2EII0JZQ9kFMrygj6bqk5nobrOrX8XEZ2L0ioGZf0no6fbSkQG7B/arqD2EyPON9WC2M2pX4ZNeoHYSsyZvD+LjeZzPRpSSzGKJZ5tToT27Hs8oXTPfNpRewdp/d3bPJuM8L4pEJUiLsb0ENg1vAwG5lABqQ40/BJm5TxZVspWiB26wT5ODkRffhBGW4nxZdt5V4HRYPo5ZsylrWirPNb4QUmF/cQ6VQkhj9/JzvaNQ2oEyYumkx95rZCjpmUMsDyj6NmBoCTQFINhLvYZpVchvXPyDRANNNtclyY3PB5JtB+VtZx4QA6eL96nKOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=izMBoso/qKkmgZfjaJdPoBtsTQKM2AilHNLxowOlIM8=; b=Gbt6O7O+HdBjgMwmji1QAQBZOFzxfjuWtgl6ljO5/0dgxK9wXORW1FwhsOTvfUODA1rq9lPIpmcJMqJ6iO1j/YCn501LZ00RnUTMVuIf+GTZObKLQyxxYXVLRPqy9TM570uNpkx5d1G9R9p7J3eOptOZS8AE/DfJNf//2tXVhAM= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3218.eurprd05.prod.outlook.com (10.170.125.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.24; Mon, 20 Jan 2020 17:30:45 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::68eb:ad79:71f4:110f]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::68eb:ad79:71f4:110f%3]) with mapi id 15.20.2644.024; Mon, 20 Jan 2020 17:30:45 +0000 From: Slava Ovsiienko To: Slava Ovsiienko , "dev@dpdk.org" CC: Matan Azrad , Raslan Darawsheh , Ori Kam , Shahaf Shuler , "olivier.matz@6wind.com" , "stephen@networkplumber.org" , "thomas@mellanox.net" Thread-Topic: [dpdk-dev] [PATCH v5 0/5] mbuf: detach mbuf with pinned external buffer Thread-Index: AQHVz7ZZfr5h8STqcU6mBM6q7xTD86fzzuGQ Date: Mon, 20 Jan 2020 17:30:45 +0000 Message-ID: References: <20191118094938.192850-1-shahafs@mellanox.com> <1579541003-2399-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1579541003-2399-1-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-originating-ip: [77.75.144.194] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 31ae00e3-229b-45a2-b6ed-08d79dce7b40 x-ms-traffictypediagnostic: AM4PR05MB3218:|AM4PR05MB3218: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0288CD37D9 x-forefront-antispam-report: SFV:NSPM; SFS:(10001)(10009020)(4636009)(376002)(346002)(366004)(136003)(39860400002)(396003)(199004)(189003)(966005)(316002)(66446008)(64756008)(55016002)(66946007)(66556008)(86362001)(66476007)(6506007)(53546011)(2906002)(4326008)(71200400001)(7696005)(5660300002)(76116006)(52536014)(478600001)(110136005)(33656002)(54906003)(81166006)(81156014)(186003)(26005)(9686003)(8936002)(45080400002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3218; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: fpkKfB+3qATI+z7s9erG44Wwu8IdxkGmd74oy2gYA+ukME0sAb4F7ofroQnhPH41eAX7GWEkLIxF7xSd0iNlyrPvbvMzFXtV52ePAJBqh5ZQSZyXV22oB8ixsi4uF534Ob6kAr+4WCYtUKsksmF1OEoj2f0SL8OniUvuKkIBCEI1Mb0Heqigx5yDf/HCFU6f3MPLHUaKQWg3e3dejevza8H33HP6SbvrscGmqZKw2QNume46M30mVLTniG5ogovCZYMiVTjA9zLROZ9wHJkrQ+fCBnMqQlobanR4OLKeEhXvwbMyiIx5tHi9cHjQHx446CJV5fxgKvbXdQR0hZiiNSf1/ERNM1S+tDu5+yYJlgoBQ9x+7p/4+FzDtj6n4ic2A20t6NXr5U3CgnBylpTcZ8X41wcPtX/fMx3Sv8RopQdUEn7xx0FtTXfgNGkjYDWorT8pF+wCIx9CwHLKR1KbSY8JRfIO2AX+958yIVr9CuCo5KjDl45fwQCO2UjNq+2NMCPxEGifLjSCXwdr6hC5csxXe9bCnID8uyQpCT5XSqAxWFs604YQ1ALhjwZIKtM4j0h/lQvzHeSKWMk5/ZFi6M47RTYgFEZyo05lfG/1g58tca+E3olkjq9ZWDyCNISx Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 31ae00e3-229b-45a2-b6ed-08d79dce7b40 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2020 17:30:45.0818 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: hU7dP/j2iViRSdjVaOA5cI2E2sY6RLL427fVcVCdtRa8QM7LyoO1QUixmOn0oTKaHZERLM9QCrI4ZIQQhQV/nVmKDeURD5LMXQLRQoa2gc0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3218 Subject: Re: [dpdk-dev] [PATCH v5 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" The unit test (as part of test_mbuf application) will be provided as separ= ated patch. With best regards, Slava > -----Original Message----- > From: dev On Behalf Of Viacheslav Ovsiienko > Sent: Monday, January 20, 2020 19:23 > To: dev@dpdk.org > Cc: Matan Azrad ; Raslan Darawsheh > ; Ori Kam ; Shahaf Shuler > ; olivier.matz@6wind.com; > stephen@networkplumber.org; thomas@mellanox.net > Subject: [dpdk-dev] [PATCH v5 0/5] mbuf: detach mbuf with pinned external > buffer >=20 > 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). >=20 > On some cases, the application would want to have the buffers allocated f= rom > 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 GP= U > or storage device. For such cases the native pktmbuf pool does not fit si= nce > each mbuf would need to point to external buffer. >=20 > To support above, the pktmbuf pool will be populated with mbuf pointing t= o > 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 queu= es > of the NIC, will make the DMA to fetch device memory using peer to peer > communication. >=20 > 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. >=20 > 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. >=20 > Signed-off-by: Shahaf Shuler > Signed-off-by: Viacheslav Ovsiienko >=20 > RFC: > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatche= s. > dpdk.org%2Fpatch%2F63077&data=3D02%7C01%7Cviacheslavo%40mellano > x.com%7Cefff8bba40804fd99d1808d79dcd7ac7%7Ca652971c7d2e4d9ba6a4d1 > 49256f461b%7C0%7C0%7C637151378168487564&sdata=3DeukDFAJo1IuVkx > OPcxh7fVbMlOWtdVA7jN%2FxKtt9wgg%3D&reserved=3D0 > v1: - > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatche= s. > dpdk.org%2Fcover%2F64424&data=3D02%7C01%7Cviacheslavo%40mellanox > .com%7Cefff8bba40804fd99d1808d79dcd7ac7%7Ca652971c7d2e4d9ba6a4d14 > 9256f461b%7C0%7C0%7C637151378168487564&sdata=3DWXZ22vksi%2FkEa > KRrc4d6X%2F24Da4PJXBABotz6O8SPTs%3D&reserved=3D0 > 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://eur03.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fpatch= es > .dpdk.org%2Fcover%2F64809%2F&data=3D02%7C01%7Cviacheslavo%40mell > anox.com%7Cefff8bba40804fd99d1808d79dcd7ac7%7Ca652971c7d2e4d9ba6a > 4d149256f461b%7C0%7C0%7C637151378168487564&sdata=3D5tOR2I9DUD > nLYANlB05lf2qFYuCpVARUMYP4PJbz2ac%3D&reserved=3D0 > - introduce rte_pktmbuf_priv_flags > - support cloning pinned mbufs as for regular mbufs > with external buffers > - address the minor comments > v5: - update rte_pktmbuf_prefree_seg > - rename __rte_pktmbuf_extbuf_detach > - addressing comment > - fix typos >=20 > 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 >=20 > app/test-pmd/config.c | 2 + > app/test-pmd/flowgen.c | 3 +- > app/test-pmd/parameters.c | 2 + > app/test-pmd/testpmd.c | 81 +++++++++++++ > app/test-pmd/testpmd.h | 4 +- > app/test-pmd/txonly.c | 3 +- > drivers/net/mlx5/mlx5_rxq.c | 7 +- > drivers/net/mlx5/mlx5_rxtx.c | 2 +- > drivers/net/mlx5/mlx5_rxtx.h | 2 +- > drivers/net/mlx5/mlx5_rxtx_vec.h | 14 +-- > drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 5 +- > drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 29 ++--- > drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 2 +- > lib/librte_mbuf/rte_mbuf.c | 198 > ++++++++++++++++++++++++++++++- > lib/librte_mbuf/rte_mbuf.h | 183 +++++++++++++++++++++++++= +-- > lib/librte_mbuf/rte_mbuf_version.map | 1 + > 16 files changed, 492 insertions(+), 46 deletions(-) >=20 > -- > 1.8.3.1