[dpdk-dev,v8,1/4] ethtool: move from sample folder to lib folder

Message ID 20170621110651.75299-2-ferruh.yigit@intel.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Ferruh Yigit June 21, 2017, 11:06 a.m. UTC
  Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v7:
* rebase v17.08
---
 config/common_base                                 |  5 ++
 config/common_linuxapp                             |  1 +
 doc/api/doxy-api-index.md                          |  3 +-
 doc/api/doxy-api.conf                              |  1 +
 doc/guides/prog_guide/ethtool_lib.rst              | 62 ++++++++++++++++++++++
 doc/guides/prog_guide/index.rst                    |  1 +
 doc/guides/rel_notes/release_17_08.rst             |  1 +
 doc/guides/sample_app_ug/ethtool.rst               | 36 ++-----------
 examples/ethtool/Makefile                          | 24 +++++----
 examples/ethtool/{ethtool-app => }/ethapp.c        |  2 +-
 examples/ethtool/{ethtool-app => }/ethapp.h        |  2 +-
 examples/ethtool/{ethtool-app => }/main.c          |  0
 lib/Makefile                                       |  2 +
 .../ethtool/lib => lib/librte_ethtool}/Makefile    | 35 +++++-------
 .../lib => lib/librte_ethtool}/rte_ethtool.c       | 12 -----
 .../lib => lib/librte_ethtool}/rte_ethtool.h       | 59 ++++++++++----------
 lib/librte_ethtool/rte_ethtool_version.map         | 28 ++++++++++
 mk/rte.app.mk                                      |  1 +
 18 files changed, 167 insertions(+), 108 deletions(-)
 create mode 100644 doc/guides/prog_guide/ethtool_lib.rst
 rename examples/ethtool/{ethtool-app => }/ethapp.c (99%)
 rename examples/ethtool/{ethtool-app => }/ethapp.h (96%)
 rename examples/ethtool/{ethtool-app => }/main.c (100%)
 rename {examples/ethtool/lib => lib/librte_ethtool}/Makefile (74%)
 rename {examples/ethtool/lib => lib/librte_ethtool}/rte_ethtool.c (97%)
 rename {examples/ethtool/lib => lib/librte_ethtool}/rte_ethtool.h (91%)
 create mode 100644 lib/librte_ethtool/rte_ethtool_version.map
  

Comments

Bruce Richardson June 26, 2017, 11:02 a.m. UTC | #1
On Wed, Jun 21, 2017 at 12:06:48PM +0100, Ferruh Yigit wrote:
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

This patch fails to compile with gcc 7.1
Comment at error site below.

/Bruce

> ---
> v7:
> * rebase v17.08
> ---
>  config/common_base                                 |  5 ++
>  config/common_linuxapp                             |  1 +
>  doc/api/doxy-api-index.md                          |  3 +-
>  doc/api/doxy-api.conf                              |  1 +
>  doc/guides/prog_guide/ethtool_lib.rst              | 62 ++++++++++++++++++++++
>  doc/guides/prog_guide/index.rst                    |  1 +
>  doc/guides/rel_notes/release_17_08.rst             |  1 +
>  doc/guides/sample_app_ug/ethtool.rst               | 36 ++-----------
>  examples/ethtool/Makefile                          | 24 +++++----
>  examples/ethtool/{ethtool-app => }/ethapp.c        |  2 +-
>  examples/ethtool/{ethtool-app => }/ethapp.h        |  2 +-
>  examples/ethtool/{ethtool-app => }/main.c          |  0
>  lib/Makefile                                       |  2 +
>  .../ethtool/lib => lib/librte_ethtool}/Makefile    | 35 +++++-------
>  .../lib => lib/librte_ethtool}/rte_ethtool.c       | 12 -----
>  .../lib => lib/librte_ethtool}/rte_ethtool.h       | 59 ++++++++++----------
>  lib/librte_ethtool/rte_ethtool_version.map         | 28 ++++++++++
>  mk/rte.app.mk                                      |  1 +
>  18 files changed, 167 insertions(+), 108 deletions(-)

<snip>

