Commit Graph

5126 Commits

Author SHA1 Message Date
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
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
Thomas Monjalon
26622cbe1b version: 16.07-rc1
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-04 03:43:08 +02:00
Jianfeng Tan
d911c94d25 net/virtio-user: fix build with icc
Implicit int to enum conversion is not allowed when icc is used as
the compiler. It raises the compiling error like,
    drivers/net/virtio/virtio_user/vhost_user.c(257):
        error #188: enumerated type mixed with another type
    msg.request = req;
                ^

The fix is simple, change the type of parameter req to enum
vhost_user_request.

Fixes: 6a84c37e39 ("net/virtio-user: add vhost-user adapter layer")

Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-06-30 07:46:29 +02:00
Tetsuya Mukawa
5f05e95cd5 net/vhost: fix Tx error counting
According to 'rte_eth_stats' structure comments, 'imissed'
should represent RX error counting, but currently 'imissed' is
used to count TX error.

The patch replaces 'imissed' by 'oerrors'.

Fixes: ee584e9710 ("vhost: add driver on top of the library")

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-06-30 07:46:29 +02:00
Yuanhan Liu
4feff06e50 vhost: fix missing flag reset on stop
Commit 550c9d27d1 ("vhost: set/reset device flags internally") moves
the VIRTIO_DEV_RUNNING set/reset to vhost lib. But I missed one reset
on stop; here fixes it.

Fixes: 550c9d27d1 ("vhost: set/reset device flags internally")

Reported-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
2016-06-30 07:46:29 +02:00
Yuanhan Liu
2bfaec9072 doc: update vhost guide
Mainly on updating vhost-user part: we now support client mode.
Also refine some words, and add a bit more explanation.

And made an emphatic statement that you are suggested to use vhost-user
instead of vhost-cuse, because we have enhanced vhost-user a lot since
v2.2 (Actually, I doubt there are any people still using vhost-cuse)

[John McNamara: rewords, better formats]
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2016-06-30 07:46:29 +02:00
Ferruh Yigit
e25a87cc3a ivshmem: fix for modified mempool struct
struct rte_mempool changed its "ring" field to "pool_data"

"ring" field is accessed by ivshmem library, and updated to "pool_data"

This patch fixes the compile error:

lib/librte_ivshmem/rte_ivshmem.c:
 In function 'add_mempool_to_metadata':
 lib/librte_ivshmem/rte_ivshmem.c:584:32:
 error: 'const struct rte_mempool' has no member named 'ring'
  return add_ring_to_metadata(mp->ring, config);
                                ^~

Fixes: 449c49b93a ("mempool: support handler operations")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2016-07-01 19:33:08 +02:00
Sergio Gonzalez Monroy
ec03a0a97e mk: fix ACL library static linking
Since below commit, ACL library is outside the scope of --whole-archive
and ACL autotest fails.

  RTE>>acl_autotest
  ACL: allocation of 25166728 bytes on socket 9 for ACL_acl_ctx failed
  ACL: rte_acl_add_rules(acl_ctx): rule #1 is invalid
  Line 1584: SSE classify with zero categories failed!
  Test Failed

This is the result of the linker picking weak over non-weak functions.

Fixes: 95dc3c3cf3 ("mk: reduce scope of whole-archive static linking")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2016-07-01 16:46:09 +02:00
Sergio Gonzalez Monroy
1ed3852fa9 mk: allow duplicate linker flags in libraries list
Since [1] duplicates in LDLIBS are removed. The side effect is that it
does not distinguish between libraries or linker flags.

This patch allows multiple linker flags in LDLIBS, such as
--whole-archive.

