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 AA965A00C4 for ; Thu, 28 Jul 2022 13:38:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B1CA40151; Thu, 28 Jul 2022 13:38:05 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 61A124014F for ; Thu, 28 Jul 2022 13:38:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659008284; x=1690544284; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=0TELXEU5lIQtjeHItxxyqFJtbcgbsgwhdtg4PSIWf5k=; b=c1H7N21aORDu6F/DSBPkD7u5PR4bclbI9NoVjmPIezFv0f9qhhlYpXMf hGziH+vtJiGBLJohZrmrGj2RJu8dwwl2AE1idXeOmG+alvvXcQ1OF0VSr hhoHo9PRu00ZGLvci4IS3ERMZNRjDchXRjrRWlCJM+pZ+ZXcLrqkUSEno 28BIEn1vsaY3Cwxdoioo20ytjevSHh5rJmg4/y6GjXehDh7c31PBw8Zk6 M8iHhQPP+USBm73YYYlhwH1vQDIbdmclFz6ez3kVDnVb8Vbbh+FRTzOhv Suept5UGmINEN5RNi4ap/TrJO93oPMaCLcCLrajZO/eizPbao0bBfO8JS w==; X-IronPort-AV: E=McAfee;i="6400,9594,10421"; a="268254026" X-IronPort-AV: E=Sophos;i="5.93,198,1654585200"; d="scan'208";a="268254026" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2022 04:38:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,198,1654585200"; d="scan'208";a="576431828" Received: from silpixa00401385.ir.intel.com (HELO silpixa00401385.ger.corp.intel.com.) ([10.237.222.160]) by orsmga006.jf.intel.com with ESMTP; 28 Jul 2022 04:38:01 -0700 From: Bruce Richardson To: stable@dpdk.org Cc: YuX.Jiang@intel.com, Bruce Richardson , David Marchand Subject: [PATCH 19.11] eal/freebsd: fix use of newer cpuset macros Date: Thu, 28 Jul 2022 12:37:50 +0100 Message-Id: <20220728113750.11392-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.34.1 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 FreeBSD has updated its CPU macros to align more with the definitions used on Linux[1]. Unfortunately, while this makes compatibility better in future, it means we need to have both legacy and newer definition support. Use a meson check to determine which set of macros are used. [1] https://cgit.freebsd.org/src/commit/?id=e2650af157bc Bugzilla ID: 1014 Fixes: c3568ea37670 ("eal: restrict control threads to startup CPU affinity") Fixes: b6be16acfeb1 ("eal: fix control thread affinity with --lcores") Signed-off-by: David Marchand Signed-off-by: Bruce Richardson --- This is a backport of commit 2f51bc9c27a4f1da674d66499667155663dcc419 for 19.11 release tree --- lib/librte_eal/freebsd/eal/include/rte_os.h | 16 +++++++++++++++- lib/librte_eal/freebsd/eal/meson.build | 11 +++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/freebsd/eal/include/rte_os.h b/lib/librte_eal/freebsd/eal/include/rte_os.h index 78ee6fd8f4..908c37e9aa 100644 --- a/lib/librte_eal/freebsd/eal/include/rte_os.h +++ b/lib/librte_eal/freebsd/eal/include/rte_os.h @@ -17,6 +17,7 @@ extern "C" { #include typedef cpuset_t rte_cpuset_t; +#ifdef RTE_EAL_FREEBSD_CPUSET_LEGACY #define RTE_CPU_AND(dst, src1, src2) do \ { \ cpuset_t tmp; \ @@ -50,7 +51,20 @@ typedef cpuset_t rte_cpuset_t; CPU_ANDNOT(&tmp, src); \ CPU_COPY(&tmp, dst); \ } while (0) -#endif +#endif /* CPU_NAND */ + +#else /* RTE_EAL_FREEBSD_CPUSET_LEGACY */ + +#define RTE_CPU_AND CPU_AND +#define RTE_CPU_OR CPU_OR +#define RTE_CPU_FILL CPU_FILL +#define RTE_CPU_NOT(dst, src) do { \ + cpu_set_t tmp; \ + CPU_FILL(&tmp); \ + CPU_XOR(dst, src, &tmp); \ +} while (0) + +#endif /* RTE_EAL_FREEBSD_CPUSET_LEGACY */ #ifdef __cplusplus } diff --git a/lib/librte_eal/freebsd/eal/meson.build b/lib/librte_eal/freebsd/eal/meson.build index 1426f7e5f1..deb367f44c 100644 --- a/lib/librte_eal/freebsd/eal/meson.build +++ b/lib/librte_eal/freebsd/eal/meson.build @@ -20,3 +20,14 @@ env_sources = files('eal_alarm.c', ) deps += ['kvargs'] + +# test for version of cpuset macros +cpuset_test_code = ''' + #include + #include + void cpu_test_or(cpuset_t *s) { CPU_OR(s, s, s); } +''' + +if not cc.compiles(cpuset_test_code, name: 'Detect argument count for CPU_OR') + dpdk_conf.set('RTE_EAL_FREEBSD_CPUSET_LEGACY', 1) +endif -- 2.37.1