Commit Graph

338 Commits

Author SHA1 Message Date
Wang Xiao W
6f21dcc645 fm10k/base: add macros for ethernet address checks
To keep consistency with ND team, I add macro definitions about
FM10K_IS_VALID_ETHER_ADD in fm10k_type.h, though they have already
been defined in fm10k_osdep.h.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
2015-10-07 13:25:06 +02:00
Wang Xiao W
4de8365314 fm10k/base: remove useless variable
The reference to err_no was left around after an old re-factor. We never
use this value again, and the macros called on the function appear to
have no relevant side effect I could see. Discovered via cppcheck
fm10k_mbx.c:1312: (style) Variable 'err_no' is assigned a value that is never used.

This occurred because a previous commit refactored and removed all used
references to err_no.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
2015-10-07 13:25:06 +02:00
Wang Xiao W
115c91b89a fm10k/base: fix debug typo
The function is specifically for the PF, but the DEBUGFUNC labeled it
with *_vf.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
2015-10-07 13:25:06 +02:00
Wang Xiao W
2fce599022 fm10k/base: fix a comment
The header comment included a miscopy of a C-code line, and also
mis-used Rx FIFO when it clearly meant Tx FIFO.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
2015-10-02 18:59:51 +02:00
Jingjing Wu
5535087e6c i40e/base: add outer UDP checksum for X722
Fixes a minor definition change in the Rx descriptor.
Also adds FortPark specific changes to the Descriptors.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:23 +02:00
Jingjing Wu
2e7e5097c3 i40e/base: add WOL/proxy capability parsing
Adds support to retrieve and parse WoL/Proxy capabilities from the
device/function list.
Also saves WR_CSR_PROT field from DEV/FUNC capabilities.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:23 +02:00
Jingjing Wu
3c89193a36 i40e/base: support WOL config for X722
Adds admin q function for "Set Wake on LAN Filter AQ"
and "Get Wake Up Reason AQ".

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:23 +02:00
Jingjing Wu
788fc17b2d i40e/base: support proxy config for X722
Adds admin q functions for "Set Proxying Configuration Command"
and "Set NS Proxy Table Entry Command".

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:23 +02:00
Jingjing Wu
4000d1d0cc i40e/base: support RSS for X722
Add AQ functions to handle RSS Key and LUT programming.
This is needed for FortPark RSS support.

FortPark has additional PCTYPES supported for RSS

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:23 +02:00
Jingjing Wu
32216a586a i40e/base: add X722 specific registers
This patch adds registers and bit field definitions specific to FortPark.
Most of these new registers are related to PE (IWARP), Reset, NVM, RSS
and ATR changes.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:23 +02:00
Jingjing Wu
46628286a5 i40e/base: add X722 device
Add device ids for X722 devices

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:23 +02:00
Jingjing Wu
7e46af6cbe i40e/base: print FCoE capability
This is to allow quick check for FCoE capability is enabled or not
in device function before any SW overrides.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:23 +02:00
Jingjing Wu
9aeefed055 i40e/base: support ESS
Add some delays specific to ESS/Veloce system.
This patch requires driver changes to define ESS_SUPPORT.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:23 +02:00
Jingjing Wu
f1b80608f2 i40e/base: add definition of GLINT_CTL register
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:23 +02:00
Jingjing Wu
4d7fa8714f i40e/base: support pre-allocated pages for pd
The i40e_add_pd_table_entry() routine is being modified to handle both
cases where a backing page is passed and where backing page is allocated
in i40e_add_pd_table_entry().

For pble resource management, it is more efficient for it to manage its
backing pages. For VF, pble backing page addresses will be send to PF
driver for pble resource.

The i40e_remove_pd_bp() is also modified to not free pre-allocated pages and
free only ones which were allocated in i40e_add_pd_table_entry().

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:23 +02:00
Jingjing Wu
774acd0c53 i40e/base: add checks for CEE APP priority validity
The firmware has added additional status information to allow software
to determine if the APP priority for FCoE/iSCSI/FIP is valid or not in
CEE DCBX mode.

