Commit Graph

2532 Commits

Author SHA1 Message Date
Alex Rosenbaum
acac55f164 mlx4: use MOFED 3.0 fast verbs interface for Rx operations
This commit replaces the CQ polling and QP posting functions
(mlx4_rx_burst() only) with a new low level interface to improve
performance.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Gilad Berman <giladb@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 11:04:40 +02:00
Or Ami
fec3608673 mlx4: query netdevice to get initial MAC address
Querying the netdevice instead of deriving the port's MAC address from its
GID is less prone to errors. There is no guarantee that the GID will always
contain it nor that the algorithm won't change.

Signed-off-by: Or Ami <ora@mellanox.com>
Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 11:04:00 +02:00
Olga Shern
1c214ab7f0 mlx4: fix support for multiple vlan filters
This commit fixes the "Multiple RX VLAN filters can be configured, but only
the first one works" bug. Since a single flow specification cannot contain
several VLAN definitions, the flows table is extended with MLX4_MAX_VLAN_IDS
possible specifications per configured MAC address.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Or Ami <ora@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 11:02:51 +02:00
Or Ami
2d402df262 mlx4: remove provision for flow creation failure in DMFS A0 mode
Starting from MLNX_OFED 3.0 FW 2.34.5000 when working with optimized
steering mode (-7) QPs can be attached to the port's MAC, therefore no need
for the check.

Signed-off-by: Or Ami <ora@mellanox.com>
Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 11:02:26 +02:00
Or Ami
0ab6626beb mlx4: fix error message for invalid number of descriptors
The number of descriptors must be a multiple of MLX4_PMD_SGE_WR_N.

Signed-off-by: Or Ami <ora@mellanox.com>
Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 10:58:52 +02:00
Alex Rosenbaum
baf036766f mlx4: use MOFED 3.0 extended flow steering API
This commit drops "exp" from related function and type names to stop using
the experimental API.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 10:58:24 +02:00
Olga Shern
e947d2ec8b mlx4: improve accuracy of link status information
Query interface properties using the ethtool API instead of Verbs
through ibv_query_port(). The returned information is more accurate for
Ethernet links since several link speeds cannot be mapped to Verbs
semantics.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 10:58:11 +02:00
Olga Shern
643777a171 mlx4: allow application to partially fork
Although using the PMD from a forked process is still unsupported, this
commit makes Verbs safe enough for applications to call fork() for other
purposes.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 10:55:40 +02:00
Alex Rosenbaum
decb879408 mlx4: merge Rx queue setup functions
Make rxq_setup_qp() handle inline support like rxq_setup_qp_rss() instead of
having two separate functions.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 10:55:16 +02:00
Alex Rosenbaum
c3f2341582 mlx4: avoid looking up work request id to improve Rx performance
This is done by storing the current index in the RX queue structure.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 10:49:17 +02:00
Olga Shern
aad569e437 mlx4: make sure experimental device query is implemented
HAVE_EXP_QUERY_DEVICE is used to check whether ibv_exp_query_device() can be
used. RSS and inline receive features depend on it.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 10:48:17 +02:00
Adrien Mazarguil
68a60cee2f mlx4: add MOFED 3.0 compatibility to interface name retrieval
Since Mellanox OFED 3.0 and Linux 3.15, interface port numbers are stored
in dev_port instead of dev_id sysfs files.

Signed-off-by: Or Ami <ora@mellanox.com>
Signed-off-by: Nitzan Weller <nitzanwe@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 10:45:59 +02:00
Adrien Mazarguil
53bbf5afbd mlx4: fix possible crash on scattered mbuf allocation failure
When failing to allocate a segment, mlx4_rx_burst_sp() may call
rte_pktmbuf_free() on an incomplete scattered mbuf whose next pointer
in the last segment is not set.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-07-01 10:17:31 +02:00
Thomas Monjalon
c55e94f560 cxgbe: fix build with clang
GCC_VERSION is empty in case of clang:
	/bin/sh: line 0: test: -ge: unary operator expected

It cannot be quoted because an integer is expected.
So the fix is to check empty value in a separate test.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-07-01 00:18:43 +02:00
Rahul Lakkireddy
4d84a97d52 cxgbe: add documentation
Adds cxgbe poll mode driver documentation under the usual doc/guides/nics/
directory with the rest of the drivers.  The documentation covers cxgbe
implementation details, features and limitations, prerequisites,
configuration, and a sample application usage.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2015-06-30 22:59:16 +02:00
Rahul Lakkireddy
631dfc71cd cxgbe: add flow control functions
Adds flow control related eth_dev_ops for cxgbe poll mode driver.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2015-06-30 22:53:50 +02:00
Rahul Lakkireddy
cdac6e2eea cxgbe: add link related functions
Adds link update, promiscuous and multicast related eth_dev_ops for
cxgbe poll mode driver.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2015-06-30 22:53:34 +02:00
Rahul Lakkireddy
856505d303 cxgbe: add port statistics
Adds stats_get() and stats_reset() eth_dev_ops for cxgbe poll mode driver.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2015-06-30 22:53:24 +02:00
Rahul Lakkireddy
0462d11544 cxgbe: add device related operations
Adds dev_start(), dev_stop(), and dev_close() eth_dev_ops for cxgbe poll
mode driver.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2015-06-30 22:52:14 +02:00
Rahul Lakkireddy
4a01078b4f cxgbe: add Tx support
Adds TX support for the cxgbe poll mode driver.  This patch:

1. Adds tx queue related eth_dev_ops.
2. Adds tx_pkt_burst for transmitting packets.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2015-06-30 22:52:02 +02:00
Rahul Lakkireddy
92c8a63223 cxgbe: add device configuration and Rx support
Adds RX support for the cxgbe poll mode driver.  This patch:

1. Adds rx queue related eth_dev_ops.
2. Adds RSS support.
3. Adds dev_configure() and dev_infos_get() eth_dev_ops.
4. Adds rx_pkt_burst for receiving packets.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2015-06-30 22:51:31 +02:00
Rahul Lakkireddy
8318984927 cxgbe: add pmd skeleton
Adds cxgbe poll mode driver for DPDK under drivers/net/cxgbe directory.
This patch:

1. Adds the Makefile to compile cxgbe pmd.
2. Registers and initializes the cxgbe pmd driver.

Enable cxgbe PMD for compilation and linking with changes to:
1. config/common_linuxapp to add macros for cxgbe pmd.
2. drivers/net/Makefile to add cxgbe pmd to the compile list.
3. mk/rte.app.mk to add cxgbe pmd to link.

Update MAINTAINERS file to claim responsibility for the cxgbe PMD.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
[Thomas: add disabled config for bsdapp]
2015-06-30 22:46:42 +02:00
Rahul Lakkireddy
3bd122eef2 cxgbe/base: add hardware API for Chelsio T5 series adapters
Adds hardware specific api for all the Chelsio T5 adapters under
drivers/net/cxgbe/base directory.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
2015-06-30 17:56:33 +02:00
Huawei Xie
cca619e459 vhost: comment unwanted callback
add comment for potential unwanted callback on listenfds

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
2015-06-30 17:49:08 +02:00
Huawei Xie
292959c719 vhost: cleanup unix socket
rte_vhost_driver_unregister API will remove the listenfd from event list,
and then close it.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Signed-off-by: Peng Sun <peng.a.sun@intel.com>
2015-06-30 17:49:08 +02:00
Huawei Xie
3670686ab9 vhost: fix race for connection fd
In the event handler of connection fd, the connection fd could be possibly
closed. The event dispatch loop would then try to remove the fd from fdset.
Between these two actions, another thread might register a new listenfd
reusing the val of just closed fd, so we couldn't call fdset_del which would
wrongly clean up the new listenfd. A new function fdset_del_slot is provided
to cleanup the fd at the specified location.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
2015-06-30 17:49:07 +02:00
Huawei Xie
88211243e4 vhost: turn on by default
Previous vhost-cuse implementation requires fuse development package.
Now that we have vhost-user implementation, which is enabled by default
and doesn't require additional library to build, we could turn on vhost.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
2015-06-29 18:57:43 +02:00
Huawei Xie
af295ad469 vhost: realloc device and queues to same numa node as vring desc
When we get the address of vring descriptor table in VHOST_SET_VRING_ADDR
message, will try to reallocate vhost device and virt queue to the same
numa node.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
2015-06-29 18:57:33 +02:00
Huawei Xie
4113e38100 vhost: use rte_malloc to allocate device and queues
use rte_malloc to allocate vhost device and queues

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
2015-06-29 18:57:33 +02:00
Thomas Monjalon
1d91efb9cb lib: remove redundant definition of local symbols
The new version nodes inherit from the previous ones which
already include a default catch-all line for not exported symbols.

Reported-by: Helin Zhang <helin.zhang@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-29 18:57:32 +02:00
Thomas Monjalon
7cc2bdedd3 doc: link ABI policy to release notes
When moving ABI policy to guidelines, the new doc was referred
without using sphinx link.

Fixes: f1ef9794f9 ("doc: add ABI guidelines")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-29 16:58:09 +02:00
Neil Horman
f1ef9794f9 doc: add ABI guidelines
People have been asking for ways to use the ABI macros, heres some docs to
clarify their use.  Included is:

* An overview of what ABI is
* Details of the ABI deprecation process
* Details of the versioning macros
* Examples of their use
* Details of how to use the ABI validator

Thanks to John Mcnamara, who duplicated much of this effort at Intel while I was
working on it.  Much of the introductory material was gathered and cleaned up by
him.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-29 16:45:01 +02:00
Neil Horman
eb8783320e compat: remove unneeded macro
BASE_SYMBOL was only here for completelness.
DPDK currently doesn't need it, so lets remove it.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-29 16:41:23 +02:00
Neil Horman
58298a4e7b compat: add macro to map symbol in static build
It was pointed out in my examples that doing shared library symbol versioning by
partitioning symbols to version specific functions (as opposed to leaving the
latest symol version at the base symbol name), neglects to take into account
static builds.  Add a macro to handle that.  If you choose a versioning approach
that uniquely names every version of the symbol, then this macro lets you map
your symbol choice to the base name when building a static library

Also, while I'm at it, since we're documenting this in the guide, take the
abbreviated example out of the header

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
[Thomas: remove remaining part of old example]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-29 16:33:46 +02:00
Neil Horman
5fcb4dc3ba compat: clean up
Clean up some macro definition typos and comments

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-29 16:08:54 +02:00
Bruce Richardson
152143808d mk: fix static build on Fedora 22
On Fedora 22, the "ar" binary operates by default in deterministic mode,
making the "u" parameter irrelevant, and leading to warning messages
getting printed in the build output like below.

  INSTALL-LIB librte_kvargs.a
ar: `u' modifier ignored since `D' is the default (see `U')

There are two options to remove these warnings:
* add in the "U" flag to make "ar" non-deterministic again
* remove the "u" flag to have all objects always updated

This patch takes the second approach. It also explicitly adds in the "D"
flag to make behaviour consistent across different distributions which
may have different defaults.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-06-29 14:31:13 +02:00
Adrien Mazarguil
c0362128c5 eal: fix pedantic build of mlx4 debug mode
Since the commit below includes rte_cpuflags.h in rte_spinlock.h,
compilation of the mlx4 driver fails when CONFIG_RTE_LIBRTE_MLX4_DEBUG=y.

This mode adds -pedantic to the compiler's command line for mlx4, which
complains about the static definition of an empty cpu_feature_table[] in
common rte_cpuflags.h, then about its redefinition as a larger array in
arch-specific rte_cpuflags.h.

While DPDK does not officially support -pedantic internally, external
applications may enable it and include rte_spinlock.h from the public API.

Instead of removing -pedantic from mlx4, this commit fixes rte_cpuflags.h.

Fixes: ba7468997e ("spinlock: add HTM lock elision for x86")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2015-06-29 14:09:06 +02:00
Stephen Hemminger
3379b158b2 bonding: initialize backpointer from pci device to driver
Add missing initialization of to pci_dev driver
The link from pci_dev back to the ethernet driver was not being set.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2015-06-29 12:13:37 +02:00
Jan Blunck
af63759a53 bonding: fix crash when stopping inactive slave
When stopping the bond device we don't need to try and free up the LACPDU's
from deactivated devices since this is covered by
bond_mode_8023ad_deactivate_slave().

