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 9E96942B8F; Wed, 24 May 2023 18:06:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6910242D5A; Wed, 24 May 2023 18:05:41 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2077.outbound.protection.outlook.com [40.107.237.77]) by mails.dpdk.org (Postfix) with ESMTP id BB43442D5A; Wed, 24 May 2023 18:05:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lh7zSxx4ZammygPKJ7qY0omE0HrqPZpSaN53nuECx/ewmCwRg2DYsOoXUf5CjSMIc8l8efNRC+/b7Ge9yVRRTk5UFo/HCoNSEvrRamEuqzkZ5wFDnVGXaVQGGnKG9xkGunhUWJMkzvOtu7ZvtJNPoofNNwuDhGE+VgTAfANfez52G5Q/QtZWWlevHu42ID7XO5iGh1lp67VIZzb/inK02q6MsbCPBOsBknI97BREynWOXeY9FmPPMA4pjtjG5zeyX2mndCx46q4cvUflcY6W281DY63F73sPoFWec6ftavJMtYyfgtYEhWRN9vM+/LaZRmThtAG2hKFZm7lZnEMBGw== 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=Nnun+k0zZQ5/JnSuzT3s/9SPm08fncscLw/zR/GyB00=; b=eEKjhQFKfQDwP2+WVhdnw2ps0/u38D8KQy1fWm4HZxUi98QBTZJe3FZ01TA/nE4QiwWytdkH0H52GuWRI4iO79EALAgjKHdMMAL+ajm12Md4NOqHOYBSykdyixMZbpV4So0XV/zQBBtegtZcGpbjGGgBiYtLNWA3HK7O8z1bcU3yC5579zDC5ahXDlS+5+54DYTh7YYEqdvnvn6+XKPEA6oxOCUsLLDBfJplfCyPK1raR8pSHrHU5Hw/kylyElt4haM7fFQrmyMhq+OyQ3VY0ctYjcelu0+mBfyA8uVWnAzIysXm1pjVoRXK7KVBOyv3DIdKeRnS7EI5zNK7wM+Fww== 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=Nnun+k0zZQ5/JnSuzT3s/9SPm08fncscLw/zR/GyB00=; b=Y1KzuAesSWQtuYK/k4SVG2vZOc6mw0koqVgulveV9NvAdNuC3HAeAyZSayfi7FRhNmseIdjI87/n72a4idR6C6dVzS7CLNFlnGSggmUHrRc7lCmz7Sk+cSWkoAk09FqW6QwZiY/lNbwXfKLWvVvd0YX0c5mnjrTd1SWL8+wXFyfbTUAy8txkXomRH9wnqTBxYmW3k7ojw2xjj3Uhnmo4Ky4TR7CKv6aoT7ByRmHxVNx0i19YOkQcKA5B9AxxNBUcWVZbOve2HrN4C296/OjNfaBw3vpm5lvZDV2UwW1PpbROMUErPU/LTCaI1WcW5BoOXumS5PFGWeu9JWDdoZQ/SA== Received: from DM6PR12MB3753.namprd12.prod.outlook.com (2603:10b6:5:1c7::18) by LV2PR12MB5991.namprd12.prod.outlook.com (2603:10b6:408:14f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Wed, 24 May 2023 16:05:37 +0000 Received: from DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::ab87:3bac:b8e:a23d]) by DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::ab87:3bac:b8e:a23d%3]) with mapi id 15.20.6433.015; Wed, 24 May 2023 16:05:35 +0000 From: Slava Ovsiienko To: Erez Ferber , "dev@dpdk.org" CC: Matan Azrad , Raslan Darawsheh , "stable@dpdk.org" Subject: RE: [PATCH] common/mlx5: adjust fork call with the new kernel API Thread-Topic: [PATCH] common/mlx5: adjust fork call with the new kernel API Thread-Index: AQHZjjehQ1BI7EMvH0SkYKpM3IDy3a9pVCww Date: Wed, 24 May 2023 16:05:35 +0000 Message-ID: References: <20230524120140.416144-1-erezf@nvidia.com> In-Reply-To: <20230524120140.416144-1-erezf@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-traffictypediagnostic: DM6PR12MB3753:EE_|LV2PR12MB5991:EE_ x-ms-office365-filtering-correlation-id: 0fa18a29-6fd7-401f-2012-08db5c70b591 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5XqKlBqynuhLncssgzPOb01nHc8VnZKtRC/qtXtp1OT1fQ5ingQZPZKzpvEubZZgGIAqpPTbclAUp64/NeCrAL2R8eK5h4y1CBhXVPyVhStGZAHR6AuJohz39+nZQ0j3pUousruSU/uQcSqN15Ar33Bb4cTcnmrNatUN4KzJH7U9YOyZmAP+uxPyVH0I1Dda+G8v0/EPIAyza6zdhRlzQ192Gy/k8cnNQxzENY1ZYmSRo55iRVO7hHUHIhmQW4vvfkU2ioDqUwjWVa214R6v7wiNXuIkp2jUcX9WQYI2yyCmK+knBB+Qvg3fpR3ryaWrRm3VRwPp5aHVpFUrNfhQiL9H4YdfZ+yHSA2PQsNQHn2sLeGMxcm/5zJgR+o7JdnVhJLM1j9XbU9x2+qCzJC1exgPd0iEsv+vR3PlQ1EsBNFermw7IekIqD/WUW0Q/OEFYLs4iMfA8tZQ+45lnYQD1y+9/hAXBsvxofOvBHDPrKEQo9OezNyKXAq5d/20j20BV5HiEfk2etJGjPmFJOW8bWz+tywozzLRDGXmC3hVipFdRkZ68Y4wlQxVzikFUoKBv0Dc7Q4AApu4DSzNqShUWSdbbbISlK4uYViuIJeMxGST/TBxkTvD3/B6AppjEk5m x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB3753.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199021)(2906002)(450100002)(76116006)(52536014)(5660300002)(83380400001)(8936002)(8676002)(478600001)(66446008)(4326008)(316002)(110136005)(54906003)(33656002)(64756008)(66476007)(41300700001)(55016003)(71200400001)(66556008)(66946007)(7696005)(86362001)(186003)(6506007)(9686003)(53546011)(26005)(38070700005)(122000001)(38100700002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1id/ZB4PmUMIeg2XdLNvlLDcupSgitgXVO/1xNVc9L8d3fwOusA8dnDstYhz?= =?us-ascii?Q?Lcy4xpJTpOUt4cSQUgbQGOPW+R2qrWmkYX5boyHhAzFQ3yP5SLFHL+nOzUF6?= =?us-ascii?Q?fZs2LGpcFBCOoaWGhwG67ZCg3f6kWJsWCsyNAAWkhCdlD+hY5TYGv/2SeOs/?= =?us-ascii?Q?G1F8QyS9vsvbeOENjvEsFaFglpBNYhPOG0oey0aafxZX1c8bQFXXyoRKMtkC?= =?us-ascii?Q?z+9ASnL0090ralPLji5HmWd7n+QrHYVdt3ztvTNlGDH/INoEebZuQfRIs8If?= =?us-ascii?Q?h+uikwkm/hQtxUafTbM/VYKG9BBQnxkBh0rv9IhtezftPajWDyZOeOx2oa7F?= =?us-ascii?Q?a1Dnj2vmp9R7/QwUUjaIS5T/hW0zIMn6GsyU2EOGBqdFLB39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gr3UA3PxUEelysEZLyH7b42g+64GYZN?= =?us-ascii?Q?lBg9dXL4YN3t/PlTDatIkuxzacfcwAf1mx8w+SXsRC+fHPGF7cLU7Ww/dZ0I?= =?us-ascii?Q?hfHfjHYAbVtYh6SmlN39RHUiCdWQ1mbTv9ptiGJ3u1C+unkTRtb9q+K+kvPP?= =?us-ascii?Q?mqwwlxa1dgusnzGP4o6STTEg57ijORU7xgMW9PEzrLoJoRJkeE4VfQTgalHY?= =?us-ascii?Q?GS8iLAnYyIYPROfRzcZPkwOFSt71KfqfFDvICJf8DKrE8mkUoljgQxfAs7Hb?= =?us-ascii?Q?JPL/0UjgIhBGizJU6MM6ymJz9h/nCtAKbZPsmaSs?= 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: DM6PR12MB3753.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fa18a29-6fd7-401f-2012-08db5c70b591 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2023 16:05:35.5193 (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: Vkm/v8KXhXPe1gv8YvzHYmkbujEUkALm6nwUGfaQLjBILZXKK6ECfD8ogAxU+hNjEJwdoKIGSV/IddODGJXvlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5991 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 > -----Original Message----- > From: Erez Ferber > Sent: Wednesday, May 24, 2023 3:02 PM > To: dev@dpdk.org > Cc: Slava Ovsiienko ; Matan Azrad > ; Raslan Darawsheh ; Erez Ferber > ; stable@dpdk.org > Subject: [PATCH] common/mlx5: adjust fork call with the new kernel API >=20 > From: Erez Ferber >=20 > While doing process fork() the operating system remaps all the parent > process's memory to the address space of the child process and activates = the > Copy-on-Write mechanics - it duplicates physical pages once memory writin= g > happens in the child process. Sometimes memory duplication is not allowed= - > for example, if the page contains hardware queue descriptors. To handle > similar issues the rdma-core library should be prepared for forking. >=20 > The ibv_fork_init() prepares the library to track all the related memory = and > prevent it from forking using madvise() system API. This approach allows = fork, > but not all the memory is forked to the child process and, application sh= ould > care not to touch pages where the parent application allocated the rdma-c= ore > objects. >=20 > The newer kernels propose an option of copy-on-fork for DMA pages and > tracking all the memory and disabling it for the forking is no longer nee= ded. > The new API routine ibv_is_fork_initialized() should be involved to decid= e if > library initialization for forking is required. >=20 > Fixes: 0e83b8e536 ("net/mlx5: move rdma-core calls to separate file") > Cc: stable@dpdk.org > Signed-off-by: Erez Ferber Acked-by: Viacheslav Ovsiienko