[1] Commit: edf4d331dc ("mk: eliminate duplicates from libraries list")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2016-07-01 16:45:09 +02:00
Olivier Matz
bb0bc8bb70 ethdev: clarify API of packet types support
As discussed in http://dpdk.org/ml/archives/dev/2016-June/042229.html,
clarify the behavior of rte_eth_dev_get_supported_ptypes().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-01 16:24:52 +02:00
Remy Horton
d085232a14 ethdev: remove redundant id field in xstats name lookup
For all drivers that currently implement xstats, the id field in the
rte_eth_stats_name structure equals the entry's array index. This
patch eliminates the redundant id field as a direct index lookup is
faster than a search for the matching id field.

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-07-01 16:09:06 +02:00
Thomas Monjalon
cda8d58dc2 ethdev: fix extended statistics description
The old structure rte_eth_xstats contained names and values.
The new structure rte_eth_xstat contains ids and values.

Fixes: bd6aa172cf ("ethdev: fetch extended statistics with integer ids")
Fixes: e2aae1c1ce ("ethdev: remove name from extended statistic fetch")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-07-01 15:41:02 +02:00
Thomas Monjalon
e039cc863b scripts: test clean build when config is changed
If there is a change in the config directory the build test
will refresh the tested build config to take into account new options.
The git working directory and the last git commit are checked for a
change in config/.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-01 12:35:57 +02:00
Thomas Monjalon
b647da1064 scripts: check fixed commit branch
The commit id of a fixed commit must be in the current branch.
It avoids referencing a local branch or a next-* branch when
pushing in the master.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-07-01 12:35:57 +02:00
David Hunt
ea151eb48a app/test: migrate custom mempool handler to stack handler
After introducing the stack handler in the previous commit,
we now have very similar code to the custom handler in test_mempool.c,
which creates a custom mempool based on simple mallocs.
The stack handler is a cleaner example of adding a new mempool handler,
so this commit replaces the custom handler test with a stack
handler test, and removes the custom handler code.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-01 12:35:57 +02:00
David Hunt
57faf30b07 mempool: add stack mempool handler
This is a mempool handler that is useful for pipelining apps, where
the mempool cache doesn't really work - example, where we have one
core doing rx (and alloc), and another core doing Tx (and return).
In such a case, the mempool ring simply cycles through all the mbufs,
resulting in a LLC miss on every mbuf allocated when the number of
mbufs is large. A stack (LIFO) recycles buffers more effectively in
this case.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-07-01 12:35:57 +02:00
Bruce Richardson
a0fd91cefc mempool: rename functions with confusing names
The mempool_count and mempool_free_count behaved contrary to what their
names suggested. The free_count function actually returned the number of
elements that were allocated from the pool, not the number unallocated as
the name implied.

Fix this by introducing two new functions to replace the old ones,
* rte_mempool_avail_count to replace rte_mempool_count
* rte_mempool_in_use_count to replace rte_mempool_free_count

In this patch, the new functions are added, and the old ones are marked
as deprecated. All apps and examples that use the old functions are
updated to use the new functions.

Fixes: af75078fec ("first public release")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2016-07-01 12:35:57 +02:00
Ferruh Yigit
43ea400494 port: remove duplicated symbols from .map
Fixes: 9d41beed24 ("lib: provide initial versioning")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-06-30 20:02:56 +02:00
Ferruh Yigit
15d8ecab2a cmdline: remove duplicated symbol from .map
Fixes: 9d41beed24 ("lib: provide initial versioning")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-30 20:02:52 +02:00
Ferruh Yigit
2d0a459003 ethdev: remove duplicated symbol from .map
Fixes: 19b16e2f64 ("ethdev: add vlan type when setting ether type")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-06-30 20:02:47 +02:00
Pablo de Lara
017d680a91 app/testpmd: limit number of forwarding cores
Number of forwarding cores must be equal or less than
number of forwarding streams, otherwise two cores
would try to use a same queue on a port, which is not allowed.

Fixes: f2bb7ae1d2 ("app/testpmd: handle all Rx queues in RSS setup")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2016-06-30 19:34:15 +02:00
Jerin Jacob
863bfb4744 mempool: optimize copy in cache
Replace C memcpy code semantics with optimized rte_memcpy.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-30 19:34:15 +02:00
Olivier Matz
729f17a932 mem: revert page locking when not using hugepages
This reverts commit 593a084afc.

