Commit Graph

5168 Commits

Author SHA1 Message Date
Jingjing Wu
4761f57d58 net/i40e: fix VLAN filtering in promiscuous mode
For VLAN filtering, the VLAN table should be enabled.
But the VLAN table is disabled by default until a rule is added.
In promiscuous mode no rule is added to enable the VLAN table.

This patch clears promiscuous VLAN flag on VSI, and adds a
rule to enable the VLAN table to fix VLAN filtering in promiscuous
mode.

Fixes: 4861cde461 ("i40e: new poll mode driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-07-04 15:44:17 +02:00
Charles (Chas) Williams
df3e6f7ac7 net/bnx2x: fix incorrect number of supported queues
We need sc->igu_sb_cnt determined before calculating the number of queues
we can support, so move the call to bnx2x_init_rte() to later in the code.

Fixes: 3754101cd7 ("net/bnx2x: fix MSIX vector and VF resource counts")

Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>
Acked-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-07-04 15:30:23 +02:00
Charles (Chas) Williams
fe63783466 net/bnx2x: set random MAC address if none assigned
If the PF hasn't assigned an address, assign one randomly.  While here,
convert to use DPDK's ether address utility routines.

Fixes: 540a211084 ("bnx2x: driver core")

Signed-off-by: Charles (Chas) Williams <ciwillia@brocade.com>
Acked-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-07-04 15:19:55 +02:00
Bruce Richardson
d8a1ccdc55 scripts: add more git log capitalization checks
Add API, NUMA, HW, SW, FW and VMDq to list of words to capitalize properly.
Since VMDq is a bit unusual, add it as special case check so we can
print an error message giving the correct way to write it.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2016-07-10 17:01:02 +02:00
Nelio Laranjeiro
e757070d64 scripts: check headline of drivers commits
A driver patch under net should start with "net/<driver name>" or if
a patch touch multiple drivers, it should only start with "net:".
The same apply for crypto.
A patch touching all drivers (net + crypto) should start with "drivers:".

Longer prefixes like "net/mlx:" (for mlx4/mlx5) or "net/e1000/base:" are
handled by not checking the colon.

The directories doc/ and config/ are ignored because a driver patch
can modify them.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-10 16:34:11 +02:00
Thomas Monjalon
341332481e scripts: reduce line size of commit checks
Small cleanup to comply with the 80 chars limit.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-10 16:34:11 +02:00
Thomas Monjalon
4fe45378b8 scripts: check spacing after commit references
A blank line between "Fixes" and "Signed-off-by" helps to
separate information in blocks.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-10 16:34:11 +02:00
Thomas Monjalon
48660cab92 scripts: fix commit check for empty list
When running check-git-log.sh on a clean tree it was complaining
of a wrong empty headline because '^[^:]*$' was matching.
It is fixed by matching at least one character with +.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-10 16:34:11 +02:00
Thomas Monjalon
ecb9eb2927 scripts: fix commit check of first word
The first word of each commit message is checked.
But when the commit range was greater than 1, only the latest commit
was checked.
It is fixed by checking each commit separately.

Fixes: 9c24780f0d ("scripts: check first word of commit messages")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-07-10 16:34:05 +02:00
Thomas Monjalon
c694693331 examples: fix dependencies on hash library
The multi_process example do not need rte_hash.
But these examples cannot compile if rte_hash is not available:
- ipsec-secgw (was already protected - no change)
- ipv4_multicast
- l3fwd-power
- l3fwd-vf
- tep_termination
- ip_pipeline

The ip_pipeline example is not disabled because its dependencies
are handled with #ifdef. It may require a separate fix.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-10 16:23:13 +02:00
Thomas Monjalon
d7a4bb1549 table: remove unneeded dependency on hash library
Fixes: 8aa327214c ("table: hash")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-10 16:23:13 +02:00
Thomas Monjalon
3553444a44 net/bnx2x: remove unneeded dependency on hash library
Fixes: 9fb557035d ("bnx2x: enable PMD build")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-07-10 16:23:09 +02:00
Thomas Monjalon
83d83cb62b net/enic: remove useless assert macro
The macro ENIC_ASSERT does the same thing as RTE_ASSERT,
thus it can be removed.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: John Daley <johndale@cisco.com>
2016-07-10 16:19:56 +02:00
Thomas Monjalon
c7cda4d8b4 app/test: remove useless clock estimation
The function get_machclk_freq() in RED test can be replaced by
rte_get_timer_hz() which already estimates the clock frequency at EAL init.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-10 16:19:56 +02:00
Ferruh Yigit
d05aafe62f igb_uio: fix possible mmap failure with Linux 4.5
mmap the iomem range of the PCI device fails for kernels that
enabled CONFIG_IO_STRICT_DEVMEM option:

EAL: pci_map_resource():
         cannot mmap(39, 0x7f1c51800000, 0x100000, 0x0):
         Invalid argument (0xffffffffffffffff)

CONFIG_IO_STRICT_DEVMEM is introduced in Linux v4.5 and not enabled
by default:
Linux commit: 90a545e restrict /dev/mem to idle io memory ranges

As a workaround igb_uio can stop reserving PCI memory resources, from
kernel point of view iomem region looks like idle and mmap works
again. This matches uio_pci_generic usage.

With this update device iomem range is not protected against any
other kernel drivers or userspace access. But this  shouldn't
be a problem for dpdk usage module since purpose of the igb_uio
module is to provide userspace access.

Fixes: af75078fec ("first public release")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-07-10 15:56:54 +02:00
Sergio Gonzalez Monroy
b78c917511 mem: do not zero out memory on zmalloc
Zeroing out memory on rte_zmalloc_socket is not required anymore since all
allocated memory is already zeroed.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2016-07-10 15:40:04 +02:00
Sergio Gonzalez Monroy
ea0bddbd14 mem: zero out memory on free
Since commit fafcc11985, memzones are not guaranteed to be zeroed out.
This could potentially cause issues as applications might have been
relying on the allocated memory being zeroed out.

On init all allocated memory is zeroed by the kernel, so by zeroing out
memory on free, all available dpdk memory is always zeroed.

Fixes: fafcc11985 ("mem: rework memzone to be allocated by malloc")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2016-07-10 15:38:40 +02:00
Daniel Mrzyglod
f0a1dd3b99 mem: fix hugepage resource leak
Current code does not munmap 'hugepage' mapping (hugepage info file) on
function exit, leaking resources.

Coverity issue: 97920
Fixes: b6a468ad41 ("memory: add --socket-mem option")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2016-07-10 15:27:39 +02:00
Reshma Pattan
2641a532ed pdump: close client socket on error
Close the client socket before returning on error.

Coverity issue: 127555
Fixes: f3c1829130 ("pdump: check missing home environment variable")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2016-07-10 15:06:30 +02:00
Yari Adan Petralanda
6dc34e0afe hash: retrieve a key given its position
The function rte_hash_get_key_with_position is added in this patch.
As the position returned when adding a key is frequently used as an
offset into an array of user data, this function performs the operation
of retrieving a key given this offset.

A possible use case would be to delete a key from the hash table when
its entry in the array of data has certain value. For instance, the key
could be a flow 5-tuple, and the value stored in the array a time
stamp.

Signed-off-by: Juan Antonio Montesinos <juan.antonio.montesinos.delgado@ericsson.com>
Signed-off-by: Yari Adan Petralanda <yari.adan.petralanda@ericsson.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-10 14:56:45 +02:00
Remy Horton
0b3b67e0a3 ethdev: fix xstats id mismatch
When fetching xstats values the driver specific parameters are
placed after the generic ones, but when fetching xstats names
the driver specific parameter names came first. This patch fixes
the resulting id mismatch between names and values.

Fixes: bd6aa172cf ("ethdev: fetch extended statistics with integer ids")

Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-07-10 14:55:42 +02:00
Zyta Szpak
001a1c0f98 ethdev: get registers width
The ethtool app was allocating too little space for 64-bit
registers which resulted in memory corruption.

Removes hard-coded assumption that device registers
are always 32 bits wide. The rte_eth_dev_get_reg_length
and rte_eth_dev_get_reg_info callbacks did not
provide register size to the app in any way while is
needed to allocate correct number of bytes before
retrieving registers using rte_eth_dev_get_reg.

This commit changes rte_eth_dev_get_reg_info so that
it can be used to retrieve both the number of registers
and their width, and removes the now-redundant
rte_eth_dev_get_reg_length.

Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-07-10 14:55:42 +02:00
Deepak Kumar Jain
a50eb86855 app/test: fix missing operation initialization
Initializing the authentication op parameter.

Fixes: eec136f3c5 ("aesni_gcm: add driver for AES-GCM crypto operations")

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-07-10 14:55:42 +02:00
Deepak Kumar Jain
37e60917c0 crypto/qat: fix digest verification
This fixes the cases in which operation was Digest verify.

Fixes: e25200fbb4 ("qat: add cipher/auth only")

Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
ebee5594a3 crypto/kasumi: restrict cipher bit-level operations
KASUMI PMD only supports bit-level cipher operations
when destination buffer is different from the source
(out of place operations). This commit adds a check
in the code to prevent the user from trying to perform
in-place bit-level ciphering.

Fixes: 2773c86d06 ("crypto/kasumi: add driver for KASUMI library")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
372201e207 crypto/kasumi: fix AAD size of F9 function
Additional authenticated data (AAD) in KASUMI F9 (UIA1) is 8 bytes
and not 9 bytes, since direction bit is obtained just after the
end of the message, and it is separated from the AAD.

Fixes: 2773c86d06 ("crypto/kasumi: add driver for KASUMI library")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
419f2add3b net/bonding: fix range of mode parameter
The range of the supported bonding modes is 0-6, instead of 0-4.

Fixes: cb6696d220 ("drivers: update registration macro usage")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
44e32a671d drivers: add virtio and xenvirt parameters infos
Virtio and Xenvirt are two virtual device drivers that admit
arguments, so DRIVER_REGISTER_PARAM_STRING should be used
in them.

Fixes: cb6696d220 ("drivers: update registration macro usage")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
65eca099f4 drivers: split parameters infos in multiple lines
Driver arguments shown with DRIVER_REGISTER_PARAM_STRING
have been separated in multiple lines and indented to
ease their readability.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
bae696ebd4 drivers: remove static driver names
Since now the PMD_REGISTER_DRIVER macro sets the driver names,
there is no need to have the rte_driver structure setting it
statically, as it will get overridden.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-10 14:51:09 +02:00
Pablo de Lara
1586ff4cef drivers: revert vdev driver names to original
In order to avoid API breakage, the driver names of the virtual devices
have been renamed to their original name, before the modification
of the PMD_REGISTER_DRIVER macro, which sets now the driver names.

Fixes: cb6696d220 ("drivers: update registration macro usage")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-10 14:51:09 +02:00
Bruce Richardson
139bdc1db6 tools: fix pmdinfo for FreeBSD
There were a couple of issues which prevented pmdinfo.py from running on
FreeBSD, both of which are fixed by this patch.

* The path to python is not /usr/bin/python as on Linux, so use
  /usr/bin/env to find it on both OS's.
* The path to the pci ids DB is in a different location on FreeBSD,
  so use the platform python library to look in different default
  locations depending on the underlying OS. [There are two possible
  locations to look on FreeBSD, as defined by pciconf manpage, so
  check in both in order of better to worse]

Fixes: c67c9a5c64 ("tools: query binaries for HW and other support information")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2016-07-10 14:51:09 +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
Pablo de Lara
aa6a021db7 cryptodev: move KASUMI to end of list
New cryptodev type for the new KASUMI PMD was added
in the cryptodev type enum, but not at the end of it,
causing an ABI breakage.

Fixes: 2773c86d06 ("crypto/kasumi: add driver for KASUMI library")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-08 20:00:32 +02:00
Pablo de Lara
cdfb776ba2 crypto: normalize driver names with macros
Recently reported, the introduction of pmd information exports led to a
breakage of cryptodev unit tests because the test infrastructure relies on the
cryptodev names being available in macros.  This patch fixes the pmd naming to
use the macro names.  Note that the macro names were already pre-stringified,
which won't work as the PMD_REGISTER_DRIVER macro requires the name in both a
processing token and stringified form.  As such the names are defined now as
tokens, and converted where needed to stringified form on demand using RTE_STR.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-07-08 19:20:26 +02:00
Thomas Monjalon
ece3100b27 maintainers: add section for pmdinfo
The author of this feature is Neil Horman.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-08 17:48:15 +02:00
Thomas Monjalon
14cbea8472 doc: fix syntax in pmdinfogen guide
Sphynx reports this error:

doc/guides/prog_guide/dev_kit_build_system.rst:337: WARNING:
Pygments lexer name u'C' is not known

Fixes: 737ddf3fb ("doc: add prog guide section documenting pmdinfo script")

Reported-by: Bernard Iremonger <bernard.iremonger@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-08 17:48:15 +02:00
Thomas Monjalon
32809bbe7a eal: remove PCI include from generic driver header
Remove include of rte_pci.h in the generic header rte_dev.h.

Fixes: cb6696d220 ("drivers: update registration macro usage")

Suggested-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-08 17:48:07 +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
Thomas Monjalon
387a02d411 mk: fix verbose pmdinfogen run
When building with "make V=1" it is expected to see the output of each
compiler command in order to debug them.
Unfortunately the pmdinfogen related commands were always quiet.

It is fixed by defining the commands in some Makefile variables.
They are printed if the verbose mode is enabled.

The other benefit of this rework is to stop compilation after a
failure with pmdinfogen.

The command readlink is removed in this rework because it seems useless.

Fixes: 3d781ca328 ("mk: do post processing on objects that register a driver")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-08 17:07:05 +02:00
Thomas Monjalon
f9e02f03c6 mk: fix driver build with installed SDK
The tool pmdinfogen was called from RTE_OUTPUT/app/ which does not exist
if building a driver outside of the SDK build.
When building DPDK, RTE_SDK_BIN is RTE_OUTPUT. When building an external
driver, RTE_SDK_BIN must point to the installed DPDK directory containing
includes, libs, etc.

That's why pmdinfogen must be installed in the SDK directory and be part
of the SDK installation.

Fixes: 3d781ca328 ("mk: do post processing on objects that register a driver")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-08 17:06:59 +02:00
Thomas Monjalon
3d61c5ccca mk: remove traces of hostapp build directory
The recipe rte.hostapp.mk does not build in hostapp/ anymore.

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 12:04:02 +02:00
Thomas Monjalon
a1ec4f91ab mk: fix build dependency of drivers on pmdinfogen
When compiling the drivers, some code is generated with pmdinfogen.
A fresh parallel build can fail if a driver is compiled before pmdinfogen:
	build/buildtools/dpdk-pmdinfogen: Permission denied

There was a dependency declared in drivers/Makefile but it cannot work
because this file is based on mk/rte.subdir.mk which do not handle
dependencies.

It is fixed by declaring the whole buildtools as (order only) prerequisite
of drivers.

Fixes: cb6696d220 ("drivers: update registration macro usage")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2016-07-08 12:04:02 +02:00
Thomas Monjalon
54266acc64 drivers: fix build with new register macro
Compilation fails because of some typos.

Fixes: cb6696d220 ("drivers: update registration macro usage")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Tested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-07-08 10:27:08 +02:00
Neil Horman
737ddf3fb1 doc: add prog guide section documenting pmdinfo script
Information on pmdinfogen may be useful to 3rd party driver developers.
Include documentation on what it does

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-07-06 23:21:40 +02:00
Neil Horman
c67c9a5c64 tools: query binaries for HW and other support information
This tool searches for the primer sting PMD_DRIVER_INFO= in any ELF binary,
and, if found parses the remainder of the string as a json encoded string,
outputting the results in either a human readable or raw, script parseable
format

Note that, in the case of dynamically linked applications, pmdinfo.py will
scan for implicitly linked PMDs by searching the specified binaries
.dynamic section for DT_NEEDED entries that contain the substring
librte_pmd.  The DT_RUNPATH, LD_LIBRARY_PATH, /usr/lib and /lib are
searched for these libraries, in that order

If a file is specified with no path, it is assumed to be a PMD DSO, and the
LD_LIBRARY_PATH, /usr/lib[64]/ and /lib[64] is searched for it

Currently the tool can output data in 3 formats:

a) raw, suitable for scripting, where the raw JSON strings are dumped out
b) table format (default) where hex pci ids are dumped in a table format
c) pretty, where a user supplied pci.ids file is used to print out vendor
and device strings

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 23:21:40 +02:00
Neil Horman
3d781ca328 mk: do post processing on objects that register a driver
Modify the compilation makefile to identify C files that export PMD
information, and use that to trigger execution of the pmdinfo binary.  If
the execution of pmdinfo is successful, compile the output C file to an
object, and use the linker to do relocatable linking on the resultant
object file into the parent object that it came from.  This effectively
just adds the json string into the string table of the object that defines
the PMD to the outside world.

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 23:21:40 +02:00
Neil Horman
fef7ff4c2e eal: export default plugin path to external tools
Export a symbol containing the string:
DPDK_PLUGIN_PATH="$(CONFIG_RTE_EAL_PMD_PATH)"

