From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by dpdk.org (Postfix) with ESMTP id 3C524728E for ; Fri, 23 Mar 2018 19:45:25 +0100 (CET) Received: by mail-wr0-f196.google.com with SMTP id c24so13096580wrc.6 for ; Fri, 23 Mar 2018 11:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ClO1XPlXT+AVZX49LsQBkC+6omMt1ka+lhURci3oES4=; b=OeKJeS5qQbqOLepRKJ5sjKvmJRnkEfMpdm/ZnxxoTTSvrb2rFbS+Hrla8FDYDVCH/s gAob/E3EFEwG3Qicr6DrxjsjniJgJn6ByGQ9ksUgc6y5v1U28xesSFI2eN0acd3E/YrS 6dUnQC0PhMlnYqhT2fzAEXtpCebht9ZU3v8ry7DARI7qaB23ln7xNecPLSfYUisDXi44 Hiwlxhsz3VOintRFkCvTOcWPdjVaxoeVgWd/E/0O9C/itPMTWMqaCXEI+nQnzvE0WM7O Az1L2wUfklfX8PCeeNv+miKUBJW9emzG67efDPE/72TMU91wrdnYuHDRXiHdVMo4zJzI v4Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ClO1XPlXT+AVZX49LsQBkC+6omMt1ka+lhURci3oES4=; b=Wm7J6UxMya/j/vTWnfmTHeMAIfyK+ksWUV/6w+WNgbHCSnPibVrfJ8gJiE6ByFTWDA e7tJbzE+0WG9gO3Oeg+2onc2cKXkU9tJYuRpqLM2wLS/AD5QRv/pd/c6Ym2rio1blSQe 10+/iJx8zwQ9foyf8R3bLnaBXjtWab/5XJBhwDHVOMUnSiJiuSfCecj2xGP8jJfM07Db 7ih/XbE+BWkI3CFl61KpQVH9gRsdtmjQ3WwqQlfquyUFKRvPHwKaGKOFbmD1op+Uqa6d r6GjNX1u+8xOhezwU4NPXhw+L06yCURU/xsfEicx7LHx9QFxrtBX8Gp1KGBCGxBFXKcU dSsg== X-Gm-Message-State: AElRT7F4f8SuvB7ngqCCJed65iYVC4OAsqX/czJJDLiUBaPGwX8Z5VvA r5ai2Msq0t8EIfWxUIA63V86s2Oa X-Google-Smtp-Source: AG47ELsiGNchxcGR1OhYnuOXHA3XSuHoH/XZIkztmq8UHRTAeczeXh3hwqcvPZvJFAAhkYJT7rC99w== X-Received: by 10.223.187.138 with SMTP id q10mr18841509wrg.62.1521830724058; Fri, 23 Mar 2018 11:45:24 -0700 (PDT) Received: from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id m62sm13391776wmc.25.2018.03.23.11.45.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 11:45:23 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Fri, 23 Mar 2018 19:45:02 +0100 Message-Id: <20180323184503.13041-1-gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180323131236.yagasxv2nxorfjl5@bidouze.vm.6wind.com> References: <20180323131236.yagasxv2nxorfjl5@bidouze.vm.6wind.com> Subject: [dpdk-dev] [PATCH 1/2] kvargs: the life of the party 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: , X-List-Received-Date: Fri, 23 Mar 2018 18:45:25 -0000 Signed-off-by: Gaetan Rivet --- This is a rough sketch of what would be done to move rte_kvargs within the EAL and change the parsing in rte_dev to use it. drivers/baseband/Makefile | 2 +- lib/Makefile | 5 +- lib/librte_eal/Makefile | 2 + lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/kvargs/Makefile | 23 ++++++++++ .../kvargs}/meson.build | 0 .../kvargs}/rte_kvargs.c | 12 +++-- .../kvargs}/rte_kvargs.h | 0 .../kvargs}/rte_kvargs_version.map | 0 .../{common/include => kvargs}/rte_string_fns.h | 0 lib/librte_eal/linuxapp/eal/eal_hugepage_info.c | 2 +- lib/librte_kvargs/Makefile | 53 ---------------------- 12 files changed, 37 insertions(+), 64 deletions(-) create mode 100644 lib/librte_eal/kvargs/Makefile rename lib/{librte_kvargs => librte_eal/kvargs}/meson.build (100%) rename lib/{librte_kvargs => librte_eal/kvargs}/rte_kvargs.c (96%) rename lib/{librte_kvargs => librte_eal/kvargs}/rte_kvargs.h (100%) rename lib/{librte_kvargs => librte_eal/kvargs}/rte_kvargs_version.map (100%) rename lib/librte_eal/{common/include => kvargs}/rte_string_fns.h (100%) delete mode 100644 lib/librte_kvargs/Makefile diff --git a/drivers/baseband/Makefile b/drivers/baseband/Makefile index 4ec83b0a0..64f6f9ca7 100644 --- a/drivers/baseband/Makefile +++ b/drivers/baseband/Makefile @@ -4,7 +4,7 @@ include $(RTE_SDK)/mk/rte.vars.mk core-libs := librte_eal librte_mbuf librte_mempool librte_ring -core-libs += librte_bbdev librte_kvargs librte_cfgfile +core-libs += librte_bbdev librte_cfgfile DIRS-$(CONFIG_RTE_LIBRTE_PMD_BBDEV_NULL) += null DEPDIRS-null = $(core-libs) diff --git a/lib/Makefile b/lib/Makefile index 6bb6a8bed..aef95b201 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -20,12 +20,11 @@ DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline DEPDIRS-librte_cmdline := librte_eal DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ether DEPDIRS-librte_ether := librte_net librte_eal librte_mempool librte_ring -DEPDIRS-librte_ether += librte_mbuf librte_kvargs +DEPDIRS-librte_ether += librte_mbuf DIRS-$(CONFIG_RTE_LIBRTE_BBDEV) += librte_bbdev DEPDIRS-librte_bbdev := librte_eal librte_mempool librte_mbuf DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += librte_cryptodev DEPDIRS-librte_cryptodev := librte_eal librte_mempool librte_ring librte_mbuf -DEPDIRS-librte_cryptodev += librte_kvargs DIRS-$(CONFIG_RTE_LIBRTE_SECURITY) += librte_security DEPDIRS-librte_security := librte_eal librte_mempool librte_ring librte_mbuf DEPDIRS-librte_security += librte_ether @@ -71,8 +70,6 @@ DEPDIRS-librte_flow_classify := librte_net librte_table librte_acl DIRS-$(CONFIG_RTE_LIBRTE_SCHED) += librte_sched DEPDIRS-librte_sched := librte_eal librte_mempool librte_mbuf librte_net DEPDIRS-librte_sched += librte_timer -DIRS-$(CONFIG_RTE_LIBRTE_KVARGS) += librte_kvargs -DEPDIRS-librte_kvargs := librte_eal DIRS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += librte_distributor DEPDIRS-librte_distributor := librte_eal librte_mbuf librte_ether DIRS-$(CONFIG_RTE_LIBRTE_PORT) += librte_port diff --git a/lib/librte_eal/Makefile b/lib/librte_eal/Makefile index ccd45cb84..d6b520aeb 100644 --- a/lib/librte_eal/Makefile +++ b/lib/librte_eal/Makefile @@ -3,7 +3,9 @@ include $(RTE_SDK)/mk/rte.vars.mk +DIRS-y += kvargs DIRS-y += common +DEPDIRS-common := kvargs DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += linuxapp DEPDIRS-linuxapp := common DIRS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += bsdapp diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile index 211b21b4b..607ae0447 100644 --- a/lib/librte_eal/common/Makefile +++ b/lib/librte_eal/common/Makefile @@ -9,7 +9,7 @@ INC += rte_errno.h rte_launch.h rte_lcore.h INC += rte_log.h rte_memory.h rte_memzone.h INC += rte_per_lcore.h rte_random.h INC += rte_tailq.h rte_interrupts.h rte_alarm.h -INC += rte_string_fns.h rte_version.h +INC += rte_version.h INC += rte_eal_memconfig.h rte_malloc_heap.h INC += rte_hexdump.h rte_devargs.h rte_bus.h rte_dev.h rte_class.h INC += rte_pci_dev_feature_defs.h rte_pci_dev_features.h diff --git a/lib/librte_eal/kvargs/Makefile b/lib/librte_eal/kvargs/Makefile new file mode 100644 index 000000000..65d15744e --- /dev/null +++ b/lib/librte_eal/kvargs/Makefile @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2014 6WIND S.A. + +include $(RTE_SDK)/mk/rte.vars.mk + +# library name +LIB = librte_kvargs.a + +CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 + +EXPORT_MAP := rte_kvargs_version.map + +LIBABIVER := 1 + +# all source are stored in SRCS-y +SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c + +# install includes +INCS := rte_kvargs.h +INCS += rte_string_fns.h +SYMLINK-$(CONFIG_RTE_LIBRTE_KVARGS)-include := $(INCS) + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/lib/librte_kvargs/meson.build b/lib/librte_eal/kvargs/meson.build similarity index 100% rename from lib/librte_kvargs/meson.build rename to lib/librte_eal/kvargs/meson.build diff --git a/lib/librte_kvargs/rte_kvargs.c b/lib/librte_eal/kvargs/rte_kvargs.c similarity index 96% rename from lib/librte_kvargs/rte_kvargs.c rename to lib/librte_eal/kvargs/rte_kvargs.c index 9662375e8..69a942723 100644 --- a/lib/librte_kvargs/rte_kvargs.c +++ b/lib/librte_eal/kvargs/rte_kvargs.c @@ -3,13 +3,17 @@ * Copyright(c) 2014 6WIND S.A. */ -#include +#include #include - -#include -#include +#include #include "rte_kvargs.h" +#include "rte_string_fns.h" + +#define ERR stderr +#define PMD "[PMD]" +#define RTE_LOG(lvl, prefix, ...) \ + fprintf(lvl, prefix " " __VA_ARGS__); /* * Receive a string with a list of arguments following the pattern diff --git a/lib/librte_kvargs/rte_kvargs.h b/lib/librte_eal/kvargs/rte_kvargs.h similarity index 100% rename from lib/librte_kvargs/rte_kvargs.h rename to lib/librte_eal/kvargs/rte_kvargs.h diff --git a/lib/librte_kvargs/rte_kvargs_version.map b/lib/librte_eal/kvargs/rte_kvargs_version.map similarity index 100% rename from lib/librte_kvargs/rte_kvargs_version.map rename to lib/librte_eal/kvargs/rte_kvargs_version.map diff --git a/lib/librte_eal/common/include/rte_string_fns.h b/lib/librte_eal/kvargs/rte_string_fns.h similarity index 100% rename from lib/librte_eal/common/include/rte_string_fns.h rename to lib/librte_eal/kvargs/rte_string_fns.h diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c index 8bbf771af..63d701555 100644 --- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c +++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c @@ -24,7 +24,7 @@ #include #include #include -#include "rte_string_fns.h" +#include #include "eal_internal_cfg.h" #include "eal_hugepages.h" #include "eal_filesystem.h" diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile deleted file mode 100644 index 4eaa9334d..000000000 --- a/lib/librte_kvargs/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# BSD LICENSE -# -# Copyright 2014 6WIND S.A. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# -# - Neither the name of 6WIND S.A. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -# OF THE POSSIBILITY OF SUCH DAMAGE. - -include $(RTE_SDK)/mk/rte.vars.mk - -# library name -LIB = librte_kvargs.a - -CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -LDLIBS += -lrte_eal - -EXPORT_MAP := rte_kvargs_version.map - -LIBABIVER := 1 - -# all source are stored in SRCS-y -SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c - -# install includes -INCS := rte_kvargs.h -SYMLINK-$(CONFIG_RTE_LIBRTE_KVARGS)-include := $(INCS) - -include $(RTE_SDK)/mk/rte.lib.mk -- 2.11.0