>  #include "rte_ethtool.h"
>  
>  #define PKTPOOL_SIZE 512
> @@ -363,20 +360,11 @@ rte_ethtool_net_set_rx_mode(uint8_t port_id)
>  {
>  	uint16_t num_vfs;
>  	struct rte_eth_dev_info dev_info;
> -	uint16_t vf;
>  
>  	memset(&dev_info, 0, sizeof(dev_info));
>  	rte_eth_dev_info_get(port_id, &dev_info);
>  	num_vfs = dev_info.max_vfs;
>  
> -	/* Set VF vf_rx_mode, VF unsupport status is discard */
> -	for (vf = 0; vf < num_vfs; vf++) {
> -#ifdef RTE_LIBRTE_IXGBE_PMD
> -		rte_pmd_ixgbe_set_vf_rxmode(port_id, vf,
> -			ETH_VMDQ_ACCEPT_UNTAG, 0);
> -#endif
> -	}
> -
>  	/* Enable Rx vlan filter, VF unspport status is discard */
>  	rte_eth_dev_set_vlan_offload(port_id, ETH_VLAN_FILTER_MASK);
>  

Compiler gives error about num_vfs being unused. Looking at the code
now, with the removal of the ifdef, it looks like this can be collapsed
down to a 1-line function.
  

Patch

diff --git a/config/common_base b/config/common_base
index f6aafd17d..c767b1090 100644
--- a/config/common_base
+++ b/config/common_base
@@ -699,6 +699,11 @@  CONFIG_RTE_KNI_PREEMPT_DEFAULT=y
 CONFIG_RTE_LIBRTE_PDUMP=y
 
 #
+# Compile librte_ethtool
+#
+CONFIG_RTE_LIBRTE_ETHTOOL=n
+
+#
 # Compile vhost user library
 #
 CONFIG_RTE_LIBRTE_VHOST=n
diff --git a/config/common_linuxapp b/config/common_linuxapp
index b3cf41b01..33ed11b37 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -40,6 +40,7 @@  CONFIG_RTE_EAL_VFIO=y
 CONFIG_RTE_KNI_KMOD=y
 CONFIG_RTE_LIBRTE_KNI=y
 CONFIG_RTE_LIBRTE_PMD_KNI=y
+CONFIG_RTE_LIBRTE_ETHTOOL=y
 CONFIG_RTE_LIBRTE_VHOST=y
 CONFIG_RTE_LIBRTE_PMD_VHOST=y
 CONFIG_RTE_LIBRTE_PMD_AF_PACKET=y
diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index f5f1f199f..71350849f 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -161,4 +161,5 @@  There are many libraries, so their headers may be grouped by topics:
   [device metrics]     (@ref rte_metrics.h),
   [bitrate statistics] (@ref rte_bitrate.h),
   [latency statistics] (@ref rte_latencystats.h),
-  [version]            (@ref rte_version.h)
+  [version]            (@ref rte_version.h),
+  [ethtool]            (@ref rte_ethtool.h)
diff --git a/doc/api/doxy-api.conf b/doc/api/doxy-api.conf
index ca9194fe0..b66e86541 100644
--- a/doc/api/doxy-api.conf
+++ b/doc/api/doxy-api.conf
@@ -45,6 +45,7 @@  INPUT                   = doc/api/doxy-api-index.md \
                           lib/librte_distributor \
                           lib/librte_efd \
                           lib/librte_ether \
+                          lib/librte_ethtool \
                           lib/librte_eventdev \
                           lib/librte_hash \
                           lib/librte_ip_frag \
diff --git a/doc/guides/prog_guide/ethtool_lib.rst b/doc/guides/prog_guide/ethtool_lib.rst
new file mode 100644
index 000000000..a667bcfe3
--- /dev/null
+++ b/doc/guides/prog_guide/ethtool_lib.rst
@@ -0,0 +1,62 @@ 
+..  BSD LICENSE
+    Copyright(c) 2017 Intel Corporation. All rights reserved.
+    All rights reserved.
+
+    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 Intel Corporation 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.
+
+.. _Ethtool_Library:
+
+Ethtool Library
+===============
+
+Ethtool interface
+-----------------
+
+The Ethtool interface is built as a separate library, and implements
+the following functions:
+
+- ``rte_ethtool_get_drvinfo()``
+- ``rte_ethtool_get_regs_len()``
+- ``rte_ethtool_get_regs()``
+- ``rte_ethtool_get_link()``
+- ``rte_ethtool_get_eeprom_len()``
+- ``rte_ethtool_get_eeprom()``
+- ``rte_ethtool_set_eeprom()``
+- ``rte_ethtool_get_pauseparam()``
+- ``rte_ethtool_set_pauseparam()``
+- ``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()``
+- ``rte_ethtool_get_ringparam()``
+- ``rte_ethtool_set_ringparam()``
diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
index ef5a02ad5..54f9538ea 100644
--- a/doc/guides/prog_guide/index.rst
+++ b/doc/guides/prog_guide/index.rst
@@ -54,6 +54,7 @@  Programmer's Guide
     reorder_lib
     ip_fragment_reassembly_lib
     pdump_lib
+    ethtool_lib
     multi_proc_support
     kernel_nic_interface
     thread_safety_dpdk_functions
diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst
index 842f46f75..dbe1ee906 100644
--- a/doc/guides/rel_notes/release_17_08.rst
+++ b/doc/guides/rel_notes/release_17_08.rst
@@ -186,6 +186,7 @@  The libraries prepended with a plus sign were incremented in this version.
      librte_distributor.so.1
      librte_eal.so.4
      librte_ethdev.so.6
+   + librte_ethtool.so.1
      librte_hash.so.2
      librte_ip_frag.so.1
      librte_jobstats.so.1
diff --git a/doc/guides/sample_app_ug/ethtool.rst b/doc/guides/sample_app_ug/ethtool.rst
index 67797954d..def48985d 100644
--- a/doc/guides/sample_app_ug/ethtool.rst
+++ b/doc/guides/sample_app_ug/ethtool.rst
@@ -1,6 +1,6 @@ 
 
 ..  BSD LICENSE
-    Copyright(c) 2015 Intel Corporation. All rights reserved.
+    Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
     All rights reserved.
 
     Redistribution and use in source and binary forms, with or without
@@ -71,7 +71,7 @@  The only available options are the standard ones for the EAL:
 
 .. code-block:: console
 
-    ./ethtool-app/ethtool-app/${RTE_TARGET}/ethtool [EAL options]
+    ./${RTE_TARGET}/ethtool [EAL options]
 
 Refer to the *DPDK Getting Started Guide* for general information on
 running applications and the Environment Abstraction Layer (EAL)
@@ -128,33 +128,5 @@  Ethtool Shell
 The foreground part of the Ethtool sample is a console-based
 interface that accepts commands as described in `using the
 application`_. Individual call-back functions handle the detail
-associated with each command, which make use of the functions
-defined in the `Ethtool interface`_ to the DPDK functions.
-
-Ethtool interface
------------------
-
-The Ethtool interface is built as a separate library, and implements
-the following functions:
-
-- ``rte_ethtool_get_drvinfo()``
-- ``rte_ethtool_get_regs_len()``
-- ``rte_ethtool_get_regs()``
-- ``rte_ethtool_get_link()``
-- ``rte_ethtool_get_eeprom_len()``
-- ``rte_ethtool_get_eeprom()``
-- ``rte_ethtool_set_eeprom()``
-- ``rte_ethtool_get_pauseparam()``
-- ``rte_ethtool_set_pauseparam()``
-- ``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()``
-- ``rte_ethtool_get_ringparam()``
-- ``rte_ethtool_set_ringparam()``
+associated with each command, which make use of librte_ethtool
+library.
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 99%
rename from examples/ethtool/ethtool-app/ethapp.c
rename to examples/ethtool/ethapp.c
index 35269ea24..6eb593d94 100644
--- a/examples/ethtool/ethtool-app/ethapp.c
+++ b/examples/ethtool/ethapp.c
@@ -1,7 +1,7 @@ 
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
diff --git a/examples/ethtool/ethtool-app/ethapp.h b/examples/ethtool/ethapp.h
similarity index 96%
rename from examples/ethtool/ethtool-app/ethapp.h
rename to examples/ethtool/ethapp.h
index ba438eea8..667aae7fd 100644
--- a/examples/ethtool/ethtool-app/ethapp.h
+++ b/examples/ethtool/ethapp.h
@@ -1,7 +1,7 @@ 
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2015-2017 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
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/lib/Makefile b/lib/Makefile
index 07e1fd0c5..434237d6e 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -106,6 +106,8 @@  DIRS-$(CONFIG_RTE_LIBRTE_REORDER) += librte_reorder
 DEPDIRS-librte_reorder := librte_eal librte_mempool librte_mbuf
 DIRS-$(CONFIG_RTE_LIBRTE_PDUMP) += librte_pdump
 DEPDIRS-librte_pdump := librte_eal librte_mempool librte_mbuf librte_ether
+DIRS-$(CONFIG_RTE_LIBRTE_ETHTOOL) += librte_ethtool
+DEPDIRS-librte_ethtool := librte_eal librte_ether
 
 ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
 DIRS-$(CONFIG_RTE_LIBRTE_KNI) += librte_kni
diff --git a/examples/ethtool/lib/Makefile b/lib/librte_ethtool/Makefile
similarity index 74%
rename from examples/ethtool/lib/Makefile
rename to lib/librte_ethtool/Makefile
index 266babade..6d677f973 100644
--- a/examples/ethtool/lib/Makefile
+++ b/lib/librte_ethtool/Makefile
@@ -1,6 +1,6 @@ 
 #   BSD LICENSE
 #
-#   Copyright(c) 2015 Intel Corporation. All rights reserved.
+#   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
 #   All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
@@ -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
 
-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-y-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 97%
rename from examples/ethtool/lib/rte_ethtool.c
rename to lib/librte_ethtool/rte_ethtool.c
index fabfcb2ba..80121fe7a 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/lib/librte_ethtool/rte_ethtool.c
@@ -36,9 +36,6 @@ 
 #include <rte_version.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
-#ifdef RTE_LIBRTE_IXGBE_PMD
-#include <rte_pmd_ixgbe.h>
-#endif
 #include "rte_ethtool.h"
 
 #define PKTPOOL_SIZE 512
@@ -363,20 +360,11 @@  rte_ethtool_net_set_rx_mode(uint8_t port_id)
 {
 	uint16_t num_vfs;
 	struct rte_eth_dev_info dev_info;
-	uint16_t vf;
 
 	memset(&dev_info, 0, sizeof(dev_info));
 	rte_eth_dev_info_get(port_id, &dev_info);
 	num_vfs = dev_info.max_vfs;
 
-	/* Set VF vf_rx_mode, VF unsupport status is discard */
-	for (vf = 0; vf < num_vfs; vf++) {
-#ifdef RTE_LIBRTE_IXGBE_PMD
-		rte_pmd_ixgbe_set_vf_rxmode(port_id, vf,
-			ETH_VMDQ_ACCEPT_UNTAG, 0);
-#endif
-	}
-
 	/* Enable Rx vlan filter, VF unspport status is discard */
 	rte_eth_dev_set_vlan_offload(port_id, ETH_VLAN_FILTER_MASK);
 
diff --git a/examples/ethtool/lib/rte_ethtool.h b/lib/librte_ethtool/rte_ethtool.h
similarity index 91%
rename from examples/ethtool/lib/rte_ethtool.h
rename to lib/librte_ethtool/rte_ethtool.h
index 18f44404b..9f4d069b6 100644
--- a/examples/ethtool/lib/rte_ethtool.h
+++ b/lib/librte_ethtool/rte_ethtool.h
@@ -1,7 +1,7 @@ 
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-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
@@ -34,11 +34,13 @@ 
 #ifndef _RTE_ETHTOOL_H_
 #define _RTE_ETHTOOL_H_
 
-/*
+/**
+ * @file
+ *
  * This new interface is designed to provide a user-space shim layer for
  * Ethtool and Netdevice op API.
  *
- * rte_ethtool_get_driver:          ethtool_ops::get_driverinfo
+ * rte_ethtool_get_drvinfo:         ethtool_ops::get_driverinfo
  * rte_ethtool_get_link:            ethtool_ops::get_link
  * rte_ethtool_get_regs_len:        ethtool_ops::get_regs_len
  * rte_ethtool_get_regs:            ethtool_ops::get_regs
@@ -47,6 +49,8 @@ 
  * rte_ethtool_set_eeprom:          ethtool_ops::set_eeprom
  * rte_ethtool_get_pauseparam:      ethtool_ops::get_pauseparam
  * rte_ethtool_set_pauseparam:      ethtool_ops::set_pauseparam
+ * rte_ethtool_get_ringparam:       ethtool_ops::set_ringparam
+ * rte_ethtool_set_ringparam:       ethtool_ops::set_ringparam
  *
  * rte_ethtool_net_open:            net_device_ops::ndo_open
  * rte_ethtool_net_stop:            net_device_ops::ndo_stop
@@ -101,7 +105,7 @@  int rte_ethtool_get_regs_len(uint8_t port_id);
  *
  * @param port_id
  *   The port identifier of the Ethernet device.
- * @param reg
+ * @param regs
  *   A pointer to ethtool_regs that has register information
  * @param data
  *   A pointer to a buffer that is used to retrieve device register content
@@ -112,7 +116,7 @@  int rte_ethtool_get_regs_len(uint8_t port_id);
  *   - others depends on the specific operations implementation.
  */
 int rte_ethtool_get_regs(uint8_t port_id, struct ethtool_regs *regs,
-			    void *data);
+		void *data);
 
 /**
  * Retrieve the Ethernet device link status
@@ -135,7 +139,7 @@  int rte_ethtool_get_link(uint8_t port_id);
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @return
- *	 - (> 0) device EEPROM size in bytes
+ *   - (> 0) device EEPROM size in bytes
  *   - (0) device has NO EEPROM
  *   - (-ENOTSUP) if hardware doesn't support.
  *   - (-ENODEV) if *port_id* invalid.
@@ -150,9 +154,9 @@  int rte_ethtool_get_eeprom_len(uint8_t port_id);
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param eeprom
- *	 The pointer of ethtool_eeprom that provides eeprom range
+ *   The pointer of ethtool_eeprom that provides eeprom range
  * @param words
- *	 A buffer that holds data read from eeprom
+ *   A buffer that holds data read from eeprom
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support.
@@ -160,7 +164,7 @@  int rte_ethtool_get_eeprom_len(uint8_t port_id);
  *   - others depends on the specific operations implementation.
  */
 int rte_ethtool_get_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
-			      void *words);
+		void *words);
 
 /**
  * Setting EEPROM content based upon eeprom range described in ethtool
@@ -169,9 +173,9 @@  int rte_ethtool_get_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param eeprom
- *	 The pointer of ethtool_eeprom that provides eeprom range
+ *   The pointer of ethtool_eeprom that provides eeprom range
  * @param words
- *	 A buffer that holds data to be written into eeprom
+ *   A buffer that holds data to be written into eeprom
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support.
@@ -180,7 +184,7 @@  int rte_ethtool_get_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
  *   - others depends on the specific operations implementation.
  */
 int rte_ethtool_set_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
