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 7640C41D4F for ; Thu, 23 Feb 2023 10:38:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6EF8A4316E; Thu, 23 Feb 2023 10:38:44 +0100 (CET) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mails.dpdk.org (Postfix) with ESMTP id C0D8C427E9 for ; Thu, 23 Feb 2023 10:38:42 +0100 (CET) Received: by mail-wr1-f47.google.com with SMTP id i11so3968488wrp.5 for ; Thu, 23 Feb 2023 01:38:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CbS6JRGxCbJ4YI20bCz1BcEQ/PutCuo8VZenpcLI/SM=; b=FYuZD0zxavkdCXtg8GTodLYObyfvwpuw7FZ077gY6IUne6IF5lpaKqxzK8I2YOIBIE Vk9nI4xcZK/hd0YYkNpfwPA+nc9NEthw2ImxbH/2g6SS21ykPqFe0v6AM+AaImXmkmLj H9N5eaKj4KyajPOLtoKV6mefZjJUjUtQJSRceJwMLWs++ykWFWuaZM6UjnUq8ssdZsBP gUjoMhDPgIK6vFBQGzqpcZ4oxSmyBvrpxc0Pq2RTXnMyWhnUzZiE3ZUOjkTExrTVjmg2 IwE42rIS8DX9duKIUHFqjF0Rg9/FZRhpIZ35lCXzCP4Gy0gpJphS6srSmmfqoz/+rl6B NoXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CbS6JRGxCbJ4YI20bCz1BcEQ/PutCuo8VZenpcLI/SM=; b=txrfZ6Ogv8H27TM9gioym8MRTUqfylqIrwOWctgrzZhufwvFa0JFWGq2e4n8iRhNo6 xCFQub4O4DQdncwrmUF8fGtjGjIpI3LsuLCRMWZyMroh9MOMEs5O6Qj61gVTgefVD53W UJa1jMNysAbtmX9EEouff8B65uUOxXx5shaWs5k6UAlGJ1jqSxI9s+NBJfty84l+Oyu4 uK9rVW/+W89Re6bUK3KIi7IkT4iIGpTTBTU7sXkqxJ2ognLbbGdZZBupxSy6cHcCDVJz tHCcPmBzI6ZNkhqrRxyK6p5BKMS7zTSorbJuIHF6whGHlbdJAHZb2oMaG3+EzS3nuA3Y hF1g== X-Gm-Message-State: AO0yUKUzlwp68go/wMaPxjZGMqBk8gnTfXzvtjujKcmzM91sgTdgsk2D AvSf43KZBfXdcpJp0PD3836/LHr9j2U= X-Google-Smtp-Source: AK7set/XXr5W0wdIZ29ShyxYt8S6xVUvsMwVqc1HvIh5B2l2JgwbQ1s6+bxlyVnm7Lr4yQ3z/N3SIw== X-Received: by 2002:a5d:67d2:0:b0:2c5:a6c4:7fd3 with SMTP id n18-20020a5d67d2000000b002c5a6c47fd3mr9313489wrw.8.1677145122438; Thu, 23 Feb 2023 01:38:42 -0800 (PST) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id j16-20020a056000125000b002c5706f7c6dsm6396993wrx.94.2023.02.23.01.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 01:38:42 -0800 (PST) From: luca.boccassi@gmail.com To: Chengwen Feng Cc: David Marchand , dpdk stable Subject: patch 'mem: fix hugepage info mapping' has been queued to stable release 20.11.8 Date: Thu, 23 Feb 2023 09:36:30 +0000 Message-Id: <20230223093715.3926893-26-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230223093715.3926893-1-luca.boccassi@gmail.com> References: <20230223093715.3926893-1-luca.boccassi@gmail.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 20.11.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/25/23. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/c9375a166c7f23a35c3f8bc0aae05cbb90f25ae0 Thanks. Luca Boccassi --- >From c9375a166c7f23a35c3f8bc0aae05cbb90f25ae0 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Mon, 6 Feb 2023 10:53:10 +0000 Subject: [PATCH] mem: fix hugepage info mapping [ upstream commit 66e7ac416f3d62c5ee773ff02c115a24da9f1991 ] The map_shared_memory() function should treat mmap MAP_FAILED as NULL because callers compare it with NULL to determine whether the map is failed. Fixes: 764bf26873b9 ("add FreeBSD support") Fixes: cb97d93e9d3b ("mem: share hugepage info primary and secondary") Signed-off-by: Chengwen Feng Reviewed-by: David Marchand --- lib/librte_eal/freebsd/eal_hugepage_info.c | 2 +- lib/librte_eal/linux/eal_hugepage_info.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/freebsd/eal_hugepage_info.c b/lib/librte_eal/freebsd/eal_hugepage_info.c index 9dbe375bd3..e58e618469 100644 --- a/lib/librte_eal/freebsd/eal_hugepage_info.c +++ b/lib/librte_eal/freebsd/eal_hugepage_info.c @@ -33,7 +33,7 @@ map_shared_memory(const char *filename, const size_t mem_size, int flags) } retval = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); close(fd); - return retval; + return retval == MAP_FAILED ? NULL : retval; } static void * diff --git a/lib/librte_eal/linux/eal_hugepage_info.c b/lib/librte_eal/linux/eal_hugepage_info.c index 4191af6a21..e8f79a0ee7 100644 --- a/lib/librte_eal/linux/eal_hugepage_info.c +++ b/lib/librte_eal/linux/eal_hugepage_info.c @@ -57,7 +57,7 @@ map_shared_memory(const char *filename, const size_t mem_size, int flags) retval = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); close(fd); - return retval; + return retval == MAP_FAILED ? NULL : retval; } static void * -- 2.39.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-23 09:36:29.311410509 +0000 +++ 0026-mem-fix-hugepage-info-mapping.patch 2023-02-23 09:36:28.222169866 +0000 @@ -1 +1 @@ -From 66e7ac416f3d62c5ee773ff02c115a24da9f1991 Mon Sep 17 00:00:00 2001 +From c9375a166c7f23a35c3f8bc0aae05cbb90f25ae0 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 66e7ac416f3d62c5ee773ff02c115a24da9f1991 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -17,2 +18,2 @@ - lib/eal/freebsd/eal_hugepage_info.c | 2 +- - lib/eal/linux/eal_hugepage_info.c | 2 +- + lib/librte_eal/freebsd/eal_hugepage_info.c | 2 +- + lib/librte_eal/linux/eal_hugepage_info.c | 2 +- @@ -21 +22 @@ -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 +24,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 @@ -34,5 +35,5 @@ -diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c -index a1b6cb31ff..24411d9c5b 100644 ---- a/lib/eal/linux/eal_hugepage_info.c -+++ b/lib/eal/linux/eal_hugepage_info.c -@@ -50,7 +50,7 @@ map_shared_memory(const char *filename, const size_t mem_size, int flags) +diff --git a/lib/librte_eal/linux/eal_hugepage_info.c b/lib/librte_eal/linux/eal_hugepage_info.c +index 4191af6a21..e8f79a0ee7 100644 +--- a/lib/librte_eal/linux/eal_hugepage_info.c ++++ b/lib/librte_eal/linux/eal_hugepage_info.c +@@ -57,7 +57,7 @@ map_shared_memory(const char *filename, const size_t mem_size, int flags)