From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CE27BA0C53; Sun, 21 Nov 2021 15:39:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B3B6E4014E; Sun, 21 Nov 2021 15:39:36 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2073.outbound.protection.outlook.com [40.107.96.73]) by mails.dpdk.org (Postfix) with ESMTP id 7A65E40143 for ; Sun, 21 Nov 2021 15:39:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hEVReVvTptGjkd6/w+Qqxe7AupVWNK3ZWvjgL4h8ZsstlzFeaz6cYXnw3E0xthGBqbfLjbvWZIUlkdEOf9zOF4xwEaoHsE2oyIOx9RW464IcFI5BFzHjaN+Ftwm/cjjMjKLqd0IZCjaboj6u/PDxFGySaWRK+wYsPG3rcTglKHILv6lXQ26q+Gzpgg0zFy+ppmiprdjStIDjggTsCKqrCkYBR+eHmM7Dl51fnERiPYp4HXehjAOST2so5hMvXEkHQjzrAuJB8uE1ATIeV2FD3JdoDAVWZJdlFO7vgwcgrqsW2cJGlSaWyDymu4BMhF/UbCRrjdXpichjhZwwCwMIPw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XqGqHfi+LOR6D0ahcHJlhxZp9X42xSct7o8SmRBb8DA=; b=iXu67GN8sdLAAz63ahoMUGh7E1y9Y3uDBhL90H3AeAUQ4XXI4z7WrsiRNik0d7b7Go7FWE6jFn2HcCjb6u30BkO1uiQxrM93QQI/kbHV3w+6Kb6yxqY27bB3S5LC9Dbv+xTkRz5XjuE5lUXRuPCSleahMfTon+/f3th45plaiDe6ugezUKpv5ns54WiCbpMYe+xNPvmOEVyJWRceVMy0F8OTLfD2nT1IiXIHtcJxpG72F+YKfvNRnwcVqsDuHQ/33UABJnD4/o4NkcseLVT2UXt/uP9PF8sjFxGxP7M0FI5zzdl876W1NpZUMxjqnLkB5AtY0wSWRgYg20VP+W8AoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XqGqHfi+LOR6D0ahcHJlhxZp9X42xSct7o8SmRBb8DA=; b=ktT6NVGPB/9YUfeJP1qCGN/i7oyjbbFOjErN0PE5izw370QehL2Ka3ZVHRK6we9ag0rdd0O8WS2Nivvt4ic/vpMzpXZF30DRGvRBLMbEKA74bxg0kAzUD0uNvztjbCvLkbOT2gAolGG0mbm8In2i3RXL/Ko8p7V2jteOvi2TyKnn2DesosNJDjOE3YZpR96BDUQxGfAYYd3NZeIrsXVwnvBE8tC+1DTEtXyg+LuYM8CVXvFjUW5nVbIES66JrlZ+OfshdUH0t7We5691TPTRwMH3l+xtVlHeP14TnEsfyGnoV7TZMDtBY0BciNjmoD74dwX+F/UZI8oAmWOzWDGH4Q== Received: from DM4PR12MB5312.namprd12.prod.outlook.com (2603:10b6:5:39d::20) by DM6PR12MB5518.namprd12.prod.outlook.com (2603:10b6:5:1b9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.27; Sun, 21 Nov 2021 14:39:33 +0000 Received: from DM4PR12MB5312.namprd12.prod.outlook.com ([fe80::7cf5:9d34:fc6b:b4a4]) by DM4PR12MB5312.namprd12.prod.outlook.com ([fe80::7cf5:9d34:fc6b:b4a4%9]) with mapi id 15.20.4713.019; Sun, 21 Nov 2021 14:39:33 +0000 From: Raslan Darawsheh To: Dmitry Kozlyuk , "dev@dpdk.org" CC: Michael Baum , Matan Azrad , Slava Ovsiienko Subject: RE: [PATCH v3] common/mlx5: fix mempool registration Thread-Topic: [PATCH v3] common/mlx5: fix mempool registration Thread-Index: AQHX3VJIEBXEEw77T0aYB21WLcyzC6wOEHIw Date: Sun, 21 Nov 2021 14:39:32 +0000 Message-ID: References: <20211118152501.2936413-1-dkozlyuk@nvidia.com> <20211119143156.3040273-1-dkozlyuk@nvidia.com> In-Reply-To: <20211119143156.3040273-1-dkozlyuk@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4a01fd80-e09c-4502-e3fb-08d9acfcbbb5 x-ms-traffictypediagnostic: DM6PR12MB5518: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1WW2BaVkJPuY3Es2HRcmOI3r9oDPZ/5UOQOzb3RV2fcsXLKtMRMQ0iC2IpxOjfbETOAUhkJQ8Pc3yzKQatmt9L+U9ME0YaSzldKQbenMnE4OIDzG11ifp1OrvIGiWmp5o2XBm1d3ropbM0Q+qHMT4zYp0gwp0Ye7HpmzHVjsGf+5S4+FRTHmIzNsTtvcfCwM4dvJs3XOpxI08/LGKrFMnEGeucwuIt7qlbAtgYYeUI0vv9ZrabRcNsj74RH2gutuvnvbzjQxfX40uQkjhpKBoWngQJiIeZ3JW7n71iXhxe1J5dYgHoBSEvkPc2Y6lI/G2ywa1iLRfokdFKZJ9vYcie+ZAqPHL50Nt91abQ4AKJMnLIcQp5BTQtoEmrQ7Bm1pRDLn4yYuQAWcMILfgM+E+K0LiL8QvX+zHyKAJk3NtgiFJTWvSyk6IMwFhxxfEbOR7Bf5VK67V6jf3YYVdVHCFMOraunL+V95AcRVSHEh3hR9scFq0wrufyI+IRgKntWTYg1y1Mlb4mYPDWgT8v8WS3zjV5Rbd9q1ahHH+92htiXFvitYh8HA9oBPBYIR4RzY2FVtBg++GYSBTUO2v1dZXrChhk+1zwImZF/R16AVz4t/P8FBV3Dmx5FKKXj+5Ohyx8KadkNMaDmAoGD7sm3kfgxTRS2qOS6bxX3EedlVBTJzR/4tAWwkWcN1QX7IfWXeVIhzqIx3XxmYff2U47BIwQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5312.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(33656002)(52536014)(110136005)(54906003)(66946007)(86362001)(38070700005)(76116006)(64756008)(8936002)(55016002)(9686003)(8676002)(26005)(53546011)(6506007)(316002)(2906002)(83380400001)(7696005)(186003)(107886003)(38100700002)(71200400001)(66556008)(66446008)(66476007)(4326008)(508600001)(122000001)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?l2ykSgsQ0WDOcI5GzKhArjevSkoXr7+B9SkSDYnNBwDbeNfoBeTzgo4UWndl?= =?us-ascii?Q?0WVXtyEC/MwAyYJFNcCx2NXa8RAx2KFIw3X4XG2K/FXcNiPfyAyp9gDfGCjB?= =?us-ascii?Q?bJWUPxw7nv4YZBHsiJeMAjei/wN79VJbHu68SfPaqo/0xZqJ/83E+qdrjV2S?= =?us-ascii?Q?dzmzIY9CABCtbbqKUz0qHyGnJ65+NTglIwS2LImUdD6sC3j0hv3KK5fR9WvE?= =?us-ascii?Q?SMBx9IP8Cz7eHxNgtoDV4uTx/JWEvCDiYugTV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r42892dgolT+8s0YS2cN2CSoDZ7lllNAq2vHa6uy7P1?= =?us-ascii?Q?6QrpH286B5xytH1REaBAZ1R02qw2BqfriamaY1fCo1t60skJEE1ADVuwvpem?= =?us-ascii?Q?SVpyZJzvZNFyUzmfw+akGiZ9WULClHsX0JnplMr1NYB845hGUusPMLftsr2x?= =?us-ascii?Q?PiUCJCdS58gpYey3y9O7hXU30tVZmTiAjlCuXi4jv2myMQwNcsHBWkRWv9TG?= =?us-ascii?Q?zlLPd7RzyM+y5yy+13YirxrhNr+RozHotmoTZXpB1LS1vyzy+Xg0DiHqgdSJ?= =?us-ascii?Q?DOWvT0DowBBgqty5TpEkkDFaxYkdy/if5d6jVanWGh424zEKK1QfHvC7Y6Vy?= =?us-ascii?Q?4DVu+yX3pqd/b333N7OhbiGLWvLfE0R+HEKQFi76dJN6kKroIWQF+e+/I2mf?= =?us-ascii?Q?3SDPH4Z9rNeit0Tc+UKzkbsQBJ3O8Zwxlbvs33UnGw18gPxwjrMus6TsvF2f?= =?us-ascii?Q?HbZbwmMDjkSwBBODA58QkdM=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5312.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a01fd80-e09c-4502-e3fb-08d9acfcbbb5 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2021 14:39:33.0253 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: S3MCZPlZWpYWjKi/XJeYd1Wz3x9aVn3ACuT2DvXb6YnHl3ZabErIrVLAC/4DcEAjdIHyYQKl2nnyJGfW1SpuCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5518 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi, > -----Original Message----- > From: Dmitry Kozlyuk > Sent: Friday, November 19, 2021 4:32 PM > To: dev@dpdk.org > Cc: Raslan Darawsheh ; Michael Baum > ; Matan Azrad ; Slava > Ovsiienko > Subject: [PATCH v3] common/mlx5: fix mempool registration >=20 > Mempool registration was not correctly processing > mempools with RTE_PKTMBUF_F_PINEND_EXT_BUF flag set > ("pinned mempools" for short), because it is not known > at registration time whether the mempool is a pktmbuf one, > and its elements may not yet be initialized to analyze them. > Attempts had been made to recognize such pools, > but there was no robust solution, only the owner of a mempool > (the application or a device) knows its type. > This patch extends common/mlx5 registration code > to accept a hint that the mempool is a pinned one > and uses this capability from net/mlx5 driver. >=20 > 1. Remove all code assuming pktmbuf pool type > or trying to recognize the type of a pool. > 2. Register pinned mempools used for Rx > and their external memory on port start. > Populate the MR cache with all their MRs. > 3. Change Tx slow path logic as follows: > 3.1. Search the mempool database for a memory region (MR) > by the mbuf pool and its buffer address. > 3.2. If not MR for the address is found for the mempool, > and the mempool contains only pinned external buffers, > perform the mempool registration of the mempool > and its external pinned memory. > 3.3. Fall back to using page-based MRs in other cases > (for example, a buffer with externally attached memory, > but not from a pinned mempool). >=20 > Fixes: 690b2a88c2f7 ("common/mlx5: add mempool registration facilities") > Fixes: fec28ca0e3a9 ("net/mlx5: support mempool registration") >=20 > Signed-off-by: Dmitry Kozlyuk > Reviewed-by: Matan Azrad > Reviewed-by: Viacheslav Ovsiienko > --- > v3: fix build with GCC on RHEL7 > v2: 1) rebase on ToT > 2) fix MR cache population Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh