Commit Graph

6413 Commits

Author SHA1 Message Date
Jingjing Wu
8428366825 net/i40e/base: add broadcast promiscuous control per VLAN
Add a new adminq function that allows driver to configure per-VLAN
broadcast promiscuous mode, similar to how we handle unicast and
multicast promiscuous modes.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
b0fe87e186 net/i40e/base: add error state for NVM update state machine
This patch adds I40E_NVMUPD_STATE_ERROR state for NVM update.
Without this patch driver has no possibility to return NVM image write
failure.This state is being set when ARQ rises error.
arq_last_status is also updated every time when ARQ event comes,
not only on error cases.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
482f96aed9 net/i40e/base: remove duplicate definitions
We already define I40E_AQ_PHY_TYPE_EXT_25G* flags in the response adminq
structure above, and do not need to re-define these.

While we are here, replace 0X with 0x as normal style.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
37392dc7dc net/i40e/base: comment that UDP port must be in host order
The firmware expects the Port number to be in Little Endian format, and
the i40e_aq_add_udp_tunnel command clearly expects the udp_port variable
to be in Host order, as it uses CPU_TO_LE16(). It was recently
discovered in the Linux driver that we were passing a Big Endian port
number, which was therefor not enabling the UDP tunnel correctly.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
5f3b47c116 net/i40e/base: convert shift values to hex
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
c5846a125b net/i40e/base: fix NVM access interfering
Acquire NVM lock before reads on all devices.  Previously, locks were
only used for X722 and later.  Fixes an issue where simultaneous X710
NVM accesses were interfering with each other.

