Commit Graph

1010 Commits

Author SHA1 Message Date
Gavin Hu
bade47a757 net/i40e: relax barrier in Tx
To keep ordering of mixed accesses, rte_cio is sufficient.
The rte_io barrier inside the I40E_PCI_REG_WRITE is overkill.[1]

[1] http://inbox.dpdk.org/dev/CALBAE1M-ezVWCjqCZDBw+MMDEC4O9
qf0Kpn89EMdGDajepKoZQ@mail.gmail.com

Fixes: 4861cde461 ("i40e: new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2020-03-18 10:21:41 +01:00
Xiao Zhang
496608a079 net/i40e: fix port start during config restore
If configuring VF promiscuous mode is not supported, return '-ENOTSUP'
error code in '.promiscuous_enable/disable' dev_ops.

This is to fix the port start during config restore, where if
'.promiscuous_enable/disable' dev_ops exists and return any value other
than '-ENOTSUP', start will fail.

Same is done for '.allmulticast_enable/disable' dev_ops.

Fixes: ddc7cb0d94 ("net/i40e: re-program promiscuous mode on VF interface")
Cc: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-03-18 10:21:41 +01:00
Shougang Wang
ca9ae72091 net/i40e: fix multiple interrupts for VF
Interrupt mapping should be 1:n queue(s).This patch fixes the
logic of interrupt bind by code reconstruction.

Fixes: 6a6cf5f88b ("net/i40e: enable multi-queue Rx interrupt for VF")

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-02-19 13:51:06 +01:00
Beilei Xing
ba950e6276 net/i40e: fix unchecked Tx cleanup error
Coverity complains of unchecked return value warning of
i40e_xmit_cleanup, while this cleanup is opportunistic and will not
cause problems if it fails. So instead of checking the return value of
i40e_xmit_cleanup and return in case of cleanup failure, we directly
cast it to void function to make the Coverity happy.

Coverity issue: 353617
Fixes: 4861cde461 ("i40e: new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-02-14 12:42:13 +01:00
Bernard Iremonger
2ab5c84605 net/i40e: fix ESP flow creation
Merge of ESP and L2TP code in i40e_fdir.c added checks on
cus_pctype->index which caused flow creation for ESP to fail.

Added fill_ipv4_function()
Refactored code to have one path for customized and non customized
pctype's.

Fixes: c5f8365bc8 ("net/i40e: support flow director for L2TPv3 over IP")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Rory Sexton <rory.sexton@intel.com>
2020-02-14 12:42:12 +01:00
Thomas Monjalon
c886f4263a mk: ignore missing field initializers warning
Three warnings are commonly disabled in DPDK with make and meson:
	* address-of-packed-member
		always disabled
	* missing-field-initializers
		disabled with meson
		disabled with make + clang or make + gcc < 4.7
		disabled with make + gcc <= 5 for test files and event drivers
	* packed-not-aligned
		disabled with meson

This change is removing exceptions for missing-field-initializers.
As it is always disabled, some redundant configs are cleaned up.

Now the situation is:
	* address-of-packed-member
		always disabled
	* missing-field-initializers
		always disabled
	* packed-not-aligned
		disabled with meson

It could alternatively be decided to disable missing-field-initializers
only for old gcc (< 6).

The warning packed-not-aligned is not modified in this change.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-06 09:09:37 +01:00
Lunyuan Cui
40163f9e17 net/i40e: fix multi-queue Rx interrupt for VF
The interrupt vector which bind to queues should not be larger than
the max available vector. It will cause port start failed. This patch
changed the judgement condition of the limited vector id. It can
effectively avoid vector id out of range.

Fixes: 6a6cf5f88b ("net/i40e: enable multi-queue Rx interrupt for VF")

Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
2020-02-05 09:51:21 +01:00
Xiaolong Ye
707911f982 net/i40e/base: skip further adminq init for VF
Since VF has no need of firmware, we can skip further adminq init which
involves firmware operation, this patch fixes the testpmd segfault issue
when starting with i40e VF.

Fixes: d5e1a14936 ("net/i40e/base: check MAC type")

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-02-05 09:51:19 +01:00
Tao Zhu
9accffad65 net/i40e: add PF MDD event handler
Add warning and counter to handle the malicious driver detection (MDD)
event.
When the hardware determines that a malicious driver on VF, this VF will
become unworkable, the PF records and gives a warning message.

Signed-off-by: Tao Zhu <taox.zhu@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-01-17 19:59:19 +01:00
Bernard Iremonger
92ffec956a net/i40e: support ESP in flow director
add fill_ip6_head()
hardcode udp destination port to 4500
handle ESP and AH pctypes in ESP-AH profile
update the i40e user guide with ESP information.
update release notes for i40e changes

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-01-17 19:59:18 +01:00
Bernard Iremonger
bf02e3c261 net/i40e: support ESP flows
add eth/ipv4/esp and eth/ipv6/esp patterns
add eth/ipv4/udp/esp and eth/ipv6/esp/udp patterns
update i40e_flow_parse_fdir_filter()
add i40e_flow_set_filter_spi()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-01-17 19:59:18 +01:00
Bernard Iremonger
ede4ab4425 net/i40e: support ESP in customized code
update customized code for ESP

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-01-17 19:59:18 +01:00
Bernard Iremonger
d8ef3778c6 net/i40e: support IPsec-AH profile
Add flow structures for the following patterns in i40e_ethdev files:
eth/ipv4/esp
eth/ipv6/esp
eth/ipv4/udp/esp
eth/ipv6/esp/udp

add oip_type in filter
add is_udp in filter
use tenant_id in filter for spi

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-01-17 19:59:18 +01:00
Bernard Iremonger
202890c9d4 net/i40e: handle ESP tunnel
handle ESP tunnel in rte_pmd_i40e.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-01-17 19:59:18 +01:00
Bernard Iremonger
c62b6e6673 net/i40e: improve RSS debug
improve RSS debug in i40e_ethdev.c

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-01-17 19:59:18 +01:00
Chenxu Di
6a8defc552 net/i40e: cleanup Tx buffers
Add support to the i40e driver for the API rte_eth_tx_done_cleanup
to force free consumed buffers on Tx ring.

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-01-17 19:46:26 +01:00
Rory Sexton
c5f8365bc8 net/i40e: support flow director for L2TPv3 over IP
Adding FDIR support for L2TPv3 over IP header matching and adding
a new customized pctype for l2tpv3 over IP.

Signed-off-by: Rory Sexton <rory.sexton@intel.com>
Signed-off-by: Dariusz Jagus <dariuszx.jagus@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:26 +01:00
Xiaolong Ye
03ef7d47f7 net/i40e/base: add new link speed constants
This patch fixes 'NIC Link is Up, Unknown bps' message in dmesg
for 2.5Gb/5Gb speeds. This problem is fixed by adding constants
for VIRTCHNL_LINK_SPEED_2_5GB and VIRTCHNL_LINK_SPEED_5GB.

Fixes: a58860f689 ("net/i40e/base: use new virtchnl header file")

Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
4af161ceac net/i40e/base: enable LED blinking flow
Add X710T*L device specific operations (in port LED detection and
handling of GLGEN_GPIO_CTL.PIN_FUNC field) to enable LED blinking.

Signed-off-by: Damian Milosek <damian.milosek@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
680f502d61 net/i40e/base: add CRC stripping capability
Some VFs may want to disable CRC stripping on incoming packets
so create an offload for that. The VF already sends information
about configuring it's RX queues so use that structure to
indicate that the CRC stripping should be enabled or not.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
cd9eb703e6 net/i40e/base: introduce firmware EMP reset register
Introduce offsets of firmware registers holding a number of EMP resets.
Implement offsets as a preprocessor's constants.
Required by drivers to read a number of EMP resets reported by FW.

Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
8b57cc446e net/i40e/base: expose LED functionality
The previous code had the LED code wrapped such that, it was
static to the file and not usable outside of it. It is now available.

Signed-off-by: Mateusz Rusinski <mateusz.rusinski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
76e874a71c net/i40e/base: add function to read LPI statistics
There was no time duration statistics for LPI (Low Power Idle)
in EEE (Energy-Efficient Ethernet).
Added new procedure to get duration values from FW.
Otherwise there is no available procedure to get tx_lpi_duration
and rx_lpi_duration values.

Signed-off-by: Jaroslaw Gawin <jaroslawx.gawin@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
bf1551fdb9 net/i40e/base: set PHY access flag on X722
The X722 FW API version 1.9 adds support for accessing PHY
registers with Admin Queue Command. This enables reading
EEPROM data from (Q)SFP+ transceivers, what was previously
possible only on X710 devices.

Signed-off-by: Adam Ludkiewicz <adam.ludkiewicz@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
801622b2ec net/i40e/base: remove unreachable code
The result of the check is always FALSE and the code within "if"
is never executed.

Signed-off-by: Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
38a4b62ce9 net/i40e/base: add flow director constants
Add defines for creating Flow Director flows as defined in datasheet
section 7.1.5.4 for field vectors.

Signed-off-by: Doug Dziggel <douglas.a.dziggel@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
b330a1c5c6 net/i40e/base: fix display of FEC settings
Fix display of FEC settings for ethtool.
This patch change variable 'phy.link_info.req_fec_info' sent to ethtool.
Without this patch wrong FEC settings can be shown.

Fixes: 1216fb9f0c ("net/i40e/base: store the requested FEC information")

Signed-off-by: Jaroslaw Gawin <jaroslawx.gawin@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
3010f08599 net/i40e/base: mark additional AQ bits as reserved
Mark bits 0xD through 0xF for the command flags of a cloud filter as
reserved. These bits are not yet defined and are considered as reserved
in the data sheet.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
50126939c6 net/i40e/base: fix retrying logic
Fixed a bug where driver was breaking out of the loop and
reporting an error without retrying first.

Fixes: 466eec7d6b ("net/i40e/base: retry AQC to overcome IRCRead hangs")

Signed-off-by: Marcin Formela <marcin.formela@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
d2f37f4427 net/i40e/base: add function to set MAC type
Make i40e_set_mac_type() public. i40e driver requires
i40e_set_mac_type() to be public. It is required for recovery mode
handling. Without this patch recovery mode could not be detected at
probe() function.

Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
a8e84b22bd net/i40e/base: support persistent LLDP
This patch adds a function to read NVM module data and uses it to
read current LLDP agent configuration from NVM API version 1.8.

Signed-off-by: Sylwia Wnuczko <sylwia.wnuczko@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
48c0aef5b9 net/i40e/base: update FW API version
Update FW API version to 1.9.

Signed-off-by: Piotr Azarewicz <piotr.azarewicz@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
3794e5d7ab net/i40e/base: add FWS1B register masks
Function check_recovery_mode had wrong if statement. Now we check proper
FWS1B register values, which are responsible for the recovery mode.
Recovery mode has 6 values in total. That's why we need 6 different
flags.  Now in if statement we recognize type of mac and register value.
Without those changes driver could show wrong state.

Signed-off-by: Adrian Podlawski <adrian.podlawski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
f8a4eae27c net/i40e/base: add drop mode parameter to set MAC config
This patch adds "drop mode" parameter to set mac config AQ command.
This bit controls the behavior when a no-drop packet is blocking a TC
queue.
0 – The PF driver is notified.
1 – The blocking packet is dropped and then the PF driver is notified.

Signed-off-by: Sylwia Wnuczko <sylwia.wnuczko@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
37b091c75b net/i40e/base: extend PHY access AQ command
Currently FW use MDIO I/F number corresponded with current PF for PHY
access. This code allow to specify used MDIO I/F number.

Signed-off-by: Piotr Azarewicz <piotr.azarewicz@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
79bfe78087 net/i40e/base: fix Tx descriptors number
The existing driver allows setting the number of TX descriptors
to the value that is indivisible by 32. This is not properly
supported by x710 hardware. The patch limits the number of TX
descriptors to the whole value of 32.

Fixes: 8db9e2a1b2 ("i40e: base driver")
Cc: stable@dpdk.org

Signed-off-by: Doug Dziggel <douglas.a.dziggel@intel.com>
Signed-off-by: Dariusz Chaberski <dariuszx.chaberski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
9e50258a91 net/i40e/base: update status codes
Add a few new status codes and rename a few to make them more
consistent.  Error code are mapped to similar values as in
i40e_status.h, so as to be compatible with older VF drivers not using
this status enum.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
3c7bfdc77f net/i40e/base: backport style changes from upstream Linux
The upstream virtchnl.h has a few minor style differences to what is
out-of-tree, and there is no real reason we should prefer the current
style over whats upstream.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
429bdc0cd9 net/i40e/base: add function to read LPI counters
This change introduces new function i40e_get_lpi_counters() reading
Low Power Idle (LPI) mode counters from Energy Efficient Ethernet (EEE)
statistics. Since reading EEE statistics requires running DNL script,
function i40e_aq_run_phy_activity() able to run it, was implemented.

i40e_lpi_stat_update() was introduced as helper function for retrieving
LPI counters' values relative to given offsets.

This change also fixes order of fields in struct
i40e_aqc_run_phy_activity and introduces union in the struct
providing more descriptive names of fields depending on usage
(command or response).

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
1da546c397 net/i40e/base: fix missing link modes
Fix for missing "Supported link modes" and "Advertised link modes"
info in ethtool after changed speed on X722 devices with BASE-T PHY
with FW API version >= 1.7.
The same FW API version on X710 and X722 does not mean the same
feature set so the change was needed as mac type of the device
should also be checked instead of FW API version only.

Fixes: e8228f1a16 ("net/i40e/base: report supported link modes")

Signed-off-by: Martyna Szapar <martyna.szapar@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
638172ac43 net/i40e/base: read LPI status from external PHY
When external PHY is used, MAC register may not reflect actual
state of LPI. Add function reading it directly from PHY or MAC,
depending on what is supported by the device.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
c61bcb0fe1 net/i40e/base: support Energy Efficient Ethernet
This change adds i40e_enable_eee() function controlling advertisement
of Energy Efficient Ethernet mode (EEE).

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
9b62b281c8 net/i40e/base: add function to get FW LLDP agent status
This change introduces i40e_get_fw_lldp_status() function capable of
reporting status of FW Link Layer Discovery Protocol (LLDP) agent.

Since reading LLDP configuration from NVM only gives information what
is the default state of FW LLDP agent after POR, this change introduces
more reliable method for checking if agent is enabled.

Current state of FW LLDP agent may be different if user disabled the
agent, so i40e_get_fw_lldp_status() uses LLDP MIB checking to determine
status of the agent.

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
06ee266de6 net/i40e/base: improve AQ log granularity
This patch makes it possible to log only AQ descriptors, without the
entire AQ message buffers being dumped too. It should greatly reduce
kernel log size in cases where a full AQ dump is not needed.
Selection is made by setting flags in hw->debug_mask.

Additionally, some debug messages that preceded an AQ dump have been
moved to I40E_DEBUG_AQ_COMMAND class, which seems more appropriate.

Signed-off-by: Doug Dziggel <douglas.a.dziggel@intel.com>
Signed-off-by: Robert Konklewski <robertx.konklewski@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
77192a006f net/i40e/base: add flags for PHY types
Adding bit flags to enable/disable EEE capability for 2.5GBase-T and
5GBase-T PHY types as well as 'Set autonomous EEE for relevant enabled
PHY types' flag.

Signed-off-by: Doug Dziggel <douglas.a.dziggel@intel.com>
Signed-off-by: Michal Litwicki <michalx.litwicki@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
d5e1a14936 net/i40e/base: check MAC type
Some features were introduced in different FW API version on XL710 and
X722 MACs. Others are available only on specific MAC type. Make sure
that they are properly assigned. Also fix the style issues reported by
current check-patch.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
c916517f74 net/i40e/base: add new device IDs
New device ids are created to support SFP+ and backplane connections.

Signed-off-by: Piotr Azarewicz <piotr.azarewicz@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
3c537ca7f4 net/i40e/base: support LLDP agent
This code implements changes necessary for LLDP Agent support.

1. Modified i40e_aq_start_lldp and i40e_aq_stop_lldp. Now Stop and Start
can also be persistent across power cycles.
2. Added new function i40e_aq_restore_lldp which restores factory
setting for LLDP Agent or gets its status.

Signed-off-by: Jaroslaw Ilgiewicz <jaroslaw.ilgiewicz@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
4b3da94159 net/i40e/base: fix error message
This patch changes an error code for an admin queue head overrun to use
I40E_ERR_ADMIN_QUEUE_FULL instead of I40E_ERR_QUEUE_EMPTY.

Fixes: 8db9e2a1b2 ("i40e: base driver")
Cc: stable@dpdk.org

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00
Xiaolong Ye
f4ed5a4a7c net/i40e/base: decouple MIB change event from DCB init
There is a need to enable MIB change event, not at the same time as
init_dcb. This patch will serve this requirement.

Modify the i40e_init_dcb to return the correct error when LLDP or DCBX
is not in operational state.

Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-01-17 19:46:02 +01:00