dpdk.git
8 years agombuf: use reserved space for double vlan
Helin Zhang [Thu, 11 Jun 2015 07:03:55 +0000 (15:03 +0800)]
mbuf: use reserved space for double vlan

Use the reserved 16 bits in rte_mbuf structure for the outer vlan,
also add QinQ offloading flags for both RX and TX sides.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agoixgbe: remove a discarded source line
Helin Zhang [Thu, 11 Jun 2015 07:03:54 +0000 (15:03 +0800)]
ixgbe: remove a discarded source line

Little endian to CPU order conversion had been added for reading
vlan tag from RX descriptor, while its original source line was
forgotten to delete. That's a discarded source line and should be
deleted.

Fixes: 23fcffe8ffac ("ixgbe: fix id and hash with flow director")

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agoethdev: fix check of threshold for Tx freeing
Zoltan Kiss [Tue, 23 Jun 2015 18:43:12 +0000 (19:43 +0100)]
ethdev: fix check of threshold for Tx freeing

The parameter tx_free_thresh is not consistent between the drivers:
some use it as rte_eth_tx_burst() requires, some release buffers when
the number of free descriptors drop below this value.
Let's use it as most fast-path code does, which is the latter, and update
comments throughout the code to reflect that.

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoixgbe: check mbuf refcnt when clearing a ring
Bruce Richardson [Fri, 3 Jul 2015 15:40:06 +0000 (16:40 +0100)]
ixgbe: check mbuf refcnt when clearing a ring

The function to clear the TX ring when a port was being closed, e.g. on
exit in testpmd, was not checking the mbuf refcnt before freeing it.
Since the function in the vector driver to clear the ring after TX does
not set the pointer to NULL post-free, this caused crashes if mbuf
debugging was turned on.

To reproduce the issue, ensure the follow config variables are set:
RTE_IXGBE_INC_VECTOR
RTE_LIBRTE_MBUF_DEBUG
Then compile up and run testpmd using 10G ports with the vector driver.
Start traffic and let some flow through, then type "stop" and "quit" at
the testpmd prompt, and crash will occur. Output below:

testpmd> quit
Stopping port 0...done
Stopping port 1...PANIC in rte_mbuf_sanity_check():
bad ref cnt
[New Thread 0x7fffabfff700 (LWP 145312)]
[New Thread 0x7fffb47fe700 (LWP 145311)]
[New Thread 0x7fffb4fff700 (LWP 145310)]
[New Thread 0x7ffff6cd5700 (LWP 145309)]
18: [/home/bruce/dpdk.org/x86_64-native-linuxapp-gcc/app/testpmd(_start+0x29)
<....snip for brevity...>
Program received signal SIGABRT, Aborted.
0x00007ffff7120a98 in raise () from /lib64/libc.so.6

A similar error occurs when clearing the RX ring, which is also fixed by
this patch.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoixgbe: use cold attribute
Bruce Richardson [Fri, 3 Jul 2015 15:40:05 +0000 (16:40 +0100)]
ixgbe: use cold attribute

As well as the fast-path functions in the rxtx code, there are also
functions which set up and tear down the descriptor rings. Since these
are not performance critical functions, there is no need to have them
extensively optimized, so we add __attribute__((cold)) to their
definitions. This has the side-effect of making debugging them easier as
the compiler does not optimize them as heavily, so more variables are
accessible by default in gdb.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agodoc: fix sphinx build warning
John McNamara [Thu, 2 Jul 2015 14:15:22 +0000 (15:15 +0100)]
doc: fix sphinx build warning

Fix for a minor Sphinx build warning in the ABI guidelines docs:

    versioning.rst:126: WARNING: Bullet list ends without a
                        blank line; unexpected unindent.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
8 years agomk: print target when reporting build complete
Bruce Richardson [Thu, 2 Jul 2015 10:35:37 +0000 (11:35 +0100)]
mk: print target when reporting build complete

When a target is finished building, it reports just "Build complete".
When building multiple targets simultaneously, e.g.
make install T=x86_64-native-linuxapp-*
and one target fails, it's not always obvious which of the builds
failed. To help this, we add the actual target that is completed to the
"Build complete" message.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoethdev: introduce valid port helper
Stephen Hemminger [Sat, 27 Jun 2015 00:01:45 +0000 (17:01 -0700)]
ethdev: introduce valid port helper

The code pattern is repeated so many times, it is a good
idea to introduce template like other code here uses.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoethdev: fix code style
Stephen Hemminger [Sat, 27 Jun 2015 00:01:44 +0000 (17:01 -0700)]
ethdev: fix code style

This fixes lots of complaints from checkpatch about whitespace
and other non-material things. Important to fix the old code now
befor more code does copy/paste of same junk.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agoethdev: fix comment spelling
Stephen Hemminger [Sat, 27 Jun 2015 00:01:43 +0000 (17:01 -0700)]
ethdev: fix comment spelling

Fix trivial spelling errors.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoethdev: remove impossible condition
Stephen Hemminger [Sat, 27 Jun 2015 00:01:42 +0000 (17:01 -0700)]
ethdev: remove impossible condition

Since rte_eth_devices is in BSS, the address of rte_eth_devices
plus port_id can not ever be NULL for a valid port_id number.
Remove this unnecessary check and fix the code style.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agomaintainers: claim EAL of IBM POWER
Chao Zhu [Mon, 29 Jun 2015 03:08:00 +0000 (11:08 +0800)]
maintainers: claim EAL of IBM POWER

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agocfgfile: fix unitialised buffer
Daniel Mrzyglod [Mon, 29 Jun 2015 15:06:03 +0000 (17:06 +0200)]
cfgfile: fix unitialised buffer

Nature of the problem was not initialised buffer[256], there were probability
that operation system will provide previously used memory and on special condition
there were probability that string operations will work on random data that
could provide unexpected program behaviour.

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agohash: add unit test for thash
Vladimir Medvedkin [Tue, 30 Jun 2015 23:41:13 +0000 (19:41 -0400)]
hash: add unit test for thash

Add unit test for thash library

Signed-off-by: Vladimir Medvedkin <medvedkinv@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agohash: add toeplitz algorithm used by RSS
Vladimir Medvedkin [Tue, 30 Jun 2015 23:40:20 +0000 (19:40 -0400)]
hash: add toeplitz algorithm used by RSS

Software implementation of the Toeplitz hash function used by RSS.
Can be used either for packet distribution on single queue NIC
or for simulating of RSS computation on specific NIC (for example
after GRE header decapsulating).

Signed-off-by: Vladimir Medvedkin <medvedkinv@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agohash: add missing symbol in version map
Pablo de Lara [Tue, 30 Jun 2015 18:37:11 +0000 (19:37 +0100)]
hash: add missing symbol in version map

rte_hash_hash is a public function but was not in
rte_hash_version.map

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
8 years agocxgbe: fix build with icc
Bruce Richardson [Wed, 1 Jul 2015 15:11:37 +0000 (16:11 +0100)]
cxgbe: fix build with icc

When compiling the cxgbe driver with icc, multiple errors about using
enums as integers appear across a number of files, including in the base
code and in the DPDK-specific driver code.

.../drivers/net/cxgbe/cxgbe_main.c(386): error #188: enumerated type mixed
with another type
                        t4_get_port_type_description(pi->port_type));
                                                     ^
For the errors in the base driver code we use the CFLAGS_BASE_DRIVER
approach used by other drivers to disable warnings.

For errors in the DPDK-specific code, typecasts are used to fix the
errors in the code itself.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agofm10k: support Xen domain0
Shaopeng He [Fri, 15 May 2015 08:56:02 +0000 (16:56 +0800)]
fm10k: support Xen domain0

fm10k was failing to run in XEN domain0, as the physical
memory for DMA should be allocated and translated
in a different way for XEN domain0. So
rte_memzone_reserve_bounded() should be used for DMA
memory allocation, and rte_mem_phy2mch() should be used
for DMA memory address translation to support running
fm10k PMD in XEN domain0.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
8 years agomlx4: update documentation for MOFED 3.0
Adrien Mazarguil [Tue, 30 Jun 2015 09:28:09 +0000 (11:28 +0200)]
mlx4: update documentation for MOFED 3.0

- Add RX/TX L3/L4 checksum offloading and validation.
- Update kernel module parameters section.
- Update prerequisites for MOFED and firmware versions.
- Remove optimized external libraries section. MOFED now provides enhanced
  support directly without having to install modified libraries.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx4: disable multicast echo on PF device
Olga Shern [Tue, 30 Jun 2015 09:28:08 +0000 (11:28 +0200)]
mlx4: disable multicast echo on PF device

Multicast loopback must be disabled on PF devices to prevent the adapter
from sending frames back. Required with MOFED 3.0.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx4: add resource domain support for better performance
Alex Rosenbaum [Tue, 30 Jun 2015 09:28:07 +0000 (11:28 +0200)]
mlx4: add resource domain support for better performance

RDs are a new feature of MOFED 3.0 that makes Verbs aware of how CQ and QP
resources are being used for internal performance tuning.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx4: add VXLAN checksum offload
Adrien Mazarguil [Tue, 30 Jun 2015 09:28:06 +0000 (11:28 +0200)]
mlx4: add VXLAN checksum offload

Depending on adapters features and VXLAN support in the kernel, VXLAN frames
can be automatically recognized, in which case checksum validation and
generation occurs on inner and outer L3 and L4.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx4: add L3/L4 checksum offload
Gilad Berman [Tue, 30 Jun 2015 09:28:05 +0000 (11:28 +0200)]
mlx4: add L3/L4 checksum offload

Mellanox ConnectX-3 adapters can handle L3 (IPv4) and L4 (TCP, UDP, TCP6,
UDP6) RX checksums validation and TX checksums generation, with and without
802.1Q (VLAN) headers.

Signed-off-by: Gilad Berman <giladb@mellanox.com>
Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx4: prefetch completed Tx mbufs before releasing them
Alex Rosenbaum [Tue, 30 Jun 2015 09:28:04 +0000 (11:28 +0200)]
mlx4: prefetch completed Tx mbufs before releasing them

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx4: shrink Tx queue elements for better performance
Alex Rosenbaum [Tue, 30 Jun 2015 09:28:03 +0000 (11:28 +0200)]
mlx4: shrink Tx queue elements for better performance

TX queue elements (struct txq_elt) contain WR and SGE structures required by
ibv_post_send(). This commit replaces them with a single pointer to the
related TX mbuf considering that:

- There is no need to keep these structures around forever since the
  hardware doesn't access them after ibv_post_send() and send_pending*()
  have returned.

- The TX queue index stored in the WR ID field is not used for completions
  anymore since they use a separate counter (elts_comp_cd).

- The WR structure itself was only useful for ibv_post_send(), it is
  currently only used to store the mbuf data address and an offset to the
  mbuf structure in the WR ID field. send_pending*() callbacks only require
  SGEs or buffer pointers.

Therefore for single segment mbufs, send_pending() or send_pending_inline()
can be used directly without involving SGEs. For scattered mbufs, SGEs are
allocated on the stack and passed to send_pending_sg_list().

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx4: move scattered Tx processing to helper function
Adrien Mazarguil [Tue, 30 Jun 2015 09:28:02 +0000 (11:28 +0200)]
mlx4: move scattered Tx processing to helper function

This commit makes scattered TX support entirely optional by moving it to a
separate function that is only available when MLX4_PMD_SGE_WR_N > 1.

Improves performance when scattered support is not needed.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx4: use MOFED 3.0 fast verbs interface for Tx operations
Adrien Mazarguil [Tue, 30 Jun 2015 09:28:01 +0000 (11:28 +0200)]
mlx4: use MOFED 3.0 fast verbs interface for Tx operations

The "raw" post send interface was experimental and has been deprecated. This
commit replaces it with a new low level interface that dissociates post and
flush (doorbell) operations for improved QP performance.