Since recently [1], it is not possible to run the dpdk with
non-root privileges and the --no-huge option. This is because the eal
layer tries to lock the memory. Using locked memory is mandatory for
physical devices because they reference physical addresses.

But a user may want to start the dpdk without locked memory, because he
does not have the permission to do so, and/or does not have this need,
for instance because he uses virtual drivers.

So this commit reverts the use of MAP_LOCKED in mmap() flags.

[1] http://www.dpdk.org/ml/archives/dev/2016-May/039404.html

Fixes: 593a084afc ("mem: lock pages when not using hugepages")

Reported-by: Panu Matilainen <pmatilai@redhat.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-30 19:15:32 +02:00
Rami Rosen
6fedf6eed2 jobstats: fix typo in a comment
Signed-off-by: Rami Rosen <rami.rosen@intel.com>
2016-06-30 18:51:20 +02:00
Rami Rosen
7562d8ad3b ethdev: fix typo in a comment
Signed-off-by: Rami Rosen <rami.rosen@intel.com>
2016-06-30 18:51:20 +02:00
Jianfeng Tan
77988fc08d mem: fix allocating all free hugepages
EAL memory init allocates all free hugepages of the whole system,
which seen from sysfs, even when applications do not ask so many.
When there is a limitation on how many hugepages an application can
use (such as cgroup.hugetlb), or hugetlbfs is specified with an
option of size (exceeding the quota of the fs), it just fails to
start even there are enough hugepages allocated.

To fix above issue, this patch:
 - Changes the logic to continue memory init to see if hugetlb
   requirement of application can be addressed by already allocated
   hugepages.
 - To make sure each hugepage is allocated successfully, we add a
   recover mechanism, which relies on a mem access to fault-in
   hugepages, and if it fails with SIGBUS, recover to previously
   saved stack environment with siglongjmp().

For the case of CONFIG_RTE_EAL_SINGLE_FILE_SEGMENTS (enabled by
default when compiling IVSHMEM target), it's indispensable to
mapp all free hugepages in the system. Under this case, it fails
to start when allocating fails.

Test example:
  a. cgcreate -g hugetlb:/test-subgroup
  b. cgset -r hugetlb.1GB.limit_in_bytes=2147483648 test-subgroup
  c. cgexec -g hugetlb:test-subgroup \
          ./examples/helloworld/build/helloworld -c 0x2 -n 4

Fixes: af75078fec ("first public release")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Tested-by: Yulong Pei <yulong.pei@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2016-06-30 15:33:42 +02:00
Huilong Xu
2379ae8128 pci: increase log level to show blacklisted devices
Maybe we should change log level, when add port in blacklist,
for check it easy.
It does not influence performance and function.

Signed-off-by: Huilong Xu <huilongx.xu@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-06-30 14:01:37 +02:00
Lazaros Koromilas
4b5062755a mempool: allow user-owned cache
The mempool cache is only available to EAL threads as a per-lcore
resource. Change this so that the user can create and provide their own
cache on mempool get and put operations. This works with non-EAL threads
too. This commit introduces the new API calls:

    rte_mempool_cache_create(size, socket_id)
    rte_mempool_cache_free(cache)
    rte_mempool_cache_flush(cache, mp)
    rte_mempool_default_cache(mp, lcore_id)

Changes the API calls:

    rte_mempool_generic_put(mp, obj_table, n, cache, flags)
    rte_mempool_generic_get(mp, obj_table, n, cache, flags)

The cache-oblivious API calls use the per-lcore default local cache.

Signed-off-by: Lazaros Koromilas <l@nofutznetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-30 11:28:10 +02:00
Lazaros Koromilas
d6f78df6fe mempool: use bit flags for multi consumers and producers
Pass the same flags as in rte_mempool_create(). Changes API calls:

    rte_mempool_generic_put(mp, obj_table, n, flags)
    rte_mempool_generic_get(mp, obj_table, n, flags)

