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 88F24A034F for ; Wed, 10 Nov 2021 07:42:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7E2C74014D; Wed, 10 Nov 2021 07:42:09 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2076.outbound.protection.outlook.com [40.107.93.76]) by mails.dpdk.org (Postfix) with ESMTP id 0F6E24068B for ; Wed, 10 Nov 2021 07:42:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CXBipsxxs42JreUCG489V4/2hk7MNkyKk0Wkjx7Eeyu9XtnJZWeCRpb6eiAw1zfOwuGVjoHxeTpyYymYZyjLIyOGegbwlxHxYysabUuZ5X8eNOxyl6YmtwgOjqVuzeZQPYpLBiQAwtcrR9rV4tqc6+UP5QJpOmz/joHdVeoSLt+bSpwXBl8pumwVt5cQOwnAuG7WGXaswdQVwjfs2NtFtPH43It41cxE0YLBqpiuL/lTx6q/27aDSHVgoVh7/12O1N66dtnyIkwaGXcefjpzsqt4Sq/gB8B09YybdM8JF8PvwNRhMGPXQpMf/CNeMdyG7StuUUwovMLoRghwb9pHIA== 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=ni/8Na3tfPVzdo6wLntb+IJmMxoSWQAyIagpM7o38ZQ=; b=bqvkaDVId9Fi1WPQ1b8RIkKKCyPZ1sVcsVmSgIjRPTvArVTD22hozK5ZkFkgeafK066IrbkyH865BtM/bV0CoIjUO1G1pO74uUICVaYCKiUtE8wPJcjlpdQwiW+GKG6HCY0mNwqqQhXo5a6Z5Wn6Yq9g2RI/4z55KSLS1E1sqX98k+rX3YdtQbFbPOhHlXpvc2cpYRedSEVbMaJO9CVdp7nkojE8VkJLYG2wwNjWeeYHG8AE8Xli/7vziL9eRdXeqqtYxG2tZjb2qBUe5OMoKBFOb73lDt4ZC+GdokXjL3r+vUlzFXlmY7K3Z0VG7fFJi94x0UO48pBfAGEi+Ght0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=ni/8Na3tfPVzdo6wLntb+IJmMxoSWQAyIagpM7o38ZQ=; b=gSV7M5bnmQ3HFQlM68jid4ad7E26RJ8juFSIhKVFxegmocHDQFQbqNm+ADDpog3wl0BuR8tAzOXaZSccGCuTgsTL3TQTM5z++iJ0UAQh5sSTxKKO7Frz+mhhLDgkqqVwlgpx9KFL1Trgqwrh9PImp7ruBpoJn1uoDTh56st7UlZSXOBSm9vG4+LhVnJrcwxy/EsClVNWro4eOLynnMEFLM4Ky/dtFbhhKcunlzUSh/u3Ds+PYAfkVYyK42kdrEVsGsy0a0j8Hv1nECe/609wUcl/xWXV/xkCqljjO0hRRgGEgJmNvzqsHynXs97qP8OD01xOLpGC2dKDgWQ8lWWPuw== Received: from DS7PR03CA0014.namprd03.prod.outlook.com (2603:10b6:5:3b8::19) by MWHPR12MB1360.namprd12.prod.outlook.com (2603:10b6:300:12::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 06:42:05 +0000 Received: from DM6NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b8:cafe::9b) by DS7PR03CA0014.outlook.office365.com (2603:10b6:5:3b8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:42:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT032.mail.protection.outlook.com (10.13.173.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:42:02 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:41:59 +0000 From: Xueming Li To: Bruce Richardson CC: Luca Boccassi , Anatoly Burakov , dpdk stable Date: Wed, 10 Nov 2021 14:29:30 +0800 Message-ID: <20211110063216.2744012-87-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0f34d8e1-e16b-4e61-5d80-08d9a4153401 X-MS-TrafficTypeDiagnostic: MWHPR12MB1360: 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: XuROeaCCYeloHPwCWH7Xz/DdbSNmKBshQb6xVTIlIN0d8pdJOtTwfHbX7W52dopmYTiXWbigz1z4JXxONWQg43cQTqSrKVyxfqnmlMCg1Kfj+2Yfj1fWqWAsxxn81QbwMrXFy1L8afkZJPR4Otl2hxV28x0IdSDsFmEONNugHITmpLXWgqf35fK7jops7cCpGLv2ecG1JT/EqbZY4UBFIVM35UoJh1WT5nWZ+ZBfYLCFCHmIQHKmuZ14Et0jdEIt9Sl2HvfRWa0YOfC7Nt/2XoOJn8YZ4emz2a0iXEQts7kcbDyD35MdAInahyRTpsCVoH54XJ+tpjaPktp6SKBv9RMZBq6G/gBg9Wp4VTlQWHulcZUBjmHS47S1yUej24viZ56l62HV8FRew9WMHv9HtUcp7iJfj0zbS1o2e+sz7CvJegjgKtcohYmlHr5Li3BO4VEiseot6OIAwtjM359qqzk1siwsUNUirL2TaSSIRb0brQZN6HJiEVoDrzbMBXZeYZ6wKXyMyT3iobZXs1IrJfd66Fr8Mlq80z4KerUrceTPN31opAvARYcK3pnrYtudZsYjpG7JSkTQNpcFHpa6aWL25OTnu0epPgJ93zrn1C7EynZnDbk2u9fiBfOFK//dYQ/4ONlgmn3mri2UuN1u5m6caSZPfyDrgagUxyi5XzVhISAxJyMB4t5pDyEcO6qalF0ixChZuBFjN0dc/9dM2i5yf79t41hr/s4tQGEa9FMAE+DpChMeIQ3SnaZkNOFWi3wFwPqz9sulD5V5jxVl6q2mWLAUWYgJ8Ab3zoXUYGn6pj/Mdn0qY0LOCOSz9623sTkDiPqMLSkjpal0IkXXqA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(16526019)(186003)(2616005)(6286002)(7696005)(966005)(83380400001)(426003)(4001150100001)(4326008)(70586007)(36756003)(508600001)(70206006)(8936002)(1076003)(86362001)(6916009)(336012)(2906002)(316002)(8676002)(47076005)(26005)(5660300002)(7636003)(54906003)(356005)(55016002)(6666004)(36860700001)(82310400003)(53546011); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:42:02.2389 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f34d8e1-e16b-4e61-5d80-08d9a4153401 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1360 Subject: [dpdk-stable] patch 'eal/freebsd: lock memory device to prevent conflicts' has been queued to stable release 20.11.4 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" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/95934ebba9b415b9f234dbe7e65319395d1a7a24 Thanks. Xueming Li --- >From 95934ebba9b415b9f234dbe7e65319395d1a7a24 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Mon, 13 Sep 2021 15:08:48 +0100 Subject: [PATCH] eal/freebsd: lock memory device to prevent conflicts Cc: Xueming Li [ upstream commit 47a4f2650c71d9197231a95c5df8f89d0f65e882 ] 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") Signed-off-by: Bruce Richardson Reviewed-by: Anatoly Burakov --- lib/librte_eal/freebsd/eal_hugepage_info.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/librte_eal/freebsd/eal_hugepage_info.c b/lib/librte_eal/freebsd/eal_hugepage_info.c index 408f054f7a..9dbe375bd3 100644 --- a/lib/librte_eal/freebsd/eal_hugepage_info.c +++ b/lib/librte_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 | LOCK_NB) < 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", -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:05.868796238 +0800 +++ 0086-eal-freebsd-lock-memory-device-to-prevent-conflicts.patch 2021-11-10 14:17:01.847412948 +0800 @@ -1 +1 @@ -From 47a4f2650c71d9197231a95c5df8f89d0f65e882 Mon Sep 17 00:00:00 2001 +From 95934ebba9b415b9f234dbe7e65319395d1a7a24 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 47a4f2650c71d9197231a95c5df8f89d0f65e882 ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -18 +20 @@ - lib/eal/freebsd/eal_hugepage_info.c | 4 ++++ + lib/librte_eal/freebsd/eal_hugepage_info.c | 4 ++++ @@ -21 +23 @@ -diff --git a/lib/eal/freebsd/eal_hugepage_info.c b/lib/eal/freebsd/eal_hugepage_info.c +diff --git a/lib/librte_eal/freebsd/eal_hugepage_info.c b/lib/librte_eal/freebsd/eal_hugepage_info.c @@ -23,2 +25,2 @@ ---- a/lib/eal/freebsd/eal_hugepage_info.c -+++ b/lib/eal/freebsd/eal_hugepage_info.c +--- a/lib/librte_eal/freebsd/eal_hugepage_info.c ++++ b/lib/librte_eal/freebsd/eal_hugepage_info.c