Commit Graph

6 Commits

Author SHA1 Message Date
Ferruh Yigit
c5917f3918 pmdinfogen: fix clang build
Compile error:
  CC mlx5.o.pmd.o
mlx5.o.pmd.c:1:227:
error: no newline at end of file [-Werror,-Wnewline-eof]
  ...__attribute__((used)) = "PMD_INFO_STRING= {...}";
                                                      ^

Produced with clang 3.8.0 and MLX5_PMD and MLX5_DEBUG
config options enabled.

Fixes: 98b0fdb0ff ("pmdinfogen: add buildtools and pmdinfogen utility")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-10-04 11:50:56 +02:00
Thomas Monjalon
a5d7a3f77d unify tools naming
The following tools may be installed system-wide.
It may be cleaner and more convenient to find them with the same
dpdk- prefix (especially for autocompletion).
Moreover, the script dpdk_nic_bind.py deserves a new name because it is
not restricted to NICs and can be used for e.g. crypto.

These files are renamed:
pmdinfogen       -> dpdk-pmdinfogen
pmdinfo.py       -> dpdk-pmdinfo.py
dpdk_pdump       -> dpdk-pdump
dpdk_proc_info   -> dpdk-procinfo
dpdk_nic_bind.py -> dpdk-devbind.py
setup.sh         -> dpdk-setup.sh

The tools pmdinfogen, pmdinfo.py and dpdk_pdump are new in 16.07.

The scripts dpdk_nic_bind.py and setup.sh may have been used with
previous releases by end users. That's why a symbolic link still
provide the old name in the installed tools directory.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-07-22 22:31:02 +02:00
Bruce Richardson
6a4f87f1e7 pmdinfogen: fix build on FreeBSD
error on compilation caused by missing include for libgen.h.
buildtools/pmdinfogen/pmdinfogen.c:402:4: error:
implicit declaration of function 'basename' is invalid in C99
                        basename(argv[0]));

Fixes: 840e5dfea3 ("pmdinfogen: fix usage message")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2016-07-10 14:51:09 +02:00
Thomas Monjalon
840e5dfea3 pmdinfogen: fix usage message
The name of the tool is pmdinfogen.

Fixes: 98b0fdb0ff ("pmdinfogen: add buildtools and pmdinfogen utility")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-08 17:48:03 +02:00
Thomas Monjalon
33e2e3061d pmdinfogen: fix build warnings
When compiled with a standard clang, pmdinfogen can raise a warning:
    buildtools/pmdinfogen/pmdinfogen.c:365:1: warning:
    control reaches end of non-void function

Actually there can be more warnings with stricter compilers.
In order to catch them early and fix most of them, the DPDK standard flags
WERROR_FLAGS are used.

The warnings fixed are:
    no previous prototype for ...
    no return statement in function returning non-void
    variable ‘secstrings’ set but not used
    ‘sec_name’ defined but not used
    ‘get_symbol_index’ defined but not used
    pointer of type ‘void *’ used in arithmetic

Fixes: 98b0fdb0ff ("pmdinfogen: add buildtools and pmdinfogen utility")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-08 17:47:17 +02:00
Neil Horman
98b0fdb0ff pmdinfogen: add buildtools and pmdinfogen utility
pmdinfogen is a tool used to parse object files and build json strings for
use in later determining hardware support in a dso or application binary.
pmdinfo looks for the non-exported symbol names this_pmd_name<n> and
this_pmd_tbl<n> (where n is a integer counter).  It records the name of
each of these tuples, using the later to find the symbolic name of the
pci_table for physical devices that the object supports.  With this
information, it outputs a C file with a single line of the form:

static char *<pmd_name>_driver_info[] __attribute__((used)) = " \
	PMD_DRIVER_INFO=<json string>";

Where <pmd_name> is the arbitrary name of the pmd, and <json_string> is the
json encoded string that hold relevant pmd information, including the pmd
name, type and optional array of pci device/vendor ids that the driver
supports.

This c file is suitable for compiling to object code, then relocatably
linking into the parent file from which the C was generated.  This creates
an entry in the string table of the object that can inform a later tool
about hardware support.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-07-06 22:34:39 +02:00