This patch adds to support those additional checks and will only add
applications to the software table that have oper and sync bits set
without any error.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
7feb193e53 i40e/base: more Solaris config
In order to support some extra Solaris features the Solaris VF drivers need
additional configuration data from the PF that aren't provided with the current
virtual channel commands.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
3006df511e i40e/base: fix padding in struct
The struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with
word boundary layout issues, which most compilers deal with by silently
adding padding, making the actual struct larger than designed.
This patch adds an extra byte in fields reserved3 and reserved4 to directly
acknowledge that padding.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
8af9e07ff7 i40e/base: remove useless assignments
The assignments of addr_high and addr_low were not only wrong because
they were assigning virtual addresses to a hardware accessed variable,
but they were shortly thereafter overwritten by the send_asq_command
call with a non-NULL third argument (buffer) with correctly formatted
data.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
e31d665baa i40e/base: minor clean up
Use INLINE macro for better cross-platform code management.

Clean up some unnecessary logic jumping and drop a variable.

There was one more __FUNCTION__ reference that wasn't needed.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
869b94700e i40e/base: add new link status defines
Add the new Port link status bit and rename the link status to function
link status.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
3efd17148f i40e/base: explicitly assign index for VSI type
The change is to explicitly assign enum index for each VSI type
so that PF and VF always reference to the same VSI type even if the
enum lists are different.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
3c67585133 i40e/base: add more stats
This will help us avoid a whole bunch of log messages when the driver
is running.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
27be1e3fe7 i40e/base: update Flex-10 capabilities
The Flex10 device/function capability has been upgraded to revision 2
to include information needed to support Flex-10 DCC and DCI
configurations. This patch adds new fields to the i40e_hw_capabilities
structure and updates i40e_parse_discover_capabilities functions to
extract them from the AQ response. Naming convention has changed to use
flex10 mode instead of existing mfp_mode_1.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
2114b52a36 i40e/base: store CEE DCBX config
This patch adds capability to query and store the CEE DCBX DesiredCfg
and RemoteCfg data from the LLDP MIB.
Added new member "desired_dcbx_config" in the i40e_hw data structure
to hold CEE only DesiredCfg data.

Store the CEE TLV status returned by firmware to allow drivers to dump that
for debug purposes.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
def25b3eec i40e/base: add PHY capabilities
Remove unused members in the PHY structure and add a new member to store
all the capabilities the PHY has as reported by the FW. This information will
help us determine what speeds the device is capable of when link is
down.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
0d9d27bb86 i40e/base: prepare local LLDP MIB in TLV
This patch prepares the LLDP MIB in IEEE TLV format based on
the local dcb config.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
166dceeeea i40e/base: add parsing for CEE DCBX TLVs
This patch adds parsing for CEE DCBX TLVs from the LLDP MIB.

While the driver gets the DCB CEE operational configuration from Firmware
using the "Get CEE DCBX Oper Config" AQ command there is a need to get
the CEE DesiredCfg Tx by firmware and DCB configuration Rx from peer; for
debug and other application purposes.

Also gets rid of unused locals variables.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
bd6651c2d2 i40e/base: use bit shift macros
Use macros for abstracting (1 << foo) to BIT(foo)
and (1ULL << foo64) to BIT_ULL(foo64) in order to match
better with linux kernel requirements.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
1e32378f07 i40e/base: increase PF reset max loop limit
With latest LANconf and NVMupdate tools, pf_reset failed due to Firmware not
being ready, so this patch increases I40E_PF_RESET_WAIT_COUNT to 200, using
original value defined for A0 silicon, in order to make sure that FW is ready.

Test result indicates that firmware became ready at the loop count of 114.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
9783eb15eb i40e/base: wrap the register definitions for PF and VF
There were quite a few issues when the wrong defines were getting used
in the VF driver. This patch defines a new #define PF_DRIVER.
All the PF specific register definitions are wrapped in it.

The drivers will have to be updated to use the define in the PF
driver builds. Makes for a very short register.h for VF drivers.

Also fixes the code where PF driver register fields were getting used for
VF driver.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
b28c67c3ba i40e/base: add VF capabilities to virtual channel interface
To prepare for the changes coming up in the X722 device and future
devices, the virtual channel interface has to change slightly. The VF
driver can now report what its capable of supporting, which then informs
the PF driver when it sends the configuration information back to the
VF.

