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 1BAD2A0C47 for ; Mon, 13 Sep 2021 16:40:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A648410E6; Mon, 13 Sep 2021 16:40:39 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 83F804014F; Mon, 13 Sep 2021 16:40:36 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10105"; a="218512974" X-IronPort-AV: E=Sophos;i="5.85,290,1624345200"; d="scan'208";a="218512974" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2021 07:40:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,290,1624345200"; d="scan'208";a="469465032" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga007.fm.intel.com with ESMTP; 13 Sep 2021 07:40:34 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 13 Sep 2021 07:40:34 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 13 Sep 2021 07:40:33 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 13 Sep 2021 07:40:33 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 13 Sep 2021 07:40:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MNQ0I7KjEC2oFYW7XLk8/qqbckues29BxmBJvy/HEckvGwWpKVIW0im2f+tjyYLLU/3V0cq/nE6NQboy4osoL1Hz79ri66/Y1PqTutdWrQEYs0CEPw6SwA/mk3IM0LvGdalacBeiSTKUeGsP7NMZZZflR+YokNtAoL6Iimrf1YUF91zsmbIrP+l9nG8XsbLimjNxEni9d0D5swajHMW7miOm+pI6Vbb1Y5qXDPZ7FZmc14ojeC5tj1D1cF90JWEMWwnh9ZRoGQjxu2K5MmdeZXwebo/aneJycRogcREbLSX9VrtN/bk4cYASzVPNI8zVs4DpeO0gTI5DQZ0z1bIVmg== 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; bh=xE2vZPuZFJWd+FyU3mJZbMJpcZMB1cVJ/QS8ZPIb9sY=; b=TiHjRGvFDPEN4P4mjoTKjswTnsZSQSTo+yW5AIF7BZlR99QtULqdbABI7kyocZ7pvjFlhqoCJX1T1VY10QQnLIa1ICGNx05boXwkK0uQ6KgzGY36mehW44MaNGu37qFLbs2h+16snlOQJUQAplhnje1eMlWo3Yly3L5jQ/K2FqDO1ptgBT8CA3Xttm94ZN6H40qM0i2zG5ZyYRizbsilOgqtcLD0rLdR2IjJQ2bw3JFWniGuk8ePOjkaPzoUWzOsnoz2VvnqKYGR3+I/ulpI1IM/tCzAdel4A8N46gAaRceKwooIVkjI/HMKnAn0xqTOFeV5NK+6aU/hN5WSF0UUwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xE2vZPuZFJWd+FyU3mJZbMJpcZMB1cVJ/QS8ZPIb9sY=; b=Q/DMCsQUvrSDMD4N784mvVrDOvRzBgYSHFgKielTEwZvmu4YR1D9zH7TtES8x4dODL2hATa9zx1bqqZfoyLkga6sVAjVW/v+Mk/cJJmUS7XM/5chBx5FXLUs5B8uQw+mJBZUlcb6eJJ3JyGWw6yNGocDjYZ3go8ZJSuXliuouz0= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) by PH0PR11MB5191.namprd11.prod.outlook.com (2603:10b6:510:3e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Mon, 13 Sep 2021 14:40:31 +0000 Received: from PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::d145:710a:1bac:7e91]) by PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::d145:710a:1bac:7e91%9]) with mapi id 15.20.4500.019; Mon, 13 Sep 2021 14:40:31 +0000 To: Bruce Richardson CC: , , References: <20210913110635.130387-1-bruce.richardson@intel.com> <48d75bc2-ae55-183c-8132-6e3e150647af@intel.com> From: "Burakov, Anatoly" Message-ID: Date: Mon, 13 Sep 2021 15:40:25 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DU2PR04CA0018.eurprd04.prod.outlook.com (2603:10a6:10:3b::23) To PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) MIME-Version: 1.0 Received: from [192.168.1.10] (212.17.34.161) by DU2PR04CA0018.eurprd04.prod.outlook.com (2603:10a6:10:3b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 14:40:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 10eaccc7-b3f9-41b6-6243-08d976c47001 X-MS-TrafficTypeDiagnostic: PH0PR11MB5191: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AX+QdMm2s6IRKK/GxE+YWaxmOYSX6cDGIVtMWSriDepiYXeJG+T9WIJa8bqLJUEVlHm9hLlvGUBkBqUooyAX60obhJlEGHdWR8Wa8liuD1tqsX1uNuCtO6oUoSCORZ92PRsYzm3j9uERYS8sJdpPRvG7s5PH6wNQRhr4gtPUSXDiiORudYJrddiZnCCnaHPJrobPsKgPlN/lS2I1iFZPv5qM59klOPKadrGj7pRXKctkNlP8QeeZDUCejN4SegOnviuNYbyORT3dWEMBkMajTTgcKCN1Ga8NL8NSxJoqdzAIMWRoEXp+66oj6ylRgW2Y0f4III6QSKU8eeL8S55neD1mrZ6j/vImjnCb4sW+AUTV7LfBDXEAPVYVXFf0KW15QvxBZPa3dCac/Zdz/zb0iZkJ0fa1DycJn7a+VTP3+b0LZ2e2HAgdKJdT1kpZ+a08Ciy5XNVFpH4/XA+p6QOJzb7JTdkPoQy7amjfYErYcj7FwfAJSD975AYuUkAxy9dwyz4tGcj93DlENF7gd1JjpbSXHM6VyIIAop7SpIfSksKgazhk3RkjtXCdB0So7ceBiyoXy0mQytxEJU4mHFysi1lST04qEXs/omKy5bVYGUAyaMT68tjtRBpY1SCPWRWlCCEbbO1EWK8/QOcoGt03gRSnX8craN6FTB19FTn5WrHeENEhNhbUP6951xOnAZVdNX8tokLgCNM9lDdSIvbR4pWo9/iMtpGNIn4hd3zrhNc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5093.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(136003)(346002)(39860400002)(376002)(2906002)(66556008)(316002)(66476007)(16576012)(5660300002)(66946007)(8676002)(6666004)(31696002)(478600001)(8936002)(37006003)(6486002)(2616005)(83380400001)(38100700002)(86362001)(6862004)(956004)(6636002)(4326008)(26005)(31686004)(36756003)(186003)(53546011)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?STZPS0hSenp4VXhOUU45UGpyZVNxbVRncCtTa2MyUkgyZ1F6NWNGZklmS0JD?= =?utf-8?B?NTVIYjJ5cDVhZU9mWGNVV0hZUmVxaXdrWjk3NzJ3UVBBdFNQNWpJTzUyQm0v?= =?utf-8?B?aGxBbDlscUxST253SHo1Zjl1SjR5QUZKTTR5OSt0b1I1bFhsdnNwWVRIUm12?= =?utf-8?B?WnNkZ2x2Uit4S21kcXFKR2pDcEZ6S0Y0MDE2NCtjL1N1RERUTkh2b0gwWlJO?= =?utf-8?B?VUdNR3pON2tSQnEwMkdaU0x2cTZBOFFrNFZUYmJzZldNb1p1SEsrZlVxNWxz?= =?utf-8?B?WmRvaERqTGhuQWw5MVFWcW8xS3ZZSllnR1llR2JLOTFXZXhDdEZj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9mN29mUWZnNmduZjlSeERGMzI1dzhS?= =?utf-8?B?Y0w0dDNmQithcEtVSTh4UkJkYWRRcjB0d1hxbGR4VFlOK1dwU3ErbE1xNFd2?= =?utf-8?B?UFlHbnlUejVEd3ZLWmVHeGpVQ2dGL3Z5bHo0bVBHYS9wVWtkWGJIZlN1YTdu?= =?utf-8?B?enMzY29rQU9rLzB3TlhsWkJISlJSVjA4bUpNMVRWR294TjdoY0RmMkMvaFNG?= =?utf-8?B?cGVtb201V01tOXFSOS96bWdDR0Z3eHFqTy9VdlcvT1c0TzFjY0RXNUtoUnhE?= =?utf-8?B?bFIwaGJjN2UxZ3lWby9KYmdSV21HS3Vsc0VFVWUyMnJwd3pidXh3VW5wVWRn?= =?utf-8?B?WkpXcTZGM09QUDdPbWxRaFRiWSt6QmZML1J0QnRGSEs5YzFEZ2NWTUI4RDRK?= =?utf-8?B?cnA0a2hEbzdtaVB3T3dhcmR6SXRjRm1lYkhEazN4QjQyVUFIMWhWMFdMQVFt?= =?utf-8?B?UENwSSswQyttV25PMXhYcnpvL2YveGd1eTh3SWRsWkdlck1RWHNRVmJDNDdC?= =?utf-8?Q?oZFRlAiaEtCmvICjQc/X69AL6FPnVAt2aOBKb1e?= X-MS-Exchange-CrossTenant-Network-Message-Id: 10eaccc7-b3f9-41b6-6243-08d976c47001 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5093.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 14:40:31.5856 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6bWGkoyaJgPn04hASz+CrkRDJyrtssSBnJ86JfB50eWY1klbJAMCZ/6ZvejWQvQQamrX+m1RfiBKotoas31JFWay0VceBTPQ+aDKduwxhS0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5191 X-OriginatorOrg: intel.com Subject: Re: [dpdk-stable] [PATCH] eal/freebsd: lock memory device to prevent conflicts X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 13-Sep-21 2:36 PM, Bruce Richardson wrote: > On Mon, Sep 13, 2021 at 02:14:55PM +0100, Burakov, Anatoly wrote: >> On 13-Sep-21 12:06 PM, Bruce Richardson wrote: >>> Only a single DPDK process on the system can be using the /dev/contigmem >>> mappings at a time, but this was never explicitly enforced, e.g. when >>> using --in-memory flag on two processes. To prevent possible conflict >>> issues, we lock the dev node when it's in use, preventing other DPDK >>> processes from starting up and causing problems for us. >>> >>> Fixes: 764bf26873b9 ("add FreeBSD support") >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Bruce Richardson >>> --- >>> lib/eal/freebsd/eal_hugepage_info.c | 4 ++++ >>> 1 file changed, 4 insertions(+) >>> >>> diff --git a/lib/eal/freebsd/eal_hugepage_info.c b/lib/eal/freebsd/eal_hugepage_info.c >>> index 408f054f7a..4a8d87c23e 100644 >>> --- a/lib/eal/freebsd/eal_hugepage_info.c >>> +++ b/lib/eal/freebsd/eal_hugepage_info.c >>> @@ -90,6 +90,10 @@ eal_hugepage_info_init(void) >>> RTE_LOG(ERR, EAL, "could not open "CONTIGMEM_DEV"\n"); >>> return -1; >>> } >>> + if (flock(fd, LOCK_EX) < 0) { >>> + RTE_LOG(ERR, EAL, "could not lock memory. Is another DPDK process running?\n"); >>> + return -1; >>> + } >>> if (buffer_size >= 1<<30) >>> RTE_LOG(INFO, EAL, "Contigmem driver has %d buffers, each of size %dGB\n", >>> >> >> This only gets triggered when regular init path is chosen, i.e. --no-huge >> still works. > > Yes, but that is ok, I think, since no-huge doesn't use these resources or > suffer from this problem. On the other hand, except for running unit tests, > no-huge mode is pretty useless on FreeBSD as we don't have any > vfio-equivalent support, so all HW access has to use physical addresses > which can only be got using contigmem. What i meant to say was, i've checked this against '--no-huge' which *should* still work with this patch, and it does :) So, the phrasing was unfortunate, but we agree! > >> I'm a bit uneasy with --in-memory mode pretending to work on >> FreeBSD and Windows, but that's a separate problem :) > > Yes, it is, though one that does belong is the same area as this one. The > "fix" is probably to just print a warning when --in-memory is used, > informing the user that the flag is ignored and then continue. > Alternatively we can error out, but I think the warn+continue is better, > myself. I think erroring out is better. The feature is intended to work a certain way, so if we can't guarantee that it does, we can't pretend it is "supported" or "is working". But again, irrelevant to this patch :) > >> As far as the patch >> goes, the problem it addresses does get fixed. >> >> Reviewed-by: Anatoly Burakov >> > Thanks. > > /Bruce > -- Thanks, Anatoly