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 38C7FA0A0E for ; Mon, 10 May 2021 18:10:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 322CA4003E; Mon, 10 May 2021 18:10:06 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2043.outbound.protection.outlook.com [40.107.236.43]) by mails.dpdk.org (Postfix) with ESMTP id CB72B4003E for ; Mon, 10 May 2021 18:10:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nvbO8S3eXUNIUp42b6h+u5lN6wNB9dIzztuxBWkFlmjHLqxzif38Kp19X/ByNEpwSsmqhMkkVVXlPRhuZSWMACrxKXcgLSRo6FNMKT9PS7cGVXtVkIqMa0wVuRJb6M1UGtY7tLpwvXHASEh0VaJUuBoxaLO8EufSe9IxlUKituX1Xe3GjVfdRSZ9tWfKclKTji/pah4FOmDfKveb7792k5AXtSp7c44tHbzVx8IvMp+70qM2GIcStKLmsDOMQ2uJ7sEyolSEvrggk3CfXo/1UUoHZQFu47DgygwB1UMuzU6YhuV1hdC0lBsCfLNMSemFRUixbsxI4FrseT40vAOmBg== 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=rGDyaD80Pe+xGbedEck3JSw9XTAsz8O27KzF1e0Npis=; b=h3zkRb5zrdVTZLmrSTVTzWx4NY1UgdoPf/lZt3Vvhbv74R/Nfrqf7aQBqyjOM7ZF2Hw7PLOTyY/bhM94qYJ6+1VD7jpdGdqJ9O2BrKTHuWuEDleGlrGSCQ/+LDkhykzYGgKBBKt6zlI5FZ85vKA0nIssdFOnbhx6dZ8Rluzw5kisvfwSREB3rwwK0cKe2DslRvYxLCV8O++BLMX+MhlOvBpm8drGL4g9D+uXav0dzVaTYLUB9yPC21u/N6oK2L1Ai0yorpjMcGch6Tcvm2QdFj5msBH769Qj4dUQ3S4RJYdVrcIN5lSsKA7UsjYbf7negb/+TUKYLXDoadRMe5DG2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=oktetlabs.ru 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=rGDyaD80Pe+xGbedEck3JSw9XTAsz8O27KzF1e0Npis=; b=smdSsLFMsOcvBHv6HNPp5lVDnTABLlILb+77xEI+opvvVMNit6VF+Xdp6FCZFwMLaves1fQalj3SQTb+dtglLrxRsaTsFxR3JsZSxCBLoE0r19qDpLtPwo9qbV75tKZY6m7EjOEyX03t/n1GIKYhtlJ2jNPV3si9vjkplI0eqYU/Oz4Dzjthcz0HZ73GhJNyTx0AF7IOV+TszCdfYw/jPsvZd93TXe44nho/l9qYfkhFHOoH8rS0DU9+8PBoyvYFIXkmBs4ouym42sKYR/H30jqNMUUHcsndJORc5zzl5wVD1XFkMKOpnAae+TIaSLZWV+pdrjZ85kZQBcO1pSuPaQ== Received: from BN0PR02CA0055.namprd02.prod.outlook.com (2603:10b6:408:e5::30) by MW3PR12MB4441.namprd12.prod.outlook.com (2603:10b6:303:59::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 16:10:03 +0000 Received: from BN8NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e5:cafe::6a) by BN0PR02CA0055.outlook.office365.com (2603:10b6:408:e5::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:10:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; 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 BN8NAM11FT058.mail.protection.outlook.com (10.13.177.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:10:01 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:09:58 +0000 From: Xueming Li To: Thomas Monjalon CC: Luca Boccassi , Natanael Copa , Andrew Rybchenko , David Marchand , dpdk stable Date: Tue, 11 May 2021 00:00:19 +0800 Message-ID: <20210510160258.30982-70-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 73b423ad-2d0a-4d82-783a-08d913ce1113 X-MS-TrafficTypeDiagnostic: MW3PR12MB4441: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KdygeqbvXzBNfPhxkPcFV3/jm8VsdCF/zdfTf2SUoRHjU3xIae6FNaReJsizJsdOnlgifM8IIWMo942ojCxTvenrpFmHZbBJC7guvsxmwpPseHG/YgDM9Hve/YciWNNr5H//jWECjxMv90/D/Bq98Dt1ujep5Ey9pIdbyFDOT8Vi5vkuwxOyAsqZNjr38Ys6y29dTcJsPij4jLM2sRgs5XVw9/KKOmQv/23jQa6SLjKEPIscZkLYy9/desf7C9Akf9UYM07lJ/PSMynAJM6JIidjhoD2tnRBLu3uopzGhnWTa56ckQaQjrmCAbjvqAWNXKx47wOpqyfy/0J5JhDCSX8/XXZjOkYm8r5wUHc6tRVPQbYtJHotlaalSK/ie7fTkSRCqRM7PJ+JjV5w82A8jIfxkB+h/2Q1VNVzfpfdyodnHKU2UeNs6hhqC3uYp/Fuv3hBHGiv8RNJlpgUhCa67eHTmKaqEidg2CDB/IbqUsQeCrgpbQXzyOqkVN3ZsVwEHb6Bl6ozR7dlflSWZKsQEAG0TiJTkULn2ufAPFolqi2m0IpumZTEPj5cKmKbbQvru0MzlBAPR/OmM58qkUTJUnGGize/uD++faTHuwDUtyYmPrdp4OLpAfno+siq0nHYeSfLTY97qu+V1N9vglE8Y0828LPsb7FH0z/ATW3pL3srcc26Aq0j25N9bzkb5I4TKARMX+d3pAy0zJmMioR8eSqJQ7Lbtst3GNTCWQ0Br+iZbTdjk+M79xFNrXopHoTD3aCfu9Rc9lcTRQ2hg0pX9g== 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)(39860400002)(396003)(346002)(376002)(136003)(46966006)(36840700001)(2616005)(26005)(356005)(36860700001)(53546011)(55016002)(82740400003)(2906002)(336012)(54906003)(86362001)(7696005)(316002)(70206006)(478600001)(6916009)(966005)(6286002)(70586007)(47076005)(6666004)(7636003)(5660300002)(186003)(1076003)(4326008)(36906005)(82310400003)(36756003)(8676002)(16526019)(83380400001)(426003)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:10:01.8516 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 73b423ad-2d0a-4d82-783a-08d913ce1113 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: BN8NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4441 Subject: [dpdk-stable] patch 'eal: fix build with musl' 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 05/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/efa745cbb2c3ceed88aec922fb75e386d4e6554b Thanks. Xueming Li --- >From efa745cbb2c3ceed88aec922fb75e386d4e6554b Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Thu, 25 Feb 2021 00:21:58 +0100 Subject: [PATCH] eal: fix build with musl Cc: Luca Boccassi [ upstream commit e0473c6d5b18560dd11fd4d7ebc81dea6774f33e ] In musl libc, cpu_set_t is defined only if _GNU_SOURCE is defined. In case _GNU_SOURCE is undefined, as in eal_common_errno.c, it was not possible to include rte_os.h which uses cpu_set_t. This limitation is removed: if CPU_SETSIZE is not defined, cpu_set_t related definitions and functions are skipped. Note: such definitions are unneeded in eal_common_errno.c. Applications which do not define _GNU_SOURCE may miss cpu_set_t related features on musl. Such case is detected by RTE_HAS_CPUSET being undefined, so functions which depend on rte_cpuset_t will be unavailable. A missing include of fcntl.h is also added. Bugzilla ID: 35 Fixes: 11b57c698005 ("eal: fix error string function") Fixes: 176bb37ca6f3 ("eal: introduce internal wrappers for file operations") Signed-off-by: Thomas Monjalon Signed-off-by: Natanael Copa Acked-by: Andrew Rybchenko Acked-by: David Marchand --- doc/api/doxy-api.conf.in | 3 ++- lib/librte_eal/freebsd/include/rte_os.h | 1 + lib/librte_eal/include/rte_lcore.h | 8 ++++++++ lib/librte_eal/linux/include/rte_os.h | 3 +++ lib/librte_eal/unix/eal_file.c | 1 + lib/librte_eal/windows/include/sched.h | 1 + lib/librte_telemetry/rte_telemetry.h | 4 ++++ 7 files changed, 20 insertions(+), 1 deletion(-) diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in index 5c883b613b..a536bcb493 100644 --- a/doc/api/doxy-api.conf.in +++ b/doc/api/doxy-api.conf.in @@ -80,7 +80,8 @@ INPUT += @API_EXAMPLES@ FILE_PATTERNS = rte_*.h \ cmdline.h PREDEFINED = __DOXYGEN__ \ - VFIO_PRESENT \ + RTE_HAS_CPUSET \ + VFIO_PRESENT \ __attribute__(x)= OPTIMIZE_OUTPUT_FOR_C = YES diff --git a/lib/librte_eal/freebsd/include/rte_os.h b/lib/librte_eal/freebsd/include/rte_os.h index c16f2a30e9..627f0483ab 100644 --- a/lib/librte_eal/freebsd/include/rte_os.h +++ b/lib/librte_eal/freebsd/include/rte_os.h @@ -13,6 +13,7 @@ #include typedef cpuset_t rte_cpuset_t; +#define RTE_HAS_CPUSET #define RTE_CPU_AND(dst, src1, src2) do \ { \ cpuset_t tmp; \ diff --git a/lib/librte_eal/include/rte_lcore.h b/lib/librte_eal/include/rte_lcore.h index 48b87e253a..a55fd7496d 100644 --- a/lib/librte_eal/include/rte_lcore.h +++ b/lib/librte_eal/include/rte_lcore.h @@ -185,6 +185,8 @@ __rte_experimental int rte_lcore_to_cpu_id(int lcore_id); +#ifdef RTE_HAS_CPUSET + /** * @warning * @b EXPERIMENTAL: this API may change without prior notice. @@ -199,6 +201,8 @@ __rte_experimental rte_cpuset_t rte_lcore_cpuset(unsigned int lcore_id); +#endif /* RTE_HAS_CPUSET */ + /** * Test if an lcore is enabled. * @@ -357,6 +361,8 @@ __rte_experimental void rte_lcore_dump(FILE *f); +#ifdef RTE_HAS_CPUSET + /** * Set core affinity of the current thread. * Support both EAL and non-EAL thread and update TLS. @@ -378,6 +384,8 @@ int rte_thread_set_affinity(rte_cpuset_t *cpusetp); */ void rte_thread_get_affinity(rte_cpuset_t *cpusetp); +#endif /* RTE_HAS_CPUSET */ + /** * Set thread names. * diff --git a/lib/librte_eal/linux/include/rte_os.h b/lib/librte_eal/linux/include/rte_os.h index 390b87b3a1..1618b4df22 100644 --- a/lib/librte_eal/linux/include/rte_os.h +++ b/lib/librte_eal/linux/include/rte_os.h @@ -12,7 +12,9 @@ #include +#ifdef CPU_SETSIZE /* may require _GNU_SOURCE */ typedef cpu_set_t rte_cpuset_t; +#define RTE_HAS_CPUSET #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2) #define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2) #define RTE_CPU_FILL(set) do \ @@ -28,5 +30,6 @@ typedef cpu_set_t rte_cpuset_t; RTE_CPU_FILL(&tmp); \ CPU_XOR(dst, &tmp, src); \ } while (0) +#endif #endif /* _RTE_OS_H_ */ diff --git a/lib/librte_eal/unix/eal_file.c b/lib/librte_eal/unix/eal_file.c index 1b26475ba4..ec554e0096 100644 --- a/lib/librte_eal/unix/eal_file.c +++ b/lib/librte_eal/unix/eal_file.c @@ -4,6 +4,7 @@ #include #include +#include #include #include diff --git a/lib/librte_eal/windows/include/sched.h b/lib/librte_eal/windows/include/sched.h index fbe07f742c..ff572b5dcb 100644 --- a/lib/librte_eal/windows/include/sched.h +++ b/lib/librte_eal/windows/include/sched.h @@ -28,6 +28,7 @@ extern "C" { typedef struct _rte_cpuset_s { long long _bits[_NUM_SETS(CPU_SETSIZE)]; } rte_cpuset_t; +#define RTE_HAS_CPUSET #define CPU_SET(b, s) ((s)->_bits[_WHICH_SET(b)] |= (1LL << _WHICH_BIT(b))) diff --git a/lib/librte_telemetry/rte_telemetry.h b/lib/librte_telemetry/rte_telemetry.h index 76172222c9..9cd6d0cd4c 100644 --- a/lib/librte_telemetry/rte_telemetry.h +++ b/lib/librte_telemetry/rte_telemetry.h @@ -292,6 +292,8 @@ __rte_experimental int rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help); +#ifdef RTE_HAS_CPUSET + /** * @internal * Initialize Telemetry. @@ -314,6 +316,8 @@ int rte_telemetry_init(const char *runtime_dir, rte_cpuset_t *cpuset, const char **err_str); +#endif /* RTE_HAS_CPUSET */ + /** * Get a pointer to a container with memory allocated. The container is to be * used embedded within an existing telemetry dict/array. -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:28.467229800 +0800 +++ 0071-eal-fix-build-with-musl.patch 2021-05-10 23:59:26.430000000 +0800 @@ -1 +1 @@ -From e0473c6d5b18560dd11fd4d7ebc81dea6774f33e Mon Sep 17 00:00:00 2001 +From efa745cbb2c3ceed88aec922fb75e386d4e6554b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit e0473c6d5b18560dd11fd4d7ebc81dea6774f33e ] @@ -15 +18,2 @@ -features on musl. Such case is detected by RTE_HAS_CPUSET being undefined, +features on musl. Such case is detected by RTE_HAS_CPUSET being +undefined, @@ -22,2 +26,2 @@ -Fixes: 176bb37ca6f3 ("eal: introduce internal wrappers for file operations") -Cc: stable@dpdk.org +Fixes: 176bb37ca6f3 ("eal: introduce internal wrappers for file +operations") @@ -32,2 +36 @@ - lib/librte_eal/include/rte_lcore.h | 4 ++++ - lib/librte_eal/include/rte_thread.h | 4 ++++ + lib/librte_eal/include/rte_lcore.h | 8 ++++++++ @@ -38 +41 @@ - 8 files changed, 20 insertions(+), 1 deletion(-) + 7 files changed, 20 insertions(+), 1 deletion(-) @@ -41 +44 @@ -index 5eb31508fd..b3c5cdfeca 100644 +index 5c883b613b..a536bcb493 100644 @@ -44 +47 @@ -@@ -81,7 +81,8 @@ INPUT += @API_EXAMPLES@ +@@ -80,7 +80,8 @@ INPUT += @API_EXAMPLES@ @@ -67 +70 @@ -index 0fe0bd839c..1550b75da0 100644 +index 48b87e253a..a55fd7496d 100644 @@ -70 +73 @@ -@@ -186,6 +186,8 @@ __rte_experimental +@@ -185,6 +185,8 @@ __rte_experimental @@ -79 +82 @@ -@@ -200,6 +202,8 @@ __rte_experimental +@@ -199,6 +201,8 @@ __rte_experimental @@ -88,7 +91,3 @@ -diff --git a/lib/librte_eal/include/rte_thread.h b/lib/librte_eal/include/rte_thread.h -index e640ea1857..ac5a89b1ad 100644 ---- a/lib/librte_eal/include/rte_thread.h -+++ b/lib/librte_eal/include/rte_thread.h -@@ -25,6 +25,8 @@ extern "C" { - */ - typedef struct eal_tls_key *rte_tls_key; +@@ -357,6 +361,8 @@ __rte_experimental + void + rte_lcore_dump(FILE *f); @@ -101 +100 @@ -@@ -46,6 +48,8 @@ int rte_thread_set_affinity(rte_cpuset_t *cpusetp); +@@ -378,6 +384,8 @@ int rte_thread_set_affinity(rte_cpuset_t *cpusetp); @@ -108,2 +107,2 @@ - * Create a TLS data key visible to all threads in the process. - * the created key is later used to get/set a value. + * Set thread names. + * @@ -156 +155 @@ -index f7c8534b82..027b048d78 100644 +index 76172222c9..9cd6d0cd4c 100644 @@ -169 +168 @@ - rte_telemetry_init(const char *runtime_dir, const char *rte_version, rte_cpuset_t *cpuset, + rte_telemetry_init(const char *runtime_dir, rte_cpuset_t *cpuset,