From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ferruh.yigit@intel.com>
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id 36004271
 for <dev@dpdk.org>; Tue,  4 Jul 2017 18:13:48 +0200 (CEST)
Received: from fmsmga006.fm.intel.com ([10.253.24.20])
 by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 04 Jul 2017 09:13:47 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.40,309,1496127600"; d="scan'208";a="122666325"
Received: from silpixa00372839.ir.intel.com (HELO
 silpixa00372839.ger.corp.intel.com) ([10.237.222.154])
 by fmsmga006.fm.intel.com with ESMTP; 04 Jul 2017 09:13:46 -0700
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org
Cc: Ferruh Yigit <ferruh.yigit@intel.com>,
 Stephen Hemminger <stephen@networkplumber.org>,
 Bruce Richardson <bruce.richardson@intel.com>,
 Anatoly Burakov <anatoly.burakov@intel.com>
Date: Tue,  4 Jul 2017 17:13:19 +0100
Message-Id: <20170704161337.45926-3-ferruh.yigit@intel.com>
X-Mailer: git-send-email 2.13.0
In-Reply-To: <20170704161337.45926-1-ferruh.yigit@intel.com>
References: <20170630165140.59594-1-ferruh.yigit@intel.com>
 <20170704161337.45926-1-ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH v10 02/20] ethtool: move from sample folder into
	lib folder
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 04 Jul 2017 16:13:48 -0000

ethtool library initially developed for ethtool sample application,
moving it to library folder to reuse it.

Sample application will continue to use ethtool library.

Sample application disabled for now, it will be enabled again when
modifications to the ethtool library finished.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 examples/Makefile                                  |  2 +-
 examples/ethtool/Makefile                          | 24 ++++++++-------
 examples/ethtool/{ethtool-app => }/ethapp.c        |  0
 examples/ethtool/{ethtool-app => }/ethapp.h        |  0
 examples/ethtool/{ethtool-app => }/main.c          |  0
 .../ethtool/lib => lib/librte_ethtool}/Makefile    | 35 ++++++++--------------
 .../lib => lib/librte_ethtool}/rte_ethtool.c       |  0
 .../lib => lib/librte_ethtool}/rte_ethtool.h       |  0
 lib/librte_ethtool/rte_ethtool_version.map         | 24 +++++++++++++++
 9 files changed, 51 insertions(+), 34 deletions(-)
 rename examples/ethtool/{ethtool-app => }/ethapp.c (100%)
 rename examples/ethtool/{ethtool-app => }/ethapp.h (100%)
 rename examples/ethtool/{ethtool-app => }/main.c (100%)
 rename {examples/ethtool/lib => lib/librte_ethtool}/Makefile (76%)
 rename {examples/ethtool/lib => lib/librte_ethtool}/rte_ethtool.c (100%)
 rename {examples/ethtool/lib => lib/librte_ethtool}/rte_ethtool.h (100%)

diff --git a/examples/Makefile b/examples/Makefile
index c0e9c3be6..aa1696158 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -40,7 +40,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += bond
 DIRS-y += cmdline
 DIRS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += distributor
-DIRS-y += ethtool
+DIRS-n += ethtool
 DIRS-y += exception_path
 DIRS-$(CONFIG_RTE_LIBRTE_EFD) += server_node_efd
 DIRS-y += helloworld
diff --git a/examples/ethtool/Makefile b/examples/ethtool/Makefile
index 30b42b70e..a774eace0 100644
--- a/examples/ethtool/Makefile
+++ b/examples/ethtool/Makefile
@@ -1,6 +1,6 @@
 #   BSD LICENSE
 #
-#   Copyright(c) 2015 Intel Corporation. All rights reserved.
+#   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
 #   All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
@@ -33,20 +33,22 @@ ifeq ($(RTE_SDK),)
 $(error "Please define RTE_SDK environment variable")
 endif
 
-# Default target, can be overwritten by command line or environment
+# Default target, can be overridden by command line or environment
 RTE_TARGET ?= x86_64-native-linuxapp-gcc
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
-ifneq ($(CONFIG_RTE_EXEC_ENV),"linuxapp")
-$(info This application can only operate in a linuxapp environment, \
-please change the definition of the RTE_TARGET environment variable)
-else
+# binary name
+APP = ethtool
 
-DIRS-y += lib ethtool-app
-endif
+# all source are stored in SRCS-y
+SRCS-y := main.c ethapp.c
+
+#CFLAGS += -O3 -D_GNU_SOURCE -pthread -I$(SRCDIR)/../lib
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
 