-			      void *words);
+		void *words);
 
 /**
  * Retrieve the Ethernet device pause frame configuration according to
@@ -190,8 +194,8 @@  int rte_ethtool_set_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param pause_param
- *	 The pointer of ethtool_coalesce that gets pause frame
- *	 configuration parameters
+ *   The pointer of ethtool_coalesce that gets pause frame
+ *   configuration parameters
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support.
@@ -200,7 +204,7 @@  int rte_ethtool_set_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
  *   - others depends on the specific operations implementation.
  */
 int rte_ethtool_get_pauseparam(uint8_t port_id,
-				   struct ethtool_pauseparam *pause_param);
+		struct ethtool_pauseparam *pause_param);
 
 /**
  * Setting the Ethernet device pause frame configuration according to
@@ -208,8 +212,8 @@  int rte_ethtool_get_pauseparam(uint8_t port_id,
  *
  * @param port_id
  *   The port identifier of the Ethernet device.
- * @param pause_param
- *	 The pointer of ethtool_coalesce that gets ring configuration parameters
+ * @param param
+ *   The pointer of ethtool_coalesce that gets ring configuration parameters
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support.
@@ -218,7 +222,7 @@  int rte_ethtool_get_pauseparam(uint8_t port_id,
  *   - others depends on the specific operations implementation.
  */
 int rte_ethtool_set_pauseparam(uint8_t port_id,
-				   struct ethtool_pauseparam *param);
+		struct ethtool_pauseparam *param);
 
 /**
  * Start the Ethernet device.
@@ -250,7 +254,7 @@  int rte_ethtool_net_stop(uint8_t port_id);
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param addr
- *	 MAC address of the Ethernet device.
+ *   MAC address of the Ethernet device.
  * @return
  *   - (0) if successful.
  *   - (-ENODEV) if *port_id* invalid.
@@ -263,7 +267,7 @@  int rte_ethtool_net_get_mac_addr(uint8_t port_id, struct ether_addr *addr);
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param addr
- *	 The new MAC addr.
+ *   The new MAC addr.
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support.
@@ -279,7 +283,7 @@  int rte_ethtool_net_set_mac_addr(uint8_t port_id, struct ether_addr *addr);
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param addr
- *	 A pointer to a buffer (6-byte, 48bit) for the target MAC address
+ *   A pointer to a buffer (6-byte, 48bit) for the target MAC address
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support.
@@ -295,7 +299,7 @@  int rte_ethtool_net_validate_addr(uint8_t port_id, struct ether_addr *addr);
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param mtu
- *	 New MTU
+ *   New MTU
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support.
@@ -311,7 +315,7 @@  int rte_ethtool_net_change_mtu(uint8_t port_id, int mtu);
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param stats
- *	 A pointer to struct rte_eth_stats for statistics parameters
+ *   A pointer to struct rte_eth_stats for statistics parameters
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support.
@@ -327,7 +331,7 @@  int rte_ethtool_net_get_stats64(uint8_t port_id, struct rte_eth_stats *stats);
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param vid
- *	 A new VLAN id
+ *   A new VLAN id
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support.
@@ -342,7 +346,7 @@  int rte_ethtool_net_vlan_rx_add_vid(uint8_t port_id, uint16_t vid);
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param vid
- *	 A new VLAN id
+ *   A new VLAN id
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support.
@@ -381,7 +385,7 @@  int rte_ethtool_net_set_rx_mode(uint8_t port_id);
  *   are used, and the function only gets parameters for queue 0.
  */
 int rte_ethtool_get_ringparam(uint8_t port_id,
-	struct ethtool_ringparam *ring_param);
+		struct ethtool_ringparam *ring_param);
 
 /**
  * Setting ring parameters for Ethernet device.
@@ -400,8 +404,7 @@  int rte_ethtool_get_ringparam(uint8_t port_id,
  *   are used, and the function only sets parameters for queue 0.
  */
 int rte_ethtool_set_ringparam(uint8_t port_id,
-	struct ethtool_ringparam *ring_param);
-
+		struct ethtool_ringparam *ring_param);
 
 #ifdef __cplusplus
 }
diff --git a/lib/librte_ethtool/rte_ethtool_version.map b/lib/librte_ethtool/rte_ethtool_version.map
new file mode 100644
index 000000000..a6e756c50
--- /dev/null
+++ b/lib/librte_ethtool/rte_ethtool_version.map
@@ -0,0 +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: *;
+};
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index bcaf1b382..449bd2f61 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -90,6 +90,7 @@  _LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS)         += -lrte_kvargs
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF)           += -lrte_mbuf
 _LDLIBS-$(CONFIG_RTE_LIBRTE_NET)            += -lrte_net
 _LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER)          += -lrte_ethdev
+_LDLIBS-$(CONFIG_RTE_LIBRTE_ETHTOOL)        += -lrte_ethtool
 _LDLIBS-$(CONFIG_RTE_LIBRTE_CRYPTODEV)      += -lrte_cryptodev
 _LDLIBS-$(CONFIG_RTE_LIBRTE_EVENTDEV)       += -lrte_eventdev
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL)        += -lrte_mempool