The CQ polling function is updated as well.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx4: avoid requesting Tx completion events to improve performance
Alex Rosenbaum [Tue, 30 Jun 2015 09:28:00 +0000 (11:28 +0200)]
mlx4: avoid requesting Tx completion events to improve performance

Instead of requesting a completion event for each TX burst, request it on a
fixed schedule once every MLX4_PMD_TX_PER_COMP_REQ (currently 64) packets to
improve performance.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx4: use MOFED 3.0 fast verbs interface for Rx operations
Alex Rosenbaum [Tue, 30 Jun 2015 09:27:59 +0000 (11:27 +0200)]
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>
8 years agomlx4: query netdevice to get initial MAC address
Or Ami [Tue, 30 Jun 2015 09:27:58 +0000 (11:27 +0200)]
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>
8 years agomlx4: fix support for multiple vlan filters
Olga Shern [Tue, 30 Jun 2015 09:27:57 +0000 (11:27 +0200)]
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>
8 years agomlx4: remove provision for flow creation failure in DMFS A0 mode
Or Ami [Tue, 30 Jun 2015 09:27:56 +0000 (11:27 +0200)]
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>
8 years agomlx4: fix error message for invalid number of descriptors
Or Ami [Tue, 30 Jun 2015 09:27:55 +0000 (11:27 +0200)]
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>
8 years agomlx4: use MOFED 3.0 extended flow steering API
Alex Rosenbaum [Tue, 30 Jun 2015 09:27:54 +0000 (11:27 +0200)]
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>
8 years agomlx4: improve accuracy of link status information
Olga Shern [Tue, 30 Jun 2015 09:27:53 +0000 (11:27 +0200)]
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>
8 years agomlx4: allow application to partially fork
Olga Shern [Tue, 30 Jun 2015 09:27:52 +0000 (11:27 +0200)]
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>
8 years agomlx4: merge Rx queue setup functions
Alex Rosenbaum [Tue, 30 Jun 2015 09:27:51 +0000 (11:27 +0200)]
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>
8 years agomlx4: avoid looking up work request id to improve Rx performance
Alex Rosenbaum [Tue, 30 Jun 2015 09:27:50 +0000 (11:27 +0200)]
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>
8 years agomlx4: make sure experimental device query is implemented
Olga Shern [Tue, 30 Jun 2015 09:27:49 +0000 (11:27 +0200)]
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>
8 years agomlx4: add MOFED 3.0 compatibility to interface name retrieval
Adrien Mazarguil [Tue, 30 Jun 2015 09:27:48 +0000 (11:27 +0200)]
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>
8 years agomlx4: fix possible crash on scattered mbuf allocation failure
Adrien Mazarguil [Tue, 30 Jun 2015 09:27:47 +0000 (11:27 +0200)]
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>
8 years agocxgbe: fix build with clang
Thomas Monjalon [Tue, 30 Jun 2015 22:14:25 +0000 (00:14 +0200)]
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>
8 years agocxgbe: add documentation
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:42 +0000 (04:58 +0530)]
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>
8 years agocxgbe: add flow control functions
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:41 +0000 (04:58 +0530)]
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>
8 years agocxgbe: add link related functions
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:40 +0000 (04:58 +0530)]
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>
8 years agocxgbe: add port statistics
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:39 +0000 (04:58 +0530)]
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>
8 years agocxgbe: add device related operations
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:38 +0000 (04:58 +0530)]
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>
8 years agocxgbe: add Tx support
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:37 +0000 (04:58 +0530)]
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>
8 years agocxgbe: add device configuration and Rx support
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:36 +0000 (04:58 +0530)]
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>
8 years agocxgbe: add pmd skeleton
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:35 +0000 (04:58 +0530)]
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]

8 years agocxgbe/base: add hardware API for Chelsio T5 series adapters
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:34 +0000 (04:58 +0530)]
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>
8 years agovhost: comment unwanted callback
Huawei Xie [Tue, 30 Jun 2015 09:20:50 +0000 (17:20 +0800)]
vhost: comment unwanted callback

add comment for potential unwanted callback on listenfds

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
8 years agovhost: cleanup unix socket
Huawei Xie [Tue, 30 Jun 2015 09:20:48 +0000 (17:20 +0800)]
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>
8 years agovhost: fix race for connection fd
Huawei Xie [Tue, 30 Jun 2015 09:20:47 +0000 (17:20 +0800)]
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>
8 years agovhost: turn on by default
Huawei Xie [Mon, 29 Jun 2015 15:58:53 +0000 (23:58 +0800)]
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>
8 years agovhost: realloc device and queues to same numa node as vring desc
Huawei Xie [Thu, 25 Jun 2015 05:47:37 +0000 (13:47 +0800)]
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>
8 years agovhost: use rte_malloc to allocate device and queues
Huawei Xie [Thu, 25 Jun 2015 05:47:36 +0000 (13:47 +0800)]
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>
8 years agolib: remove redundant definition of local symbols
Thomas Monjalon [Mon, 29 Jun 2015 16:25:13 +0000 (18:25 +0200)]
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>
8 years agodoc: link ABI policy to release notes
Thomas Monjalon [Mon, 29 Jun 2015 14:58:09 +0000 (16:58 +0200)]
doc: link ABI policy to release notes

When moving ABI policy to guidelines, the new doc was referred
without using sphinx link.

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

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agodoc: add ABI guidelines
Neil Horman [Mon, 29 Jun 2015 13:59:40 +0000 (09:59 -0400)]
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>
8 years agocompat: remove unneeded macro
Neil Horman [Mon, 29 Jun 2015 13:59:39 +0000 (09:59 -0400)]
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>
8 years agocompat: add macro to map symbol in static build
Neil Horman [Mon, 29 Jun 2015 13:59:38 +0000 (09:59 -0400)]
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>
8 years agocompat: clean up
Neil Horman [Mon, 29 Jun 2015 13:59:37 +0000 (09:59 -0400)]
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>
8 years agomk: fix static build on Fedora 22
Bruce Richardson [Tue, 9 Jun 2015 12:51:01 +0000 (13:51 +0100)]
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>
8 years agoeal: fix pedantic build of mlx4 debug mode
Adrien Mazarguil [Mon, 29 Jun 2015 09:34:52 +0000 (11:34 +0200)]
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: ba7468997ea6 ("spinlock: add HTM lock elision for x86")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
8 years agobonding: initialize backpointer from pci device to driver
Stephen Hemminger [Fri, 8 May 2015 02:41:12 +0000 (19:41 -0700)]
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>
8 years agobonding: fix crash when stopping inactive slave
Jan Blunck [Wed, 24 Jun 2015 21:01:23 +0000 (14:01 -0700)]
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>
8 years agobonding: fix initial link status of slave
Tomasz Kulasek [Wed, 24 Jun 2015 08:50:45 +0000 (10:50 +0200)]
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>
8 years agoixgbe/base: optimize link up time
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:25 +0000 (11:26 +0800)]
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>
8 years agoixgbe/base: add a new 82599 device id
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:02 +0000 (11:26 +0800)]
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>
8 years agoixgbe/base: add new X550 PHY ids
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:26 +0000 (11:26 +0800)]
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>
8 years agoixgbe/base: add new mac-dependent values for X540 and X550
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:17 +0000 (11:26 +0800)]
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>
8 years agoixgbe/base: rework mac-type-dependent constants
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:13 +0000 (11:26 +0800)]
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>
8 years agoixgbe/base: fix X550em CS4227 speed mode
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:24 +0000 (11:26 +0800)]
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>
8 years agoixgbe/base: fix X550em flow control to be KR only
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:22 +0000 (11:26 +0800)]
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>
8 years agoixgbe/base: disable software LPLU implementation for X557 V2
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:18 +0000 (11:26 +0800)]
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>
8 years agoixgbe/base: add X557 PHY LEDs support
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:11 +0000 (11:26 +0800)]
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>
8 years agoixgbe/base: configure MDIO clock for X550em
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:10 +0000 (11:26 +0800)]
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>
8 years agoixgbe/base: check X550em link again after getting speed
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:09 +0000 (11:26 +0800)]
ixgbe/base: check X550em link again after getting speed