A 1.1 VF driver on a 1.0 PF driver should not send its capabilities.
Likewise, a 1.1 PF driver controlling a 1.0 VF driver should not expect
or depend upon receiving the VF capabilities.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
9e5643ec79 i40e/base: add OEM post update
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
6bfca47c08 i40e/base: add debug dump internal data
This patch adds support for "Debug Dump Internal Data" AQ command.
It is used to dump internal firmware or hardware data for debug
purposes.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
3f12b9f23b i40e/base: add workaround to drop all flow control frames
This patch adds a workaround to drop any flow control frames from being
transmitted from any VSI. FW can still send Flow control frames if Flow
control is enabled.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:22 +02:00
Jingjing Wu
e7290261ed i40e/base: add promiscuous on VLAN
NFV use cases require the ability to steer packets to VSIs by VLAN tag
alone while being in promiscuous mode for multicast and unicast MAC
addresses.  These two new functions support that ability.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
4f5b4a3abd i40e/base: allow per-device FW API version
Allow for unique FW API versions for different HW

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
8d6c51fcd2 i40e/base: get OEM version
This patch adds a member to the nvm_info struct for oem_ver info to be
output either by OID or ethtool.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
3ed6c3246f i40e/base: handle AQ timeout when releasing NVM
There are some rare cases where the release resource call will return an
admin Q timeout. In these cases the code needs to try to release the
resource again until it succeeds or it times out.

Also add little endian conversion for checksum

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
f766d82b1e i40e/base: add commands for NVM update
Add a new GetStatus command so that the NVM update tool can query
the current status instead of doing fake write requests to probe for
readiness.
Add a facility to run AQ commands through the nvmupdate utility in order
to allow the update tools to interact with the FW and do special
commands needed for updates and configuration changes.
Add a facility to recover the result of a previously run AQ command.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
2d01a42227 i40e/base: add wait states to NVM state machine
This adds wait states to the NVM update state machine to signify when
waiting for an update operation to finish, whether we're in the middle
of a set of Write operations, or we're now idle but waiting.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
7df22f55cc i40e/base: add Tx scheduling related AQ commands
This patch adds support for AQ commands related to Tx scheduling.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
305f81dbd7 i40e/base: save AQ write back descriptor
Add the ability to save the AdminQ write back descriptor. If the writeback
descriptor buffer was previously created, this gives it to the AQ command
request to be used to save the results.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
fb6791c2e7 i40e/base: grab AQ spinlocks before clearing registers
Make sure we have the spinlocks before we clear the ARQ and ASQ management
registers.  Also, widen the locked portion and make a sanity check earlier
in the send function to be sure we're working with safe register values.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
842ea19963 i40e/base: save link module type
Add a module_types variable to the link_info struct to save the module
information from get_phy_capabilities. This information can be used to
determine which speeds the module supports.

Also add a new function update_link_info which updates the module_types
parameter and then calls get_link_info. This function should be called
in place of get_link_info so that the module_types variable stays
up-to-date with the rest of the link information.

Also rework the function get_link_status to allow caller to get all
return values in the call chain bubbled back to the source, which keeps
information about failures from being lost.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
b08c3b0d84 i40e/base: update AQ command header
Update the admin queue command header for the Fortville SW 4 Release. As
part of this release the minor FW API version number is bumped to 4 so
that the FW API version for the FVLSW4 release will now be 1.4.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
cda6a5f576 i40e/base: reformat AQ debug output
Replace sprintf with i40e_debug.
Pad the line out with zeros to get to 16 bytes.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
272eb7b988 i40e/base: fix error code conversion type
The error code sent into i40e_aq_rc_to_posix() are signed values, so we
really need to treat them as such.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-10-02 01:35:21 +02:00
Jingjing Wu
b1f91174a5 i40e/base: add error status decoding
Add status value to string decoding routines to be used in error reporting
in order to give more readable error messages rather than bare error
numbers.  This decodes both the i40e_status and the AQ error codes.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-09-30 19:37:30 +02:00
Jingjing Wu
662c0e52d0 i40e/base: add new device id for 20Gb and Fort pond
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
2015-09-30 19:35:57 +02:00