-DEPDIRS-ethtool-app := lib
-DEPDIRS-lib := librte_eal librte_ether
+#LDLIBS += -L$(subst ethtool-app,lib,$(RTE_OUTPUT))/lib
+#LDLIBS += -lrte_ethtool
 
-include $(RTE_SDK)/mk/rte.extsubdir.mk
+include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethapp.c
similarity index 100%
rename from examples/ethtool/ethtool-app/ethapp.c
rename to examples/ethtool/ethapp.c
diff --git a/examples/ethtool/ethtool-app/ethapp.h b/examples/ethtool/ethapp.h
similarity index 100%
rename from examples/ethtool/ethtool-app/ethapp.h
rename to examples/ethtool/ethapp.h
diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/main.c
similarity index 100%
rename from examples/ethtool/ethtool-app/main.c
rename to examples/ethtool/main.c
diff --git a/examples/ethtool/lib/Makefile b/lib/librte_ethtool/Makefile
similarity index 76%
rename from examples/ethtool/lib/Makefile
rename to lib/librte_ethtool/Makefile
index 266babade..f41cad3da 100644
--- a/examples/ethtool/lib/Makefile
+++ b/lib/librte_ethtool/Makefile
@@ -29,35 +29,26 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-ifeq ($(RTE_SDK),)
-$(error "Please define RTE_SDK environment variable")
-endif
-
-# Default target, can be overwritten by command line or environment
-RTE_TARGET ?= x86_64-native-linuxapp-gcc
-
 include $(RTE_SDK)/mk/rte.vars.mk
 
-ifneq ($(CONFIG_RTE_EXEC_ENV),"linuxapp")
-$(error This application can only operate in a linuxapp environment, \
-please change the definition of the RTE_TARGET environment variable)
-endif
-
+#
 # library name
+#
 LIB = librte_ethtool.a
 
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
+
+EXPORT_MAP := rte_ethtool_version.map
+
 LIBABIVER := 1
 
 # all source are stored in SRC-Y
-SRCS-y := rte_ethtool.c
+SRCS-$(CONFIG_RTE_LIBRTE_ETHTOOL) := rte_ethtool.c
 
-CFLAGS += -O3
-CFLAGS += $(WERROR_FLAGS)
-
-ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
-ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
-LDLIBS += -lrte_pmd_ixgbe
-endif
-endif
+#
+# Export include files
+#
+SYMLINK-$(CONFIG_RTE_LIBRTE_ETHTOOL)-include += rte_ethtool.h
 
-include $(RTE_SDK)/mk/rte.extlib.mk
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/examples/ethtool/lib/rte_ethtool.c b/lib/librte_ethtool/rte_ethtool.c
similarity index 100%
rename from examples/ethtool/lib/rte_ethtool.c
rename to lib/librte_ethtool/rte_ethtool.c
diff --git a/examples/ethtool/lib/rte_ethtool.h b/lib/librte_ethtool/rte_ethtool.h
similarity index 100%
rename from examples/ethtool/lib/rte_ethtool.h
rename to lib/librte_ethtool/rte_ethtool.h
diff --git a/lib/librte_ethtool/rte_ethtool_version.map b/lib/librte_ethtool/rte_ethtool_version.map
index b6d2840be..a6e756c50 100644
--- a/lib/librte_ethtool/rte_ethtool_version.map
+++ b/lib/librte_ethtool/rte_ethtool_version.map
@@ -1,4 +1,28 @@
 DPDK_17.08 {
+	global:
+
+	rte_ethtool_get_drvinfo;
+	rte_ethtool_get_link;
+	rte_ethtool_get_regs_len;
+	rte_ethtool_get_regs;
+	rte_ethtool_get_eeprom_len;
+	rte_ethtool_get_eeprom;
+	rte_ethtool_set_eeprom;
+	rte_ethtool_get_pauseparam;
+	rte_ethtool_set_pauseparam;
+	rte_ethtool_get_ringparam;
+	rte_ethtool_set_ringparam;
+
+	rte_ethtool_net_open;
+	rte_ethtool_net_stop;
+	rte_ethtool_net_get_mac_addr;
+	rte_ethtool_net_set_mac_addr;
+	rte_ethtool_net_validate_addr;
+	rte_ethtool_net_change_mtu;
+	rte_ethtool_net_get_stats64;
+	rte_ethtool_net_vlan_rx_add_vid;
+	rte_ethtool_net_vlan_rx_kill_vid;
+	rte_ethtool_net_set_rx_mode;
 
 	local: *;
 };
-- 
2.13.0