Signed-off-by: Lazaros Koromilas <l@nofutznetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-30 11:28:10 +02:00
Lazaros Koromilas
656f2d3ede mempool: deprecate specific get and put functions
This commit introduces the API calls:

    rte_mempool_generic_put(mp, obj_table, n, is_mp)
    rte_mempool_generic_get(mp, obj_table, n, is_mc)

Deprecates the API calls:

    rte_mempool_mp_put_bulk(mp, obj_table, n)
    rte_mempool_sp_put_bulk(mp, obj_table, n)
    rte_mempool_mp_put(mp, obj)
    rte_mempool_sp_put(mp, obj)
    rte_mempool_mc_get_bulk(mp, obj_table, n)
    rte_mempool_sc_get_bulk(mp, obj_table, n)
    rte_mempool_mc_get(mp, obj_p)
    rte_mempool_sc_get(mp, obj_p)

We also check cookies in one place now.

Signed-off-by: Lazaros Koromilas <l@nofutznetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-30 11:28:10 +02:00
Ferruh Yigit
be52da5dbd net/thunderx: add missing external dependency
To prevent compile error when compiling for shared library:
nicvf_hw.o: In function `nicvf_qsize_regbit':
nicvf_hw.c:(.text+0xe64): undefined reference to `log2'
nicvf_hw.o: In function `nicvf_rss_reta_update':
nicvf_hw.c:(.text+0x19dd): undefined reference to `log2'
nicvf_hw.o: In function `nicvf_rss_reta_query':
nicvf_hw.c:(.text+0x1acb): undefined reference to `log2'

Fixes: e438796617 ("net/thunderx: add PMD skeleton")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2016-06-30 10:07:57 +02:00
Zhe Tao
79f2248219 net/i40e: add floating VEB option
The standard Virtual Ethernet Bridge(VEB) definition in 1Qbg is a bridge
which has an uplink port to the outside world (maybe another bridge), but
a "floating" VEB is a special VEB without an uplink port to the outside.
Instead, traffic can be sent from one VF to another using the floating
VEB - even when the physical link on the NIC port is down.

This patch adds floating VEB options in the devargs for i40e driver.
Using these parameters, applications can decide whether to use legacy
VEB/VEPA or a floating VEB.
To enable this feature, the user should pass a devargs parameter to the
EAL, for example "-w 84:00.0,enable_floating_veb=1", to control whether
the PMD will to use the floating VEB feature or not.

Once the floating VEB feature is enabled, all the VFs created by
this PF device are connected to the floating VEB.

NOTE: The floating VEB functionality requires a NIC firmware version
of 5.0 or greater.

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2016-06-29 17:28:31 +02:00
Zhe Tao
440499cf53 net/i40e: support floating VEB
The standard Virtual Ethernet Bridge(VEB) definition in 1Qbg is a bridge
which has an uplink port to the outside world (maybe another bridge),
but a "floating" VEB is a special VEB without an uplink port to the
outside. Instead, traffic can be sent from one VF to another using the
floating VEB - even when the physical link on the NIC port is down.

VFs VSIs connect either to the standard VEB/VEPA or to the floating VEB,
they cannot connect to both of them. The PF, VMDQ and FD VSIs still
connect to the normal VEB/VEPA.

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
2016-06-29 17:28:21 +02:00
Nelson Escobar
16dba07133 net/enic: fix Rx scatter with multiple queues
The Rx scatter patch failed to make a few changes and resulted in
problems when using multiple receive queues (RQs) in DPDK (ie RSS)
since the wrong adapter resources were being used.

- get and use the correct completion queue index associated with a
  receive queue.
- set the correct receive queue index when using RSS

