From patchwork Wed May 29 15:41:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53822 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F2BAD1B94E; Wed, 29 May 2019 17:41:42 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 6BB6E1B94E for ; Wed, 29 May 2019 17:41:41 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2019 08:41:39 -0700 X-ExtLoop1: 1 Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by FMSMGA003.fm.intel.com with ESMTP; 29 May 2019 08:41:39 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Wed, 29 May 2019 16:41:28 +0100 Message-Id: <20190529154132.49955-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 0/4] Enhance CPU flag support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Currently in DPDK, any checks for the presence or absense of specific CPU flags has to be enclosed in #ifdef blocks, since the flags are conditionally defined per architecture as enums. This set attempts to improve this situation by allowing the flags to be queried as strings, with a CPU architecture type also specified. One new public API is provided for this. [Other APIs used by that are internal for now, but have an rte_ prefix in case we want to expose them publically later] To test out this new functionality the crc code in the net library is updated to use this, demonstrating how the code can be simplified and the use of #ifdef's reduced. Bruce Richardson (4): build: fix quoting on RTE_ARCH string value config/arm: fix missing define for arm platforms eal: allow checking CPU flags by name net: replace ifdefs with runtime branches config/arm/meson.build | 2 + config/ppc_64/meson.build | 2 +- config/x86/meson.build | 4 +- lib/librte_eal/common/eal_common_cpuflags.c | 41 +++++++++++++++++ .../common/include/generic/rte_cpuflags.h | 44 ++++++++++++++++++- lib/librte_eal/rte_eal_version.map | 3 ++ lib/librte_net/rte_net_crc.c | 38 ++++++++++------ 7 files changed, 117 insertions(+), 17 deletions(-)