Ensure link is still up after getting the speed, to ensure that the
speed read is valid.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: remove FEC disablement for X550em
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:19 +0000 (11:26 +0800)]
ixgbe/base: remove FEC disablement for X550em

This patch removes the clearing of the FEC(Forward Error Correction)
bits in ixgbe_setup_kr_speed_x550em.  FEC default enablement is
configured via the NVM and SW should not be overriding these defaults
in this function.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: add X550em KR/iXFI internal link mode support
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:08 +0000 (11:26 +0800)]
ixgbe/base: add X550em KR/iXFI internal link mode support

This patch adds support for x550em KR/iXFI internal link modes. The initial
x550em-10GBASET and x550em-SFP designs use iXFI internal link mode between
the internal PHY and the external PHY.
However future designs will use a KR internal link. This patch is intended
to future proof the driver by adding the KR internal link support in the
driver now.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: update EEE/FEC support for X550EM_X_KR
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:12 +0000 (11:26 +0800)]
ixgbe/base: update EEE/FEC support for X550EM_X_KR

EEE(Energy Efficient Ethernet) is not supported on the initial revision
of IXGBE_DEV_ID_X550EM_X_KR. We determine the revision by reading a fuse
register.

Also, the requirements for FEC(Forward Error Correction) have changed
slightly. Now, we don't change the "request" bit at all. When EEE is
enabled, we advertise that we are capable. When EEE is disabled, we do
not advertise that we are capable. This change makes us consistent with
the power-on defaults that are in the NVM.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: enable X550 FEC when EEE is disabled
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:03 +0000 (11:26 +0800)]
ixgbe/base: enable X550 FEC when EEE is disabled

The FEC(Forward Error Correction) feature had been disabled
because it increases power consumption. However, some customers
want to use it. This patch enables FEC when EEE(Energy Efficient
Ethernet) is disabled; FEC was already being disabled when EEE
was enabled, but now both are done in the same function. The two
features are not allowed to be enabled at the same time. The two
features cannot both be disabled. If this ability is ever
determined to be needed, we will need to define a new user parameter
to control FEC independently of EEE.

Fixes: d4c9ffd4fe1c ("ixgbe/base: disable X550em FEC to save power")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: check for functional CS4227 ucode
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:07 +0000 (11:26 +0800)]
ixgbe/base: check for functional CS4227 ucode

During init, check the ucode running in the CS4227. If
it is not responding correctly, reset the part. This is
a global reset so it must only be done the first time a
driver loads after power-on.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: use a semaphore to serialize X550 IOSF accesses
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:06 +0000 (11:26 +0800)]
ixgbe/base: use a semaphore to serialize X550 IOSF accesses

Because each IOSF access requires the use of multiple registers,
use a semaphore to serialize those accesses.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: add wait helper for X550 IOSF accesses
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:05 +0000 (11:26 +0800)]
ixgbe/base: add wait helper for X550 IOSF accesses

Add a helper function to wait for IOSF accesses to complete. Also
perform this wait before each access, as specified in the datasheet.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: add macros for X550em bus speed fuse
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:01 +0000 (11:26 +0800)]
ixgbe/base: add macros for X550em bus speed fuse

x550em has two different bus speeds, 300 MHz and 400 MHz.
A bit in a fuse register tells which it is, with a 1 meaning
the bus is running at 300 MHz.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: fix X550em UniPHY link configuration
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:00 +0000 (11:26 +0800)]
ixgbe/base: fix X550em UniPHY link configuration