Fixes: 856d7ba7ed ("net/enic: support scattered Rx")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2016-06-29 12:46:31 +02:00
Jerin Jacob
714b319f11 net/thunderx: fix build with clang
Fix the following error with clang
	error: unused function 'nicvf_mbox_msg_str'

The function nicvf_mbox_msg_str() may be unused, based on DEBUG
compilation option selected. Mark __attribute__((unused)) on
this function, to inform compiler that this function may be unused

Fixes: 966e225c23 ("net/thunderx/base: add mailbox for PF/VF communication")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-06-29 12:36:57 +02:00
Jerin Jacob
6e14297370 net/thunderx: fix build flags with clang
'fno-prefetch-loop-arrays' optimization flag is not supported with clang,
so use it only when compiling with gcc.

Fixes: 1c421f18e0 ("net/thunderx: add single and multi-segment Tx")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-06-29 12:33:32 +02:00
Aaron Campbell
c431ec66c5 net/igb: support setting link up or down
Add driver functions to set link state up or down.

Signed-off-by: Aaron Campbell <aaron@arbor.net>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-06-29 12:26:39 +02:00
John Daley
396a6d71e5 net/enic: update MTU for non-scattered Rx
Provide an update MTU callback. The function returns -ENOTSUP
if Rx scatter is enabled. Updating the MTU to be greater than
the value configured via the Cisco CIMC/UCSM management interface
is allowed provided it is still less than the maximum egress packet
size allowed by the NIC minus the size of the L2 header.

Signed-off-by: John Daley <johndale@cisco.com>
2016-06-29 11:58:26 +02:00
John Daley
bb34ffb848 net/enic: determine max egress packet size and max MTU
Pull in common VNIC code which enables querying for max egress
packet size with newer firmware via a device command. If the
field is non-zero, it is the max egress packet size. If it is
0, the default value (9022) can safely be assumed. The value
for 1300 series VICS using firmware versions >= 3.1.2 for blade
series and >= 2.0.13 for rack series servers is 9208.

Tx buffers can be emitted only if they are less than the max egress
packet size regardless of the MTU setting (the MTU is advisory).
The max egress packet size can used to determine the upper limit
of the MTU since the enic can also receive packets of size greater
than max egress packet size. A max_mtu variable is added with
a value of max egress packet size minus L2 header size.

The default MTU is set via the CIMC/UCSM management interface and
currently allows value up to 9000. If the value is changed, the
host must be reboot. To avoid the reboot and allow MTU values
up to the max capability of the NIC, MTU update capability will
be added with a max value capped by max_mtu.

Signed-off-by: John Daley <johndale@cisco.com>
2016-06-29 11:54:46 +02:00
Ferruh Yigit
9c9def9bfa net/bnx2x: fix build with icc
Fix multiple icc issues of type:
	error #188: enumerated type mixed with another type

For simple cases, just fix the code causing the problem.
However, we still need to disable compiler warning because of
more complex cases.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Rasesh Mody <rasesh.mody@qlogic.com>
2016-06-29 11:48:36 +02:00
Helin Zhang
cfcf046653 net/i40e: remove unsupported VF command
Delete 'case I40E_VIRTCHNL_OP_FCOE', as it is not necessary. The
default case reports on all unsupported commands included this one.
This also prevents warnings about a missing "break" at the end of the
"case" block.

Coverity issue: 13265

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

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2016-06-28 13:56:12 +02:00
Helin Zhang
819a5c14d1 net/i40e: fix null checks
This patch fixes the issues reported by Coverity of 'Dereference
before null check', by deleting unnecessary null checks, or moving
null checks to before the offending use of the pointer.

Coverity issue: 13298, 13299, 13294, 13301, 119267

Fixes: 8e109464c0 ("i40e: allow vector Rx and Tx usage")
Fixes: a778a1fa2e ("i40e: set up and initialize flow director")
Fixes: a778a1fa2e ("i40e: set up and initialize flow director")
Fixes: 4861cde461 ("i40e: new poll mode driver")

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2016-06-28 13:23:15 +02:00