Where the latter half of the string is set at build time to a location from
which autoloaded DSO's will be found.  This string is used by pmdinfo in
'plugin' mode, whereby a user can specify a dpdk installation directory (or
static binary), and scan the associated path (if found) for pmd DSO's and
report on their 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 23:21:40 +02:00
Neil Horman
cb6696d220 drivers: update registration macro usage
Modify the PMD_REGISTER_DRIVER macro, adding a name argument to it.  The
addition of a name argument creates a token that can be used for subsequent
macros in the creation of unique symbol names to export additional bits of
information for use by the pmdinfogen tool.  For example:

PMD_REGISTER_DRIVER(ena_driver, ena);

registers the ena_driver struct as it always did, and creates a symbol
const char this_pmd_name0[] __attribute__((used)) = "ena";

which pmdinfogen can search for and extract.  The subsequent macro

DRIVER_REGISTER_PCI_TABLE(ena, ena_pci_id_map);

creates a symbol const char ena_pci_tbl_export[] __attribute__((used)) =
"ena_pci_id_map";

Which allows pmdinfogen to find the pci table of this driver

Using this pattern, we can export arbitrary bits of information.

pmdinfo uses this information to extract hardware support from an object
file and create a json string to make hardware support info discoverable
later.

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 23:21:40 +02:00