Message ID | 20190529154132.49955-1-bruce.richardson@intel.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> 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 <dev@dpdk.org>; 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 <bruce.richardson@intel.com> To: dev@dpdk.org Cc: Bruce Richardson <bruce.richardson@intel.com> 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 Content-Transfer-Encoding: 8bit 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 <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series | Enhance CPU flag support | |
Message
Bruce Richardson
May 29, 2019, 3:41 p.m. UTC
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(-)
Comments
> -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > Sent: Wednesday, May 29, 2019 4:41 PM > To: dev@dpdk.org > Cc: Richardson, Bruce <bruce.richardson@intel.com> > Subject: [dpdk-dev] [PATCH 0/4] Enhance CPU flag support > > 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(-) > > -- Series Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> > 2.21.0