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 74CFBA0C3F for ; Sat, 12 Jun 2021 01:14:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F0164003F; Sat, 12 Jun 2021 01:14:06 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2057.outbound.protection.outlook.com [40.107.93.57]) by mails.dpdk.org (Postfix) with ESMTP id 3A67340691 for ; Sat, 12 Jun 2021 01:14:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VL939gsqbzux8gqyuAYuDz8Mq599h2VS1aPtSofLqapJgApqcmkLpr4XfDkSC8aS2LJXYtHwmxz1ulMWb1HOPW6PB0ykUsjCdQ6AwnuI2cOOYW0rqqUFgH0al36wAsk3u/gYKFVfnO4FcJcCEmQlFszuoCzvmOD8zxOxOQ9MOEdwIsGfdUNWSd8sUUlt2IooKbmWrQIbnCZ7iRtpNX12krq4ayvnlQMepzbHBzYUv0dKpiwV90ogz84l4Ml1cVYmaZngO7CeR0IgZW49C9VeW6jWlakmqQHN7BLz7OhPHbd7cMFFsHCt8aPfUKfjC817pzZoIywt/C0I2FLjXXiF7g== 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-SenderADCheck; bh=NFX0ciOqwLFCHRcj2JqYd4hQTz5CUoBICHY+c6s54gc=; b=Tf0wjrlJO4j1RMO/QHYoC3RsS3YEyVrK3L26VBNKqrUAqY5NrFvwAS3QXuPMqmR3CENoaUd1piokderFHgU2qGP3Y1tiik803TLz7aZ0naHjvTqqvwzP23U6D73Vub3ESVCaB+iJdbDXLVM6okfwiRFmpa0LNRiA/7N5znKZDgmnXQA+baEeMdz2ywy4JU2h3zNlMx1gB6phXHlAxfZ7vhE3RjLqaeynZrRlLsw+QvpKao4vOmjQisQy5GhgLhoUNd5idxTVENMivOmtOUNtOTEytXhIx6bU8kriT4jEweItbisrUv8VbDor101pHYPg4/4sJfaDT38lqpniOXSe6A== 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=none sp=none 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=NFX0ciOqwLFCHRcj2JqYd4hQTz5CUoBICHY+c6s54gc=; b=VdRU5ULcokMieYDAYJ+3SK09DL9fOw/GQIqZ4U5PoH5t8AZS9UcfZJ6npS1GfzL24QJOZXZ1Nj7AP1M98KVYUC3Tv4yjRnFPh/9df2rZE/kZg8nI8BldQyz9X9pfcAsf1wWnGkwwrp9F/mx/pHkV6EpU+KnzeiCRE+ErbAbxu8woFJSSQ7VpYHsZ6Uj9OFNJfPignv7AtE7whBkYik11bRH2P5uI7AFlL0+qn4z+QGfw23fhOdQ9XTqpX7q722Ac2YeN6eciq4ZJWWRgnBlT5DijvN+G4mn2i3C3zA7vz8NZ27tB3Ny1hvI/P2yaJy85jk1/TG8FqHcq7tTZ2qDgag== Received: from BN9PR03CA0628.namprd03.prod.outlook.com (2603:10b6:408:106::33) by BY5PR12MB5016.namprd12.prod.outlook.com (2603:10b6:a03:1c5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Fri, 11 Jun 2021 23:14:03 +0000 Received: from BN8NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:408:106:cafe::e5) by BN9PR03CA0628.outlook.office365.com (2603:10b6:408:106::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Fri, 11 Jun 2021 23:14:02 +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 BN8NAM11FT013.mail.protection.outlook.com (10.13.176.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4219.21 via Frontend Transport; Fri, 11 Jun 2021 23:14: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.2; Fri, 11 Jun 2021 23:14:00 +0000 From: Xueming Li To: Lance Richardson CC: Luca Boccassi , Anatoly Burakov , dpdk stable Date: Sat, 12 Jun 2021 07:03:11 +0800 Message-ID: <20210611230433.8208-97-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210611230433.8208-1-xuemingl@nvidia.com> References: <20210510160258.30982-229-xuemingl@nvidia.com> <20210611230433.8208-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: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eabb14fc-0823-437b-8da6-08d92d2e9a2a X-MS-TrafficTypeDiagnostic: BY5PR12MB5016: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6HL8MQ44kRC+o2YgP3pZ1MaMZPTq51QX+zzwh71t7D6nZVx5KEn39RtXQsBOJgGkfEuHpI96KC6VxzzrePEws/rSqIBHX146oWlcMPBv4gAiMmLYOkghFfkXW7BRksGamjCQeUENkTZ06jjdxELbFF1/U7clcq/QTU1tnCi/udmoQ4Ryd0gjca4Ni6RYzkpQqY4sPWO4XGElehoDXPdYCS+melT6pBvtYX/m+by56E3vPZzeNkeQ6M//pdeMuLfnSEIXIxGDaP9g5V+iwWfax1mR8K/dbYti1hB7BbVytNDLnb0NpOcMaDB6kGGMvNdm9ePRz8vyxeDzUv5JKWAoqRMoKxdImOKJjU8djxXkG69BQC/mFZ8ntSCdhlXnmY8cP4U7QN/DXx60H2dZJV9Qn/UbEBtYAlePdOgaPP9vw9y4NfxSJG4Ri27ksvuWRMueo1KAsi1Ozm2aDm9udSDl3pi3FHnL2Dto+BdQL2z60r+WQU6i/vT84Bm1b1e3d9NPhIDLiVY8DIYX6V3loMwOlPMQTyccWmIMh2Wv38JnSF3P8zhJgPz8NoeSQoXQnaWrKn8D1ND0+OaPjrP6KOldzZ0Vh0j4L1D7KjNhB1SHmtXnteJyb1lZvJakKAYtZCCnYNUwgpP1bj1U/in/CLEsLli/gEfDMZZtxQvhkYTwe7pPIQBLaDZR+nqHBRwCVq0OIpEEXeDiQD+9B2vqoQkt0/sNx6mPTI7E6zeCIeFLdxuvwrnX7fulI4lTd/p01uY89voBW5AlEJsM+GzQeEuAkuK6rymEOkEgl2vJqMs4wAIXidaSK74bh+/GfYJOBaVu 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)(376002)(39860400002)(346002)(396003)(136003)(46966006)(36840700001)(966005)(55016002)(426003)(36906005)(2906002)(336012)(1076003)(70586007)(316002)(26005)(47076005)(478600001)(82310400003)(53546011)(8676002)(356005)(186003)(83380400001)(82740400003)(5660300002)(4326008)(36756003)(6666004)(8936002)(6916009)(7696005)(6286002)(7636003)(16526019)(54906003)(36860700001)(86362001)(70206006)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 23:14:02.5702 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eabb14fc-0823-437b-8da6-08d92d2e9a2a 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: BN8NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB5016 Subject: [dpdk-stable] patch 'eal: fix memory mapping on 32-bit target' has been queued to stable release 20.11.2 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.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/14/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/3aadd33dd27258388af609121ea1dd415f575b05 Thanks. Xueming Li --- >From 3aadd33dd27258388af609121ea1dd415f575b05 Mon Sep 17 00:00:00 2001 From: Lance Richardson Date: Sat, 8 May 2021 10:27:53 -0400 Subject: [PATCH] eal: fix memory mapping on 32-bit target Cc: Luca Boccassi [ upstream commit 6beb2d294743aad1488234109a3ad95a8d5a273f ] For 32-bit targets, size_t is normally a 32-bit type and does not have sufficient range to represent 64-bit offsets that are needed when mapping PCI addresses. Use uint64_t instead. Found when attempting to run 32-bit Linux dpdk-testpmd using VFIO driver: EAL: pci_map_resource(): cannot map resource(63, 0xc0010000, \ 0x200000, 0x20000000000): Invalid argument ((nil)) Fixes: c4b89ecb64ea ("eal: introduce memory management wrappers") Signed-off-by: Lance Richardson Acked-by: Anatoly Burakov --- lib/librte_eal/include/rte_eal_paging.h | 2 +- lib/librte_eal/unix/eal_unix_memory.c | 11 ++++++----- lib/librte_eal/windows/eal_memory.c | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/librte_eal/include/rte_eal_paging.h b/lib/librte_eal/include/rte_eal_paging.h index ed98e70e9e..c60317d0f5 100644 --- a/lib/librte_eal/include/rte_eal_paging.h +++ b/lib/librte_eal/include/rte_eal_paging.h @@ -61,7 +61,7 @@ enum rte_map_flags { __rte_internal void * rte_mem_map(void *requested_addr, size_t size, int prot, int flags, - int fd, size_t offset); + int fd, uint64_t offset); /** * OS-independent implementation of POSIX munmap(3). diff --git a/lib/librte_eal/unix/eal_unix_memory.c b/lib/librte_eal/unix/eal_unix_memory.c index ec7156df96..68ae93bd6e 100644 --- a/lib/librte_eal/unix/eal_unix_memory.c +++ b/lib/librte_eal/unix/eal_unix_memory.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -24,14 +25,14 @@ static void * mem_map(void *requested_addr, size_t size, int prot, int flags, - int fd, size_t offset) + int fd, uint64_t offset) { void *virt = mmap(requested_addr, size, prot, flags, fd, offset); if (virt == MAP_FAILED) { RTE_LOG(DEBUG, EAL, - "Cannot mmap(%p, 0x%zx, 0x%x, 0x%x, %d, 0x%zx): %s\n", - requested_addr, size, prot, flags, fd, offset, - strerror(errno)); + "Cannot mmap(%p, 0x%zx, 0x%x, 0x%x, %d, 0x%"PRIx64"): %s\n", + requested_addr, size, prot, flags, fd, offset, + strerror(errno)); rte_errno = errno; return NULL; } @@ -106,7 +107,7 @@ mem_rte_to_sys_prot(int prot) void * rte_mem_map(void *requested_addr, size_t size, int prot, int flags, - int fd, size_t offset) + int fd, uint64_t offset) { int sys_flags = 0; int sys_prot; diff --git a/lib/librte_eal/windows/eal_memory.c b/lib/librte_eal/windows/eal_memory.c index 2cf5a5e649..4db048ccb5 100644 --- a/lib/librte_eal/windows/eal_memory.c +++ b/lib/librte_eal/windows/eal_memory.c @@ -508,7 +508,7 @@ eal_mem_set_dump(void *virt, size_t size, bool dump) void * rte_mem_map(void *requested_addr, size_t size, int prot, int flags, - int fd, size_t offset) + int fd, uint64_t offset) { HANDLE file_handle = INVALID_HANDLE_VALUE; HANDLE mapping_handle = INVALID_HANDLE_VALUE; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-06-12 06:53:59.125112700 +0800 +++ 0097-eal-fix-memory-mapping-on-32-bit-target.patch 2021-06-12 06:53:56.450000000 +0800 @@ -1 +1 @@ -From 6beb2d294743aad1488234109a3ad95a8d5a273f Mon Sep 17 00:00:00 2001 +From 3aadd33dd27258388af609121ea1dd415f575b05 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 6beb2d294743aad1488234109a3ad95a8d5a273f ] @@ -18 +20,0 @@ -Cc: stable@dpdk.org @@ -23,3 +25,3 @@ - lib/eal/include/rte_eal_paging.h | 2 +- - lib/eal/unix/eal_unix_memory.c | 11 ++++++----- - lib/eal/windows/eal_memory.c | 2 +- + lib/librte_eal/include/rte_eal_paging.h | 2 +- + lib/librte_eal/unix/eal_unix_memory.c | 11 ++++++----- + lib/librte_eal/windows/eal_memory.c | 2 +- @@ -28 +30 @@ -diff --git a/lib/eal/include/rte_eal_paging.h b/lib/eal/include/rte_eal_paging.h +diff --git a/lib/librte_eal/include/rte_eal_paging.h b/lib/librte_eal/include/rte_eal_paging.h @@ -30,2 +32,2 @@ ---- a/lib/eal/include/rte_eal_paging.h -+++ b/lib/eal/include/rte_eal_paging.h +--- a/lib/librte_eal/include/rte_eal_paging.h ++++ b/lib/librte_eal/include/rte_eal_paging.h @@ -41 +43 @@ -diff --git a/lib/eal/unix/eal_unix_memory.c b/lib/eal/unix/eal_unix_memory.c +diff --git a/lib/librte_eal/unix/eal_unix_memory.c b/lib/librte_eal/unix/eal_unix_memory.c @@ -43,2 +45,2 @@ ---- a/lib/eal/unix/eal_unix_memory.c -+++ b/lib/eal/unix/eal_unix_memory.c +--- a/lib/librte_eal/unix/eal_unix_memory.c ++++ b/lib/librte_eal/unix/eal_unix_memory.c @@ -81 +83 @@ -diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c +diff --git a/lib/librte_eal/windows/eal_memory.c b/lib/librte_eal/windows/eal_memory.c @@ -83,2 +85,2 @@ ---- a/lib/eal/windows/eal_memory.c -+++ b/lib/eal/windows/eal_memory.c +--- a/lib/librte_eal/windows/eal_memory.c ++++ b/lib/librte_eal/windows/eal_memory.c