Huawei Xie [Thu, 10 Dec 2015 16:07:32 +0000 (00:07 +0800)]
virtio: fix descriptors pointing to the same buffer
The virtio_net_hdr desc all pointed to the same buffer. It doesn't cause
issue because in the simple TX mode we don't use the header. This patch
makes the header desc point to different buffer.
Fixes:
b4ae9c505f2e ("virtio: optimize ring layout")
Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Bernard Iremonger [Wed, 23 Dec 2015 09:45:19 +0000 (09:45 +0000)]
virtio: fix crash in statistics functions
This initialisation of nb_rx_queues and nb_tx_queues has been removed
from eth_virtio_dev_init.
The nb_rx_queues and nb_tx_queues were being initialised in
eth_virtio_dev_init before the tx_queues and rx_queues arrays were
allocated.
The arrays are allocated when the ethdev port is configured and the
nb_tx_queues and nb_rx_queues are initialised.
If any of the following functions were called before the ethdev
port was configured there was a segmentation fault because
rx_queues and tx_queues were NULL:
rte_eth_stats_get
rte_eth_stats_reset
rte_eth_xstats_get
rte_eth_xstats_reset
Fixes:
823ad647950a ("virtio: support multiple queues")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Jianfeng Tan [Mon, 11 Jan 2016 06:16:13 +0000 (14:16 +0800)]
virtio: fix restart
Fix the issue that virtio device cannot be started after stopped.
The field, hw->started, should be changed by virtio_dev_start/stop instead
of virtio_dev_close.
Fixes:
a85786dc816f ("virtio: fix states handling during initialization")
Reported-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Matej Vido [Thu, 28 Jan 2016 22:23:48 +0000 (23:23 +0100)]
szedata2: support promiscuous and allmulticast modes
add functions for enabling/disabling promiscuous, allmulticast modes
Signed-off-by: Matej Vido <vido@cesnet.cz>
Matej Vido [Thu, 28 Jan 2016 22:23:47 +0000 (23:23 +0100)]
szedata2: support link state operations
Mmap PCI resource file and add inline functions for reading from and
writing to PCI resource address space.
Add description of IBUF and OBUF address space.
Add configuration option for setting which firmware type will be used.
Right address space values for IBUFs and OBUFs offsets are used
according to configuration option CONFIG_RTE_LIBRTE_PMD_SZEDATA2_AS.
Setting link up/down and getting info about link status is done through
mmapped PCI resource address space.
Signed-off-by: Matej Vido <vido@cesnet.cz>
Matej Vido [Thu, 28 Jan 2016 22:23:46 +0000 (23:23 +0100)]
szedata2: change to physical device type
PMD was of type PMD_VDEV which means that PCI device is not recognised
automatically during EAL initialization, but it has to be created by
EAL option --vdev.
Now, PMD is of type PMD_PDEV which means that PCI device is probed
and recognised during EAL initialization automatically.
Path to szedata2 device file is matched with device and the count
of available RX and TX DMA channels is found out during device
initialization.
Initialization, starting and stopping of queues is changed to better
correspond with Ethernet device API model. Function callbacks
(rx|tx)_queue_(start|stop) are added. Unnecessary items are removed
from ethernet device private data structure.
Signed-off-by: Matej Vido <vido@cesnet.cz>
Alejandro Lucero [Mon, 14 Mar 2016 10:39:04 +0000 (10:39 +0000)]
nfp: fix Tx queue reset
When using start-stop functionality the per queue fields need to
be properly reset.
Fixes:
b812daadad0d ("nfp: add Rx and Tx")
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Alejandro Lucero [Thu, 3 Mar 2016 11:26:07 +0000 (11:26 +0000)]
nfp: fix how Tx checksum is advertised to firmware
Even with tx checksum offload available, do not set the flag by default.
Fixes:
b812daadad0d ("nfp: add Rx and Tx")
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Alejandro Lucero [Thu, 3 Mar 2016 11:05:52 +0000 (11:05 +0000)]
nfp: fix variable type in Tx checksum offload
The mbuf ol_flags field was changed to uin64_t with DPDK version 1.8
Fixes:
b812daadad0d ("nfp: add Rx and Tx")
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Thomas Monjalon [Sat, 6 Feb 2016 21:51:16 +0000 (22:51 +0100)]
nfp: fix non-x86 build
The file sys/io.h was included but it can be unavailable in some
non-x86 toolchains.
As others system includes in the file nfp_net.c, it seems useless,
so the easy fix is to remove them.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Yaacov Hazan [Thu, 3 Mar 2016 14:27:39 +0000 (15:27 +0100)]
mlx5: fix Rx checksum offload in non L3/L4 packets
Change rxq_cq_to_ol_flags() to set checksum flags according to packet type,
so for non L3/L4 packets the mbuf chksum_bad flags will not be set.
Fixes:
67fa62bc672d ("mlx5: support checksum offload")
Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Adrien Mazarguil [Thu, 3 Mar 2016 14:27:38 +0000 (15:27 +0100)]
mlx5: add VLAN filtering for broadcast and IPv6 multicast
Unlike promiscuous and allmulticast flows, those should remain
VLAN-specific.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Adrien Mazarguil [Thu, 3 Mar 2016 14:27:37 +0000 (15:27 +0100)]
mlx5: remove redundant debug message
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Adrien Mazarguil [Thu, 3 Mar 2016 14:27:36 +0000 (15:27 +0100)]
mlx5: manage all special flow types at once
This commit adds helpers to remove redundant code.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Or Ami [Thu, 3 Mar 2016 14:27:35 +0000 (15:27 +0100)]
mlx5: check port is configured as ethernet device
If the port link layer is not Ethernet, notify the user.
Signed-off-by: Or Ami <ora@mellanox.com>
Or Ami [Thu, 3 Mar 2016 14:27:34 +0000 (15:27 +0100)]
mlx5: fix possible crash during initialization
RSS configuration should not be freed when priv is NULL.
Fixes:
2f97422e7759 ("mlx5: support RSS hash update and get")
Signed-off-by: Or Ami <ora@mellanox.com>
Adrien Mazarguil [Thu, 3 Mar 2016 14:27:17 +0000 (15:27 +0100)]
mlx: use aligned memory to register regions
The first and last memory pool elements are usually cache-aligned but not
page-aligned, particularly when using huge pages.
Hardware performance can be improved significantly by registering memory
regions starting and ending on page boundaries.
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Nelio Laranjeiro [Thu, 3 Mar 2016 14:27:16 +0000 (15:27 +0100)]
mlx5: free buffers immediately after completion
This lowers the amount of cache misses.
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Nelio Laranjeiro [Thu, 3 Mar 2016 14:27:15 +0000 (15:27 +0100)]
mlx5: avoid lkey retrieval for inlined packets
Improves performance as the lkey is not needed by hardware in this case.
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Nelio Laranjeiro [Thu, 3 Mar 2016 14:27:14 +0000 (15:27 +0100)]
mlx5: process offload flags only when requested
Improve performance by processing offloads only when requested by the
application.
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Nelio Laranjeiro [Thu, 3 Mar 2016 14:27:13 +0000 (15:27 +0100)]
mlx5: remove one indirection level from Rx/Tx
Avoid dereferencing pointers twice to get to fast Verbs functions by
storing them directly in RX/TX queue structures.
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Nelio Laranjeiro [Thu, 3 Mar 2016 14:27:12 +0000 (15:27 +0100)]
mlx5: reorder Rx/Tx queue structure
Remove padding and move important fields to the beginning for better
performance.
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Nelio Laranjeiro [Thu, 3 Mar 2016 14:27:11 +0000 (15:27 +0100)]
mlx5: prefetch next Tx mbuf header and data
This change improves performance noticeably.
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Yaacov Hazan [Thu, 3 Mar 2016 14:26:44 +0000 (15:26 +0100)]
mlx5: support Rx VLAN stripping
Allows HW to strip the 802.1Q header from incoming frames and report it
through the mbuf structure.
This feature requires MLNX_OFED >= 3.2.
Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Yaacov Hazan [Thu, 3 Mar 2016 14:26:43 +0000 (15:26 +0100)]
mlx5: support flow director
Add support for flow director filters (RTE_FDIR_MODE_PERFECT and
RTE_FDIR_MODE_PERFECT_MAC_VLAN modes).
This feature requires MLNX_OFED >= 3.2.
Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Raslan Darawsheh <rdarawsheh@asaltech.com>
Yaacov Hazan [Thu, 3 Mar 2016 14:26:42 +0000 (15:26 +0100)]
mlx5: make flow steering rule generator more generic
Upcoming flow director support will reuse this function to generate filter
rules.
Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Yaacov Hazan [Thu, 3 Mar 2016 14:26:41 +0000 (15:26 +0100)]
mlx5: add special flows for broadcast and IPv6 multicast
Until now, broadcast frames were handled like unicast. Moving the related
flow to the special flows table frees up the related unicast MAC entry.
The same method is used to handle IPv6 multicast frames.
Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Yaacov Hazan [Thu, 3 Mar 2016 14:26:40 +0000 (15:26 +0100)]
mlx5: refactor special flows handling
Merge redundant code by adding a static initialization table to manage
promiscuous and allmulticast (special) flows.
New function priv_rehash_flows() implements the logic to enable/disable
relevant flows in one place from any context.
Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Adrien Mazarguil [Fri, 29 Jan 2016 10:31:36 +0000 (11:31 +0100)]
mlx5: fix header generation in parallel builds
Fixes:
771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
David Marchand [Tue, 5 Jan 2016 18:00:09 +0000 (19:00 +0100)]
mlx5: support setting primary MAC address
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
David Marchand [Tue, 5 Jan 2016 18:00:08 +0000 (19:00 +0100)]
mlx4: support setting primary MAC address
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Robin Jarry [Thu, 3 Mar 2016 14:27:40 +0000 (15:27 +0100)]
mlx4: ensure number of Rx queues is a power of 2
In the documentation it is specified that the hardware only supports a
number of RX queues if it is a power of 2.
Since ibv_exp_create_qp may not return an error when the number of
queues is unsupported by hardware, sanitize the value in dev_configure.
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
Bruce Richardson [Mon, 8 Feb 2016 22:11:49 +0000 (22:11 +0000)]
mlx4: fix unneeded function error with clang 3.6
When compiling with clang 3.6, the mlx4 driver gives the following error
message about an unneeded function.
CC mlx4.o
.../drivers/net/mlx4/mlx4.c:136:20: fatal error: function
'wr_id_t_check' is not needed and will not be emitted
[-Wunneeded-internal-declaration]
static inline void wr_id_t_check(void)
^
1 error generated.
The function is to compile-time check the size of wr_id_t, so use
the standard DPDK BUILD_BUG_ON macro to do so in the init function
instead.
Fixes:
7fae69eeff13 ("mlx4: new poll mode driver")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Xiao Wang [Wed, 2 Mar 2016 11:19:13 +0000 (19:19 +0800)]
fm10k: enable FTAG based forwarding
This patch enables reading sglort (global resource tag) info into the
mbuf for RX and inserting an FTAG (Fabric Tag) at the beginning of the
packet for TX. The vlan_tci_outer field selected from rte_mbuf structure
for sglort is not used in fm10k now.
In FTAG based forwarding mode, the switch will forward packets according
to glort info in FTAG rather than mac and vlan table.
To activate this feature, user needs to pass a devargs parameter to eal
for fm10k device like "-w 0000:84:00.0,enable_ftag=1". Currently this
feature is supported only on PF, because FM10K_PFVTCTL register is
read-only for VF.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:07:05 +0000 (19:07 +0800)]
fm10k/base: remove unused struct element
Remove the unused element request_lport_map in struct fm10k_mac_ops.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:07:04 +0000 (19:07 +0800)]
fm10k/base: minor cleanups
Some cleanups to better reflect the code that was actually pushed out to
the upstream Linux community.
Among the above cleanups, a few macros such as FM10K_RXINT_TIMER_SHIFT are
removed, but they are needed in dpdk/fm10k, so we have to put all these
necessary macros into fm10k_osdep.h.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:07:03 +0000 (19:07 +0800)]
fm10k/base: move constants on right of binary operators
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:07:02 +0000 (19:07 +0800)]
fm10k/base: fix TLV structures alignment
Per comments from an upstream kernel patch, and looking at how TLV
LE_STRUCT code works, we actually want these structures to be 4byte
aligned, not 1byte aligned.
In practice, 1byte alignment has worked so far because all our
structures end up being a multiple of 4. But if a future TLV
structure were added that had a u8 or similar sticking on the end things
would break. Fix this by using 4byte alignment which will prevent the
TLV LE_STRUCT code from breaking. Update the comment explaining that we
need 4byte alignment of our structures.
Fixes:
925c862cbc21 ("fm10k/base: pack TLV overlay structures")
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:07:01 +0000 (19:07 +0800)]
fm10k/base: improve comments
The comment for fm10k_iov_msg_lport_state_pf was changed during
review of kernel driver, and the new wording is slightly clearer.
Re-write the comment in base code based on this new wording.
Fix a number of mailbox comment issues with function header comments,
lower-case acronyms (i.e. FIFO, TLV), incorrect function names in
DEBUGFUNC(), duplicate comments and a stubbed-out header comment for
fm10k_sm_mbx_init.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:07:00 +0000 (19:07 +0800)]
fm10k/base: expand VID to VLAN ID in comments
The vid variable name is shorthand for VLAN ID, so we should use this in
comments explaining what is happening.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:06:59 +0000 (19:06 +0800)]
fm10k/base: allow removal of slot appropriate check
The Linux Kernel provides the OS a call "pcie_get_minimum_link" which
can crawl the PCIe tree and determine the actual minimum link speed of a
device which is a more general check than provided by
is_slot_appropriate. Thus, the kernel driver does not use or want the
is_slot_appropriate function call. Add a NO_IS_SLOT_APPROPRIATE_CHECK
definition which can be defined to remove the code.
If left undefined (the default) then the code will all be active and no
driver changes should be necessary.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:06:58 +0000 (19:06 +0800)]
fm10k/base: use memcpy for MAC address copy
Use memcpy instead of copying MAC address byte-by-byte.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:06:57 +0000 (19:06 +0800)]
fm10k/base: remove CamelCase
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:06:56 +0000 (19:06 +0800)]
fm10k/base: add bit macro
Using the BIT macro can simplify the bit-shifting operation and make the
code look clean. Similar to how this is handled in the i40e base code,
define a macro for it in DPDK, so it can be used here too.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:06:55 +0000 (19:06 +0800)]
fm10k/base: remove useless else
"else" is not generally useful after a break or return.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:06:54 +0000 (19:06 +0800)]
fm10k/base: wrap long lines
Recommended line length maximum is 80 characters
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:06:53 +0000 (19:06 +0800)]
fm10k/base: document ITR scale workaround
Add comments which properly explain the undocumented use of bits in
TDLEN register prior to VF initializing it to the correct value. Note
that the mechanism is entirely software-defined and explain its purpose
to help reduce confusion in the future.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:06:52 +0000 (19:06 +0800)]
fm10k/base: fix max queues on VF initialization failure
VF drivers must detect how many queues are available. Previously, the
driver assumed that each VF has at minimum 1 queue. This assumption is
incorrect, since it is possible that the PF has not yet assigned the
queues to the VF by the time the VF checks.
To resolve this, we added a check first to ensure that the first queue
is, in fact, owned by the VF at init_hw_vf time.
However, the code flow did not reset hw->mac.max_queues to 0.
In some cases, such as during reinit flows, we call init_hw_vf
without clearing the previous value of hw->mac.max_queues. Due to this,
when init_hw_vf errors out, if its error code is not properly handled
the VF driver may still believe it has queues which no longer belong to
it. Fix this by clearing the hw->mac.max_queues on exit due to errors.
Fixes:
8b8264bdb90d ("fm10k/base: check VF has a queue")
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:06:51 +0000 (19:06 +0800)]
fm10k/base: use bit shift for ITR scale
Use bitshift instead of a divisor, because this is faster, and
eliminates any need for a '0' check. In our case, this even works
out because default Gen3 will be 0.
Because of this, we are also able to remove the check for non-zero value
in the VF code path since that will already be the default Gen3 case.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:06:50 +0000 (19:06 +0800)]
fm10k/base: clean up namespace pollution
Make functions that are only referenced locally static.
Wrap fm10k_msg_data fm10k_iov_msg_data_pf[] in the new ifndef
NO_DEFAULT_SRIOV_MSG_HANDLERS so that drivers with custom SR-IOV
message handlers can strip it.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:06:49 +0000 (19:06 +0800)]
fm10k/base: fix typecast
Since the resultant data type of the mac_update.mac_upper field is u16,
it does not make sense to typecast u8 variables to u32 first.
Fixes:
7223d200c227 ("fm10k: add base driver")
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Xiao Wang [Fri, 19 Feb 2016 11:06:48 +0000 (19:06 +0800)]
fm10k: use default mailbox message handler for PF
The new share code makes fm10k_msg_update_pvid_pf function static, so we
can not refer to it now in fm10k_ethdev.c. The registered PF handler is
almost the same as the default PF handler, removing it has no impact on
mailbox.
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Tested-by: Heng Ding <hengx.ding@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Chen Jing D(Mark) [Sat, 6 Feb 2016 06:49:25 +0000 (14:49 +0800)]
fm10k: handle error flags in vector Rx
Using SSE instructions to parse error flags in HW Rx descriptor,
then set corresponding bits of mbuf.
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
Chen Jing D(Mark) [Thu, 28 Jan 2016 09:45:59 +0000 (17:45 +0800)]
fm10k: optimize mbuf freeing in non-vector Tx
When the TX function tries to free a bunch of mbufs, it will free
them one by one. This change will scan the free list and merge the
requests in case they belongs to same pool, then free once, which
will reduce cycles on freeing mbufs.
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Shaopeng He [Fri, 5 Feb 2016 02:46:11 +0000 (10:46 +0800)]
fm10k: fix switch manager high CPU usage
fm10k switch core uses source MAC + VID + SGLORT to do
look up in MAC table. If no match, an exception interrupt
will be sent to the switch manager. Too much of this kind
of exception interrupts cause switch manager side high CPU
usage.
To reproduce this issue, one DPDK testpmd runs on a server
with one fm10k NIC, mac forwards test traffic from one of
fm10k ports to another port. The CPU usage for the switch
manager will go up to about 20% for test traffic rate at
10G bps, comparing to near 0% for no test traffic.
This patch fixes this issue. A default SGLORT is assigned
to each TX queue. This default value works for non-VMDq mode
and current VMDq example. For advanced VMDq usage, e.g.
different source MAC address for different TX queue, FTAG
forwarding function could be used to change this default
SGLORT value.
Fixes:
9ae6068c86da ("fm10k: add dev start/stop")
Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Shaopeng He [Thu, 4 Feb 2016 12:43:21 +0000 (20:43 +0800)]
fm10k: enable broadcast loopback suppression
In FM10K, a single PCIe port can derive out a few logical ports,
like SRIOV PF/VF devices, VMDQ objects. To better manage them, FM10K
silicon assigns a Unique GLORT ID to each logical port.
When a logical port sends a broadcast packet, the silicon will flood
it to all logical ports, including the one that sent the broadcast packet.
To prevent this, silicon has an rxq register to store the glort id of
the logical port that queue binds to.
FM10K has a switch core inside, which has a loopback suppression
mechanism in the switch level. Switch level loopback suppression mostly
works for the ether port traffic.
This patch assigns a SGLORT for each RX queue, and enables PCIe port
level loopback suppression.
Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Shaopeng He [Fri, 5 Feb 2016 04:57:50 +0000 (12:57 +0800)]
examples/l3fwd-power: fix memory leak for non-IP packets
Previous l3fwd-power only processes IP and IPv6 packets, other
packets' mbufs are not freed, and this causes a memory leak.
This patch fixes this issue.
Fixes:
3c0184cc0c60 ("examples: replace some offload flags with packet type")
Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
Shaopeng He [Fri, 5 Feb 2016 04:57:49 +0000 (12:57 +0800)]
fm10k: make default VID available in initialization
When the PF establishes a connection with Switch Manager(SM), it receives
a logical port range from SM, and registers certain logical ports from
that range. Then a default VID will be sent back from the SM.
This whole transaction - finishing with the default VID being set -
needs to be completed before dev_init returns. If not, the interrupt
setting will subsequently be changed in dev_start according to the RX
queue number, and that can cause this transaction to fail.
Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
Shaopeng He [Fri, 5 Feb 2016 04:57:48 +0000 (12:57 +0800)]
fm10k: add Rx queue interrupt enable/disable functions
Interrupt mode framework has per-queue enable/disable functions.
Implement these two functions for fm10k driver.
Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
Shaopeng He [Fri, 5 Feb 2016 04:57:47 +0000 (12:57 +0800)]
fm10k: remove Rx queue interrupts when stopping
Previous dev_stop function stops the rx/tx queues. This patch adds logic
to disable rx queue interrupt, clean the datapath event and queue/vector
map.
Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
Shaopeng He [Fri, 5 Feb 2016 04:57:46 +0000 (12:57 +0800)]
fm10k: setup Rx interrupt for PF and VF
In interrupt mode, each rx queue can have one interrupt to notify the
application when packets are available in that queue. Some queues
also can share one interrupt.
Currently, fm10k needs one separate interrupt for mailbox. So, only those
drivers which support multiple interrupt vectors e.g. vfio-pci can work
in fm10k interrupt mode.
This patch uses the RXINT/INT_MAP registers to map interrupt causes
(rx queue and other events) to vectors, and enable these interrupts
through kernel drivers like vfio-pci.
Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
Shaopeng He [Fri, 5 Feb 2016 04:57:45 +0000 (12:57 +0800)]
fm10k: support Rx descriptor check
rx_descriptor_done is used by interrupt mode example application
(l3fwd-power) to check rxd DD bit to decide the RX trend,
then l3fwd-power will adjust the cpu frequency according to
the result.
Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
Chen Jing D(Mark) [Wed, 30 Dec 2015 08:35:35 +0000 (16:35 +0800)]
fm10k: allocate logical ports for flow director
In fm10k, PF, VF, VMDQ or queues binding to flow director rule can
be considered as a logical port. Original implementation only creates
a single port for all cases. This change creates 128 logical ports;
first 64 for PF and VMDQ, second 64 for flow director.
Registers DGLORTDEC/DGLORTMAP define rules for how to classify packets
into different queues. Currently only PF and VMDQ cases are considered.
This change add rules for flow director.
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Xiao Wang [Fri, 18 Dec 2015 03:09:18 +0000 (11:09 +0800)]
fm10k: fix VLAN flag in scattered Rx
In fm10k_recv_scattered_pkts function, a packet is stored in a linked list,
offload flags such as PKT_RX_VLAN_PKT should be set in the first segment.
Fixes:
6b59a3bc82b1 ("fm10k: fix VLAN in Rx mbuf")
Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Remy Horton [Wed, 9 Mar 2016 13:29:24 +0000 (13:29 +0000)]
i40e: support default MAC address setting
Signed-off-by: Remy Horton <remy.horton@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Remy Horton [Wed, 9 Mar 2016 13:29:24 +0000 (13:29 +0000)]
i40e: add EEPROM and registers dumping
Signed-off-by: Remy Horton <remy.horton@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Jingjing Wu [Wed, 9 Mar 2016 08:22:46 +0000 (16:22 +0800)]
i40e: support setting VF MAC address
This patch implemented the ops of adding and removing mac
address in i40evf driver. Functions are assigned like:
.mac_addr_add = i40evf_add_mac_addr,
.mac_addr_remove = i40evf_del_mac_addr,
To support multiple mac addresses setting, this patch also
extended the mac addresses adding and deletion when device
start and stop. Each VF can have a maximum of 64 mac
addresses.
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Zhe Tao <zhe.tao@intel.com>
Zhe Tao [Wed, 9 Mar 2016 05:38:43 +0000 (13:38 +0800)]
i40e: add VEB switching support
VEB switching feature for i40e is used to enable the switching between the
VSIs connect to the virtual bridge. The old implementation is setting the
virtual bridge mode as VEPA which is port aggregation. Enable the switching
ability by setting the loop back mode for the specific VSIs which connect
to PF or VFs.
VEB/VSI/VEPA are concepts not specific to the i40e HW, the concepts are
from 802.1qbg spec
IEEE EVB tutorial:
http://www.ieee802.org/802_tutorials/2009-11/evb-tutorial-draft-20091116_v09.pdf
VEB: a virtual switch can forward the packet based on the specific match
field.
VSI: a virtual interface connect between the VEB/VEPA and virtual machine.
VEPA: a virtual Ethernet port aggregator will upstream the packets from
VSI to the LAN port.
Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Rami Rosen [Fri, 26 Feb 2016 18:33:54 +0000 (20:33 +0200)]
i40e: fix typo in a comment
This patch fixes a typo in a comment in the definition of
the i40e_pf struct.
Fixes:
4861cde46116 ("i40e: new poll mode driver")
Signed-off-by: Rami Rosen <rami.rosen@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Jingjing Wu [Thu, 25 Feb 2016 07:33:35 +0000 (15:33 +0800)]
examples/vmdq_dcb: support X710
Currently, the example vmdq_dcb only works on Intel(R) 82599 NICs.
This patch extends this sample to make it work both on Intel(R) 82599
and X710/XL710 NICs by making the following changes:
1. add VMDQ base queue checking to avoid forwarding on PF queues.
2. assign each VMDQ pool to a MAC address.
3. add more arguments (nb-tcs, enable-rss) to change the default
setting
4. extend the max number of queues from 128 to 1024.
This patch also reworks the user guide for the vmdq_dcb sample.
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Jingjing Wu [Thu, 25 Feb 2016 07:33:33 +0000 (15:33 +0800)]
i40e: enable DCB in VMDQ VSIs
Previously, DCB(Data Center Bridging) is only enabled on PF,
queue mapping and BW configuration is only done on PF.
This patch enables DCB for VMDQ VSIs(Virtual Station Interfaces)
by following steps:
1. Take BW and ETS(Enhanced Transmission Selection)
configuration on VEB(Virtual Ethernet Bridge).
2. Take BW and ETS configuration on VMDQ VSIs.
3. Update TC(Traffic Class) and queues mapping on VMDQ VSIs.
To enable DCB on VMDQ, the number of TCs should not be larger than
the number of queues in VMDQ pools, and the number of queues per
VMDQ pool is specified by CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM
in config/common_* file.
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:37 +0000 (16:14 +0800)]
i40evf: use base driver defined interface
It removes the i40evf_set_mac_type() defined in PMD, and reuses
i40e_set_mac_type() defined in base driver.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:36 +0000 (16:14 +0800)]
i40e/base: add base driver release info
It adds base driver release information such as release date,
for better tracking in the future.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:35 +0000 (16:14 +0800)]
i40e/base: update AQ command structures and macros
Several structures and macros are added or updated, such
as 'struct i40e_aqc_get_link_status',
'struct i40e_aqc_run_phy_activity' and
'struct i40e_aqc_lldp_set_local_mib_resp'.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:34 +0000 (16:14 +0800)]
i40e/base: add AQ thermal sensor control struct
It adds the new AQ command and struct for managing a
thermal sensor.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:33 +0000 (16:14 +0800)]
i40e/base: add virtchnl offload for X722 PCTYPES
X722 supports Expanded version of TCP, UDP PCTYPES for RSS.
Add a Virtchnl offload to support this.
Without this patch VF drivers will not be able to support
the correct PCTYPES for X722 and UDP flows will not fan out.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:32 +0000 (16:14 +0800)]
i40e/base: add some register definitions
This patch adds 7 new register definitions for programming the
parser, flow director and RSS blocks in the HW.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:31 +0000 (16:14 +0800)]
i40e: use AQ for Rx control register read/write
RX control register read/write functions are added, as directly
read/write may fail when under stress small traffic. After the
adminq is ready, all rx control registers should be read/written
by dedicated functions.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:30 +0000 (16:14 +0800)]
i40e/base: fix coding style
Clean up coding style in base code
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:29 +0000 (16:14 +0800)]
i40e/base: save VSI resource count on update
When updating a VSI, save off the number of allocated and
unallocated VSIs as we do when adding a VSI.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:28 +0000 (16:14 +0800)]
i40e/base: fix driver load failure
Fix the driver load failure with linking with some
PHY types, as the amount of time it takes for the
GLGEN_RSTAT_DEVSTATE to be set increases greatly on those PHY
types, which can lead to a timeout.
Fixes:
9aeefed05538 ("i40e/base: support ESS")
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:27 +0000 (16:14 +0800)]
i40e/base: avoid unwanted Tx traffic mirroring
In Multi-Function Mode (MFP) particularly when the PF VSI is set
in limited promiscuous mode, the HW switch was still mirroring the
outgoing packets from other VSIs (VF/VMdq) onto the PF VSI.
This sets a new bit to avoid above mirroring, and it is in limited
promiscuous on the PF VSI in MFP which is similar to default port
VSI.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:26 +0000 (16:14 +0800)]
i40e/base: support LED blinking with new PHY
This patch adds functions to blink led on devices using a new
PHY since MAC registers used in other designs do not work in
this device configuration.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:25 +0000 (16:14 +0800)]
i40e/base: add AQ switch configuration
Add the support code for calling the AdminQ API call
aq_set_switch_config.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:24 +0000 (16:14 +0800)]
i40e/base: add VEB statistics control
With the latest firmware, statistics gathering can now be enabled and
disabled in the HW switch, so we need to add a parameter to allow the
driver to set it as desired. At the same time, the L2 cloud filtering
parameter has been removed as it was never used.
Older drivers working with the newer firmware and newer drivers working
with older firmware will not run into problems with these bits as the
defaults are reasonable and there is no overlap in the bit definitions.
Also, newer drivers will be forced to update because of the change in
function call parameters, a reminder that the functionality exists.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:23 +0000 (16:14 +0800)]
i40e/base: support mirroring rules
This patch implements necessary functions related to port
mirroring features such as add/delete mirror rule, function
to set promiscuous VLAN mode for VSI if mirror rule_type is
"VLAN Mirroring".
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:22 +0000 (16:14 +0800)]
i40e/base: set shared bit for multicast filters
Add the use of the new shared MAC filter bit for multicast
and broadcast filters in order to make better use of the
filters available from the device.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:21 +0000 (16:14 +0800)]
i40e/base: fix PHY NVM interaction
This patch fixes a problem where the NVMUpdate Tool, when
using the PHY NVM feature, gets bad data from the PHY because
of contention on the MDIO interface from get phy capability
calls from the driver during regular operations. The problem
is fixed by adding a check if media is available before calling
get phy capability function because that bit is not set when
device is in PHY interaction mode.
Fixes:
842ea1996335 ("i40e/base: save link module type")
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:20 +0000 (16:14 +0800)]
i40e/base: unify the capability function
The device capabilities were defined in two places, and neither had
all the definitions. It really belongs with the AQ API definition,
so this patch removes the other set of definitions and fills out the
missing item.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:19 +0000 (16:14 +0800)]
i40e/base: fix proxy for X722
The recently added proxy opcodes should be available only with
X722_SUPPORT, so move them into the #ifdef, and reorder these
to be in numerical order with the rest of the opcodes. Several
structs that were added are unnecessary, so they are removed
here.
Fixes:
788fc17b2dec ("i40e/base: support proxy config for X722")
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:18 +0000 (16:14 +0800)]
i40e/base: fix wake on lan for X722
The recently added Wakeup On Line (WOL) opcodes should be
available only with X722_SUPPORT, so move them into the #ifdef,
and reorder these to be in numerical order with the rest of the
opcodes. Several structs that were added are unnecessary, so
they are removed here.
Fixes:
3c89193a36fd ("i40e/base: support WOL config for X722")
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:17 +0000 (16:14 +0800)]
i40e: update device ids
Add new Device ID's for backplane and QSFP+ adapters, and delete
deprecated one for backplane.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:16 +0000 (16:14 +0800)]
i40e/base: fix uncertain event descriptor issue
In one obscure corner case, it was possible to clear the NVM update
wait flag when no update_done message was actually received. This
patch cleans the event descriptor before use, and moves the opcode
check to where it won't get done if there was no event to clean.
Fixes:
8db9e2a1b232 ("i40e: base driver")
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:15 +0000 (16:14 +0800)]
i40e/base: set AQ count after memory allocation
The standard way to check if the AQ is enabled is to look at
the count field. So it should only set this field after it has
successfully allocated memory.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:14 +0000 (16:14 +0800)]
i40e/base: fix missing check for stopped admin queue
It's possible that while waiting for the spinlock, another
entity (that owns the spinlock) has shut down the admin queue.
If it then attempts to use the queue, it will panic.
It adds a check for this condition on the receive side. This
matches an existing check on the send queue side.
Fixes:
8db9e2a1b232 ("i40e: base driver")
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:13 +0000 (16:14 +0800)]
i40e/base: limit version check of DCB
XL710/X710 devices requires FW version checks to properly handle
DCB configurations from the FW while other devices (e.g. X722)
do not, so limit these checks to XL710/X710 only.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:12 +0000 (16:14 +0800)]
i40e/base: support NVM read on X722
In X722, NVM reads can't be done through SRCTL registers.
And require AQ calls, which require grabbing the NVM lock.
Unfortunately some paths need the lock to be acquired once
and do a whole bunch of stuff and then release it.
This patch creates an unsafe version of the read calls, so
that it can be called from the paths that need the bulk access.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:11 +0000 (16:14 +0800)]
i40e/base: add flag for X722 register access
Instead of doing the MAC check, use a flag that gets set per
MAC. This way there are less chances of user error and it
can enable multiple MACs with the capability in a single place
rather than cluttering the code with MAC checks.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:10 +0000 (16:14 +0800)]
i40e/base: acquire NVM ownership before reading it
SW needs to acquire the NVM ownership before issuing an AQ read
to the X722 NVM otherwise it will get EBUSY from the firmware.
Also it should be released when done.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Helin Zhang [Tue, 8 Mar 2016 08:14:09 +0000 (16:14 +0800)]
i40e/base: fix compilation warnings
Fix compilation warnings in base code on some platforms.
Fixes:
bd6651c2d2d7 ("i40e/base: use bit shift macros")
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>