In UniPHY we have 2 IOSF targets that are UniPHY related. We can
write to PHY and PCS. In earlier times I've been told that there
were 2 separate PCS targets for IOSF commands and that's why I
implemented it with 2 defines and adding hw->bus.lan_id, but lately
I confirmed with HW that FW takes care of which PCS "slice" we are
talking to and is directing writes to correct one, so KX4_PCS1
target is dead now and we cannot use it.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: power down the X550em PHY on overtemp event
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:58 +0000 (11:25 +0800)]
ixgbe/base: power down the X550em PHY on overtemp event

This patch powers down the x550em PHY on over-temp events. The
PHY firmware is supposed to do this autonomously but that isn't
implemented. The short-term stop-gap solution is for SW to power
down the PHY when it reports an overtemp event.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: check X550em SFP support
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:55 +0000 (11:25 +0800)]
ixgbe/base: check X550em SFP support

This patch adds identify SFP module support for x550em. x550em
support returns an error for SFP module types not supported by
x550em design.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: fix X550em link setup without SFP
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:53 +0000 (11:25 +0800)]
ixgbe/base: fix X550em link setup without SFP

This patch updates the x550em SFP link setup by adding
ixgbe_sfp_type_unknown and ixgbe_sfp_type_not_present case expression
to the ixgbe_setup_mac_link_sfp_x550em SFP type switch statement. This
handles the case when no module is present.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: fix uninitialized variable
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:56 +0000 (11:25 +0800)]
ixgbe/base: fix uninitialized variable

Fix the warning caused by an uninitialized variable which might have
been used.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: fix X550em SFP+ link stability
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:52 +0000 (11:25 +0800)]
ixgbe/base: fix X550em SFP+ link stability

Configure the CS4227 correctly for both 1G and 10G operation,
by moving the code to ixgbe_setup_mac_link_sfp_x550em(). It
needs to be in this function because we need both the module
type and the speed, and this is the only function in the init
flow that knows the speed. In contrast,
ixgbe_setup_sfp_modules_X550em() does not know the speed, so we
can't do anything useful here. This is a fundamental difference
from the 82599 flow.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: restore advertised autoneg after setting X550em LPLU
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:59 +0000 (11:25 +0800)]
ixgbe/base: restore advertised autoneg after setting X550em LPLU

On systems that support LPLU in the firmware, the driver wouldn't be
aware of the LPLU speed change, and it wouldn't cache the new value when
the driver resumes. This patch emulates the same behavior by restoring
the previous autoneg settings to autoneg_advertised.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: update X550em LPLU
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:51 +0000 (11:25 +0800)]
ixgbe/base: update X550em LPLU

This patch updates x550em LPLU (Low Power Link Up) to use the
MAC ops setup_link function pointer.
This removes redundant code and provides iXFI and KR support
between internal and external PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: release X540 semaphores in proper order
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:04 +0000 (11:26 +0800)]
ixgbe/base: release X540 semaphores in proper order

Because we acquire two semaphore bits before setting the SWFW_SYNC
register, we should release them in the reverse order that they
were acquired.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: fix X550 PCIe master disabling
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:21 +0000 (11:26 +0800)]
ixgbe/base: fix X550 PCIe master disabling

This patch skips the PCI transactions pending check in
ixgbe_disable_pcie_master. The PCI transactions pending bit sticks high
when there were pending transactions, we should wait and then continue
with our reset flow.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: fix speed comments
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:23 +0000 (11:26 +0800)]
ixgbe/base: fix speed comments

This patch fixes comment description for setting 2.5G and 5G speeds in
ixgbe_setup_phy_link_generic.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: add a shift constant for EEE
Wenzhuo Lu [Wed, 24 Jun 2015 03:25:54 +0000 (11:25 +0800)]
ixgbe/base: add a shift constant for EEE

Adds define for the number of bits needed to shift the EEE_SU register
in order to get the value of TEEE_DLY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe/base: change register definition code style
Wenzhuo Lu [Wed, 24 Jun 2015 03:26:20 +0000 (11:26 +0800)]
ixgbe/base: change register definition code style

This path changes ((P == 0) ? (<value for port 0>) : (<value for port 1>))
register definition into ((P) ? <value for port 1> : <value for port 0>)
style.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>