This fixes the following:
[    0.100569] PANIC in bond_ethdev_stop():
[    0.100589] line 1172        assert "port->rx_ring != NULL" failed

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2015-06-29 00:33:50 +02:00
Tomasz Kulasek
414b202343 bonding: fix initial link status of slave
On Fortville NIC, link status change interrupt callback is not executed when
slave in bonding is (re-)started. It causes that slave's NIC is inactive even
if its link status is up on the start.

This patch invokes lsc callback, just after port's start, to check its initial
link status and manage properly.

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2015-06-29 00:30:55 +02:00
Wenzhuo Lu
0b00ab6f16 ixgbe/base: optimize link up time
This patch adds max_link_up_time parameter to mac structure.
This parameter is used to control maximum link polling time in
ixgbe_check_mac_link functions. It is required to prevent long wait
time on x550 PHY that have no external link.

Since x550 is handled by software, we have to reset internal (PHY to
PHY) link when external link changes, and after reset, we have to wait for
this link to be established. As a result of not having interrupts, we have
to poll for link state, and we know that this link comes up much faster
than default 9 seconds. This parameter is added to prevent waiting 9
seconds for link when external link is not established.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:59:05 +02:00
Wenzhuo Lu
84f86ed5c4 ixgbe/base: add a new 82599 device id
Since this 82599 device supports WoL(Wake on LAN), driver needs
a define for the sub device ID.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:59:05 +02:00
Wenzhuo Lu
58ddc803e4 ixgbe/base: add new X550 PHY ids
This patch adds support for new x550 PHY IDs:
0x0154 0x0223
0x0154 0x0221

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:59:05 +02:00
Wenzhuo Lu
c20290b383 ixgbe/base: add new mac-dependent values for X540 and X550
Add new values that vary by MAC type that are introduced in
x540, x550.
And remove some meaningless comments BTW.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:59:05 +02:00
Wenzhuo Lu
201c9139e5 ixgbe/base: rework mac-type-dependent constants
Add a const u32 *mvals pointer to the ixgbe_hw struct to point to an
array of mac-type-dependent values. These can include register
offsets, masks, whatever can be in a u32. When the ixgbe_hw struct
is initialized, a pointer to the appropriate array must be set.

The IXGBE_I2CCTL register references are changed to use it.
Use the mvals array to hold differing values used for
IXGBE_I2C_* symbols.
Use the mvals array to hold differing values used for
IXGBE_*_GPI* symbols.
Use the mvals array to hold differing values use for CIAA and
CIAD symbols.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:59:05 +02:00
Wenzhuo Lu
da431fd14d ixgbe/base: fix X550em CS4227 speed mode
According to the hardware, the LINE side of the cs4227 needs to be
set to 10 Gbps SR mode regardless of the configuration of the link.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:59:05 +02:00
Wenzhuo Lu
54091e5520 ixgbe/base: fix X550em flow control to be KR only
The code in the if statement is specific to the KR PHY. However,
the conditional was only checking for backplane. If the driver
was using the KX4 backplane PHY, this code would execute but
would write to the wrong PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:59:05 +02:00
Wenzhuo Lu
56ff555028 ixgbe/base: disable software LPLU implementation for X557 V2
This patch disables SW LPLU on x557 V2. It also sets the
enter_lplu function pointer to NULL on x557 V2. LPLU will be
implemented in FW for all x557 V2 interfaces. The SW LPLU
implementation must be disabled on V2 to avoid conflicts with
FW. SW LPLU support is still required for x557 V1.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:05 +02:00
Wenzhuo Lu
862639fd2f ixgbe/base: add X557 PHY LEDs support
This patch implements ixgbe_led_on_t_X550em and ixgbe_led_off_t_X550em
function for turning on and off LEDs on X557 external PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:05 +02:00
Wenzhuo Lu
08f941e925 ixgbe/base: configure MDIO clock for X550em
The MDIO clock needs to be configured for a specific speed for
x550em. We expected this to be done automatically, but in
the early days of the project this was not happening. We put
code in to do this ourselves.
Eventually, we decided that there is no harm in having SW do
this all the time, so we may not remove this code in the future.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:05 +02:00