Fixes: 8db9e2a1b2 ("i40e: base driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
3bc39f5552 net/i40e/base: save link FEC info from link up event
Store the FEC status bits from the link up event into the
hw_link_info structure.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
ec3bd63e87 net/i40e/base: fix WoL failure on PF reset
By default the device clears all MAC filter information on PF Reset.
However, this will cause Wake-On-LAN to fail because the wake filters
are deleted on transition to D3 power state. To get around this,
firmware is adding functionality to preserve certain MAC filters during
PFR. These bits allow the driver tell the FW which filters to preserve.

Set the datalen field and add I40E_AQ_FLAG_BUF/I40E_AQ_FLAG_RD flags in the
desc struct for the WoL/Proxy AQ descriptors. The WoL/Proxy AQ commands
were failing because these were missing.

Fixes: 3c89193a36 ("i40e/base: support WOL config for X722")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
0a42d4b96d net/i40e/base: implement VSI full promiscuous mode
This patch implements a function to set a VSI to broadcast, multicast, and
unicast promiscuous mode all at once. This is specifically needed to set
the WoL/Proxy VSI created by FW to full promiscuous mode during power down
for WoL patterns and protocol offloads to function properly.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
a1427b1714 net/i40e/base: implement clear all WoL filters
This patch implements the clear Wake on LAN (WoL) filters admin queue
function which clears out ALL WoL patterns programmed into
the flex filters.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
36135ae094 net/i40e/base: adjust 25G PHY type values
Define the values for the 25G PHY type bit-fields that match
reported values from firmware. There was a gap in the bit
fields but no corresponding gap i40e_aq_phy_type enum.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
ee03e855eb net/i40e/base: use BIT macro instead of bit fields
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
af4cc2201b net/i40e/base: add FEC bits to PHY capabilities
Add FEC bits to the PHY capabilities AQ command struct. This is required
for 25GbE support. Change the name of the generic mod_type_ext field to
indicate that it is now used for handling FEC.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
87da72bd93 net/i40e/base: remove FPK HyperV VF device ID
Microsoft recently removed the requirement for VFs to use the VMBus.
The Fort Park Windows VF has been changed to use only the hardware
mailbox, so the Hyper-V VF device ID can be removed.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
1c8048b578 net/i40e/base: deprecate unused macro
I40E_MAC_X710 was supposed to be for 10G and I40E_MAC_XL710
was supposed to be for 40G. But i40e_set_mac_type() sets
I40E_MAC_XL710 for all device IDS. I40E_MAC_X710 is not
used at all. Thus deprecating this extra macro.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
b6902c166e net/i40e/base: replace memcpy
To align with current memcpy use, replace existing legacy memcpy() calls
with i40e_memcpy() calls.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
e19e16ad7a net/i40e/base: fix unknown PHYs incorrect identification
The PHY type value for unrecognized PHYs and cables was changed
based on firmware version number. Newer hardware use lower firmware
version numbers and this was causing some PHYs to be identified
as type 0x16 instead of 0xe (unknown).

Without this patch, newer card will incorrectly identify unknown
PHYs and cables.

This change adds hardware type to the check for firmware version
so the PHY type is reported correctly.

Fixes: 8db9e2a1b2 ("i40e: base driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
121962fe3a net/i40e/base: add protocols when discover capabilities
Add logical_id to I40E_AQ_CAP_ID_MNG_MODE capability starting from major
version 2.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
9d996cf596 net/i40e/base: add bus number info
Currently i40e_bus_info has PCI device and function info only. However
in log messages slot number (i.e hw->bus.device) is being printed
as bus number. Another field should be added to provide bus number
info and preserve existing information.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
c6dbfb7817 net/i40e/base: add clause22 and clause45 implementation
Some external PHYs require Clause22 and Clause45 method for
accessing registers. Mostly used for X722 support.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
5ce7d97b32 net/i40e/base: add media type detection for 25G link
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
75c3de654e net/i40e/base: fix long link down notification time
This patch fixes a problem where it could take a very
long time (>100 msec) to print the link down notification.
This problem is fixed by changing how often we update link
info from fw, when link is down. Without this patch, it can
take over 100msec to notify user link is down.

Fixes: e6691b428e ("i40e/base: fix PHY NVM interaction")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
bac253d42d net/i40e/base: group base mode VF offload flags
Group together the minimum set of offload capabilities that are always
supported by VF in base mode. This define would be used by PF to make
sure VF in base mode gets minimum of base capabilities.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
2551ed46ff net/i40e/base: fix bit test mask
Incorrect bit mask was used for testing "get link status" response.
Instead of I40E_AQ_LSE_ENABLE (which is actually 0x03) it should
be I40E_AQ_LSE_IS_ENABLED (which is defined as 0x01).

Fixes: 8db9e2a1b2 ("i40e: base driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
dd0f6fbf5e net/i40e/base: remove unnecessary code
This patch changes some assignments and removing the unnecessary
code to avoid error reported by static analysis tools.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
f808084798 net/i40e/base: fix flow control set for 25G
Add phy_type_ext copied from old setting to rpevents 25G PHY
types from being disabled when setting the flow control modes.

Fixes: 51131ae119 ("net/i40e/base: get PHY abilities for 25G")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Jingjing Wu
9710c12898 net/i40e/base: add encap checksum VF offload flag
Add ENCAP_CSUM offload negotiation flag. Currently VF assumes checksum
offload for encapsulated packets is supported by default. Going forward,
this feature needs to be negotiated with PF before advertising to the
stack. Hence, we need a flag to control it.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
2017-01-17 19:39:27 +01:00
Alejandro Lucero
0c19ca636e net/nfp: document supported features
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2017-01-17 19:39:27 +01:00
Ferruh Yigit
d49050a272 net/ixgbe: fix typo in comment
Fixes: c03fcee9ab ("ixgbe: remove CRC size from byte counters")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:39:27 +01:00
Ivan Malov
4a18304d24 net/sfc: restart TxQ in case of exception on event queue
Examples of recoverable exceptions because of Tx error are:
 - Tx descriptor PCI read error
 - invalid Tx option descriptor
 - Tx option descriptor not supported by the firmware variant
 - unexpected Tx option descriptor (e.g. missing FATSO2A before
   FATSO2B, missing FATSO2B after FATSO2A)
 - incomplete packet push (CONT bit set in the latest pushed DMA
   descriptor)

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
2017-01-17 19:39:27 +01:00
Andrew Rybchenko
77f2d0534d net/sfc: restart RxQ in case of exception on event queue
Examples of recoverable exceptions are:
 - unexpected Rx event (Rx scatter abort with non-zero size,
   too big Rx descriptors batch completed)
 - Rx error due to invalid Rx descriptors push
 - Rx error due to Rx descriptor read error (e.g. unmapped Rx ring
   and denied by IOMMU)

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
2017-01-17 19:39:27 +01:00
Ivan Malov
428c7ddd2f net/sfc: send bursts of packets
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:27 +01:00
Ivan Malov
fed9aeb46c net/sfc: implement transmit path start / stop
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:27 +01:00
Ivan Malov
b1b7ad933b net/sfc: set up and release Tx queues
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:27 +01:00
Ivan Malov
dbf0f6278f net/sfc: add function to check configured Tx mode
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:27 +01:00
Ivan Malov
a8ad8cf83f net/sfc: provide basic stubs for Tx subsystem
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:27 +01:00
Andrew Rybchenko
09a09b6f8b net/sfc: discard scattered packet on Rx correctly
Since Rx scatter is not supported, all scattered packets are discarded.
It is not always possible to disable scatter on Huntington, so we
should handle scattered packets correctly in any case.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
921f6cf18f net/sfc: implement device callback to Rx burst of packets
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
28944ac098 net/sfc: implement Rx queue start and stop operations
These functions should set the queue state in dev->data->rx_queue_state
array.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
dcc3285f07 net/sfc: validate Rx queue buffers setup
Check that Rx mbuf pool, MTU and Rx scatter config are in sync.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
0c7a0c35f2 net/sfc: calculate Rx buffer size which may be used
Take Rx buffer start alignment and end-padding into account.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
ce35b05c63 net/sfc: implement Rx queue setup release operations
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
976f2e5a0c net/sfc: check configured Rx mode
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
a8e64c6b45 net/sfc: implement Rx subsystem stubs
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Artem Andreev
886f8d8a05 net/sfc: retrieve link info
Signed-off-by: Artem Andreev <artem.andreev@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
03ed21195d net/sfc: minimum port control sufficient to receive traffic
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
2de39f4e13 net/sfc: periodic management EVQ polling using alarm
Timers cannot be used to implement periodic polling, since it implies
requirement on application to process timers in the main loop.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
9a75f75cb1 net/sfc: maintain management event queue
The event queue is required for device level events (e.g. link status
change) and flush events.
Provide thread-safe function to poll the event queue since it may be
really done from different contexts.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
98200dd9dd net/sfc: implement EVQ dummy exception handling
Right now the code just logs the exception and sets flag to notify
subsequent event handlers and poller that recovery is required.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00
Andrew Rybchenko
58294ee65a net/sfc: support event queue
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-01-17 19:39:26 +01:00