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 6C590A0C41 for ; Tue, 30 Nov 2021 17:38:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6707C411E6; Tue, 30 Nov 2021 17:38:25 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 63595411DF for ; Tue, 30 Nov 2021 17:38:24 +0100 (CET) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 3EF3840009 for ; Tue, 30 Nov 2021 16:38:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290304; bh=Dk7fk5vJp001ng8m/8WVXqkJ756ndVVSF2n7dxDI1rc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AMsDhJ5sAFNCtf+JvSZXhtaD0he1vMwi9nx2XzYlFyS5Pf1PFS9YTOQ7esxRLod3s ido0lC9Gh0I2hxbbZuZTcIPoxkxFGYxuW1OFbDwsEBTixS0dag1Hr9cdETlq1M4CuS qVKySoABShhinexvAIxKS0OuN8k7Ljdhbee5aoNa1d5QzDi7pd4TD6czYbZcTyQne1 zaZt5Pi16gsknRJOYwXPwh+gPnI6doXgtTSf548wi+0jhHMdTi0VxnJRCrHQha8jx+ 2Hm3MkF/WSiM/Agy/SuCs7OxwPOR+Yy75Jc4j8biJln81I2Rlm2JaXBQcNFwzSVNRZ j181qBCj7mcdw== Received: by mail-ed1-f72.google.com with SMTP id t9-20020aa7d709000000b003e83403a5cbso17488004edq.19 for ; Tue, 30 Nov 2021 08:38:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dk7fk5vJp001ng8m/8WVXqkJ756ndVVSF2n7dxDI1rc=; b=RhYgvtkWG2jMwAppTwNyY4Hm0rCQ7xM4HtZ5xKvaN7PVCK/sQx7U7yDfMURkFSEohy kjRG+UMN5ZWTXdb8xxavcLZANLEIVjpVNCquL3jaSLg+ekCxhkDJT2lCDDWjEIc9FA66 pwwlzNV++bw4xnlcCfSLNrtKIxf781W0T9zyClncwuP2WY4TRZDS1j2elDjlgLRkdfvX ohcwUB+Nsvw7/qmo8pn374gN9In1wuPMFMty2e5N6TlnGODNuNTlu23UpSqGeah+/nXO uY17Mc/R2K0ZYBGFqC4cp5a8/dZKG5DN0dLCtMlioU9IKh9rV3wndURwGEEITOyz+4TZ Xa3Q== X-Gm-Message-State: AOAM532/tmBWDB74tsVwvSPXxE1xgVF9htC29xuhiI2esBCsbidy4Yab CvVQ1yFe3Q/NwgGGuZMJkrh6ED2ektGr2IPw7iW8tfInOSR7fI19YwNYISS8N2SUp/oyXEcUtRY OR9k2pLZ3CYFR9OOCjvUFq7U7 X-Received: by 2002:a05:6402:354e:: with SMTP id f14mr17148edd.245.1638290303944; Tue, 30 Nov 2021 08:38:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzq5mcmM0clQofYoOebc/DYrvX1TLC8kcOu/cMwY0UGT4L8TJJXfkREp2hVX9ekS7pp0QaKGA== X-Received: by 2002:a05:6402:354e:: with SMTP id f14mr17119edd.245.1638290303795; Tue, 30 Nov 2021 08:38:23 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id qb21sm9610928ejc.78.2021.11.30.08.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:38:23 -0800 (PST) From: christian.ehrhardt@canonical.com To: Bruce Richardson Cc: Anatoly Burakov , dpdk stable Subject: patch 'eal/freebsd: lock memory device to prevent conflicts' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:34:09 +0100 Message-Id: <20211130163605.2460997-45-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/33708f0d770a4afad8a65fc507ebc21ff463600a Thanks. Christian Ehrhardt --- >From 33708f0d770a4afad8a65fc507ebc21ff463600a 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 [ 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/eal_hugepage_info.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/librte_eal/freebsd/eal/eal_hugepage_info.c b/lib/librte_eal/freebsd/eal/eal_hugepage_info.c index 32012e1427..a2327b6edd 100644 --- a/lib/librte_eal/freebsd/eal/eal_hugepage_info.c +++ b/lib/librte_eal/freebsd/eal/eal_hugepage_info.c @@ -85,6 +85,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.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:08.684337416 +0100 +++ 0045-eal-freebsd-lock-memory-device-to-prevent-conflicts.patch 2021-11-30 16:50:05.658872561 +0100 @@ -1 +1 @@ -From 47a4f2650c71d9197231a95c5df8f89d0f65e882 Mon Sep 17 00:00:00 2001 +From 33708f0d770a4afad8a65fc507ebc21ff463600a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 47a4f2650c71d9197231a95c5df8f89d0f65e882 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -18 +19 @@ - lib/eal/freebsd/eal_hugepage_info.c | 4 ++++ + lib/librte_eal/freebsd/eal/eal_hugepage_info.c | 4 ++++ @@ -21,5 +22,5 @@ -diff --git a/lib/eal/freebsd/eal_hugepage_info.c b/lib/eal/freebsd/eal_hugepage_info.c -index 408f054f7a..9dbe375bd3 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) +diff --git a/lib/librte_eal/freebsd/eal/eal_hugepage_info.c b/lib/librte_eal/freebsd/eal/eal_hugepage_info.c +index 32012e1427..a2327b6edd 100644 +--- a/lib/librte_eal/freebsd/eal/eal_hugepage_info.c ++++ b/lib/librte_eal/freebsd/eal/eal_hugepage_info.c +@@ -85,6 +85,10 @@ eal_hugepage_info_init(void)