Commit Graph

54 Commits

Author SHA1 Message Date
Yong Wang
f58ca2f9ef net/e1000/base: fix multicast setting in VF
In function e1000_update_mc_addr_list_vf(), "msgbuf[0]" is used prior
to initialization at "msgbuf[0] |= E1000_VF_SET_MULTICAST_OVERFLOW".
And "msgbuf[0]" is overwritten at "msgbuf[0] = E1000_VF_SET_MULTICAST".

Fix it by moving the second line prior to the first one that mentioned
above.

Fixes: dffbaf7880 ("e1000: revert fix for multicast in VF")
Cc: stable@dpdk.org

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-04-04 15:52:50 +02:00
Santosh Shukla
e66eda1c24 net/e1000: use I/O device memory read/write API
Replace the raw I/O device memory read/write access with eal
abstraction for I/O device memory read/write access to fix
portability issues across different architectures.

CC: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-01-18 17:18:26 +01:00
Wenzhuo Lu
31d4210971 net/e1000/base: announce supported devices
Document all supported NICs.
Add Intel I219 NICs support in release note.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:38:40 +01:00
Wenzhuo Lu
5b9c39d0f9 net/e1000/base: update shared code version
Updated to 2016.11.22

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
4add08ffd0 net/e1000/base: support more I219 devices
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
daa998d977 net/e1000/base: disable force K1-off feature
MAC-PHY desync may occur causing misdetection of link up event.
Disabling K1-off feature can work around the problem.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
75a202f022 net/e1000/base: add workaround for possible stalled packet
This works around a possible stalled packet issue, which may occur due to
clock recovery from the PCH being too slow, when the LAN is transitioning
from K1 at 1G link speed.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
a3358d942f net/e1000/base: enable new I219 devices
Enable the support of new I219 devices.
Also define some registers for future usage.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
db33e69c2a net/e1000/base: add workaround for ULP entry flow
For I217 revision 6, when entering Ultra Low Power (ULP) we need to enable
Low Power Link Up (LPLU) and disable Gig speed to make it work.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
35f0408eff net/e1000/base: increase LANPHYPC low duration
LANPHYPC low duration of 10 usec was too low for some corner cases
causing interface mismatches during Ultra Low Power (ULP) exit.

This patch increases the LANPHYPC low duration to 1 msec.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
5d55afe895 net/e1000/base: clear ULP configuration register on ULP exit
There are some client PHY Ultra Low Power (ULP) register bits that are
configured by the Manageability Engine (ME) FW.

The driver must ensure that these bits are cleared on exit from ULP.
Ordinarily the ME FW would do that, but there are cases in which the
FW is not present, and the driver must handle that.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
5cda50e867 net/e1000/base: restore link speed after ULP exit
When Ultra Low Power (ULP) enabled, the client PHY needs to be set up
for link configuration after cable reconnected.

Previously link configuration was only done in auto-negotiate mode.

Do link configuration also in autoneg disabled mode.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
e181c96241 net/e1000/base: define max Rx jumbo frame size
Add definition MAX_RX_JUMBO_FRAME_SIZE for igb.

All igb parts (82575 and newer) have 9.5K max jumbo frame size.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
ecab0e4d5b net/e1000/base: expose I350 internal function
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
2359472d45 net/e1000/base: get FW version for I354
I354 support was missing in the e1000_get_fw_version() which resulted in
the FW version not being reported. Support added.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
bc043fb7c9 net/e1000/base: retry to get HW mailbox lock
The driver shouldn't give up if it fails to get the hardware mailbox lock.

This can happen in a situation where the PF-VF communication channel is
heavily loaded and causes complete communications failure between the PF
and VF drivers.

Add a counter and a delay. The driver will now retry ten times,
waiting one millisecond between retries.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
8cce758d69 net/e1000/base: avoid packet loss for non-1G
To avoid packet loss, Phase Lock Loop (PLL) clock gate time needs to be
increased for non 1G speeds.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Wenzhuo Lu
02fc2241b1 net/e1000/base: increase ULP timer
With new hardware (I219), Ultra Low Power (ULP) exit takes significantly
longer time. Therefore, driver must wait longer.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-17 19:36:48 +01:00
Markos Chandras
d5e39d1ca4 net/e1000/base: fix build with gcc 6
Add the missing braces to the 'if' statements to fix the misleading
identation. This also fixes the following build errors when building
with gcc >= 6:

drivers/net/e1000/base/e1000_phy.c:4156:2:
error: this 'if' clause does not guard... [-Werror=misleading-indentation]
    if (locked)

drivers/net/e1000/base/e1000_phy.c:4158:3:
note: ...this statement, but the latter is misleadingly indented as if
it is guarded by the 'if'
    if (!ready)

drivers/net/e1000/base/e1000_phy.c:4221:2:
error: this 'if' clause does not guard... [-Werror=misleading-indentation]
    if (locked)

drivers/net/e1000/base/e1000_phy.c:4223:3:
note: ...this statement, but the latter is misleadingly indented as if
it is guarded by the 'if'
    if (!ready)

Signed-off-by: Markos Chandras <mchandras@suse.de>
2016-06-27 17:03:30 +02:00
Ravi Kerur
1da352d62e e1000: support I217 and I218 devices
Modified driver and eal code to support I217 and I218 Intel NICs.

Compiled and tested (via testpmd) on Ubuntu 14.04 for target
	x86_64-native-linuxapp-gcc
Compiled for target x86_64-native-linuxapp-clang

Signed-off-by: Ravi Kerur <rkerur@gmail.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 16:57:48 +01:00
Wenzhuo Lu
d5f46be3d5 e1000/base: minor changes
Some minor code change. No functionality impact.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:20:37 +01:00
Wenzhuo Lu
b496406489 e1000/base: allow both ULP and EEE in Sx state
This patch implements a modified flow that allows both ULP and EEE
in Sx (Sticky mode).

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:20:37 +01:00
Wenzhuo Lu
ed8ebafe98 e1000/base: synchronize PHY interface on non-ME systems
On power up, the MAC - PHY interface needs to be set to PCIe, even if
cable is disconnected.  In ME systems, the ME handles this on exit from
Sx(Sticky mode) state. In non-ME, the driver handles it. Added a check
for non-ME system to the driver code that handles that.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:20:37 +01:00
Wenzhuo Lu
6e0ca097b5 e1000/base: increase timeout of reset check
Previously, in check_reset_block RSPCIPHY was polled for 100 ms before determining
that the ME veto is set. This needed to be increased to 300 ms.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:57 +01:00
Wenzhuo Lu
53c2e4a19e e1000/base: initialize 88E1543 PHY
The initialization process for 88E1543 PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:57 +01:00
Wenzhuo Lu
c35be7b211 e1000/base: disable IPv6 extension header parsing
All 1G Server products need to have IPv6 extension headers turned off.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:57 +01:00
Wenzhuo Lu
4bff263d54 e1000/base: prevent ULP flow if cable connected
Enabling ulp on link down when cable is connect caused an infinite
loop of linkup/down indications in the NDIS driver.
After discussed, correct flow is to enable ULP only when cable is
disconnected.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:57 +01:00
Wenzhuo Lu
24a9b538ad e1000/base: add flags to set EEE advertisement modes
Requires driver changes!

Change e1000_set_eee_i350 and e1000_set_eee_i354 to have flags allowing
changes in the advertised EEE speeds.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:57 +01:00
Wenzhuo Lu
849651f863 e1000/base: support inverted format ETrackId
There are some images which contain ETrackID in inverted format. This patch
allows reading this format.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:57 +01:00
Wenzhuo Lu
5b6439cf03 e1000/base: support different EEARBC for i210
EEARBC has changed on i210. It means EEARBC has a different address on
i210 than on other NICs. So, add a new entity named EEARBC_I210 to the
register list and make sure the right one is being used on i210.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:57 +01:00
Wenzhuo Lu
75a7f9cfdd e1000/base: add bit to disable packetbuffer read
Added bit FEXTNVM7[18], that controls disabling MAC packet buffer read.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:57 +01:00
Wenzhuo Lu
9fa668f29b e1000/base: add defaults for i210 Rx/Tx PBSIZE
These are the defaults for the packet buffer size registers that need to
be explicitly set back if someone changes them and comes back to a normal
driver.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:57 +01:00
Wenzhuo Lu
6f934fa24d e1000/base: fix K1 configuration
This patch is for the following updates to the K1 configurations:
Tx idle period for entering K1 should be 128 ns.
Minimum Tx idle period in K1 should be 256 ns.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:56 +01:00
Wenzhuo Lu
923efe61c3 e1000/base: fix link detect flow
In case that auto-negotiate is not enabled, call
e1000_setup_copper_link_generic instead of e1000_phy_setup_autoneg.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:56 +01:00
Wenzhuo Lu
975ba6912f e1000/base: fix link check for i354 88E1112 PHY
e1000_check_for_link_media_swap() is supposed to check PHY page 0 for
copper and PHY page 1 for "other" (fiber) link. We switched back from
page 1 to page 0 too soon, before e1000_check_for_link_82575() is
executed and we were never finding link on fiber (other).

Note: The precedence of link type is controlled by the PHY settings.

If the link is copper, as the M88E1112 page address is set to 1, it should be
set back to 0 before checking this link.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:56 +01:00
Wenzhuo Lu
42cdc7e460 e1000/base: fix beacon duration for i217
Fix for I217 Packet Loss issue - The Management Engine sets the FEXTNVM4
Beacon Duration incorrectly.  This fix ensures that the correct value will
always be set. Correct value for this field is 8 usec.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:56 +01:00
Wenzhuo Lu
127ee2cafe e1000/base: fix TIPG for non 10 half duplex mode
TIPG value is increased when setting speed to 10 half to prevent
packet loss. However, it was never decreased again when speed
changes. This caused performance issues in the NDIS driver.
Fix this to restore TIPG to default value on non 10 half.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:56 +01:00
Wenzhuo Lu
e6c005f711 e1000/base: fix reset of DH89XXCC SGMII
For DH89XXCC_SGMII, write flush leaves registers of this device trashed
(0xFFFFFFFF). Added check for this device.
Also, after both for Port SW Reset and Device Reset case, platform should
wait at least 3ms before reading any registers. Since waiting is
conditionally executed only for Device Reset - removed the condition.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:56 +01:00
Wenzhuo Lu
b4e5e60cbe e1000/base: fix EEPROM access for i210
The i210 has two EEPROM access registers that are located in
non-standard offsets: EEARBC and EEMNGCTL. EEARBC was fixed previously
and EEMNGCTL should also be corrected.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 16:12:56 +01:00
Wenzhuo Lu
9896a25392 e1000/base: fix redundant PHY power down for i210
The wrong bit is being used in PHYREG16 for PHY power down. In addition,
the use of PHYREG 16 is unnecessary if bit 11 of PHYREG 0 is used.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 14:20:24 +01:00
Wenzhuo Lu
f26b979166 e1000/base: fix jumbo frame CRC failures
This is a patch to change the value of register 776.20[11:2] for jumbo
mode from 0x1A to 0x1F. This is to enlarge the gap between read and
write pointers in the TX Fifo.
And replace the magic number with a macro by the way.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 14:20:24 +01:00
Wenzhuo Lu
edcdb3c5f7 e1000/base: fix link flap on 82579
Several customers have reported a link flap issue on 82579. The symptoms
are random and intermittent link losses when 82579 is connected to specific
switches. Issue has been root caused as interoperability problem between
the NIC and at least some Broadcom PHYs in the Energy Efficient Ethernet
wake mechanism.
To fix the issue, we are disabling the Phase Locked Loop shutdown in 100M
Low Power Idle. This solution will cause an increase of power in 100M EEE
link. It may cost additional 28mW in this specific mode.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 14:20:24 +01:00
Wenzhuo Lu
ea613aefc2 e1000/base: return error in resume workaround
Add u32 return value to function e1000_resume_workarounds_pchlan,
so that calling function can detect PHY access failure during resuming
flow.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 14:20:24 +01:00
Wenzhuo Lu
32c646d6d2 e1000/base: check more errors for ESB2 init and reset
Adding code where missing to handle case where calls to
e1000_read_kmrn_reg_80003es2lan and e1000_write_kmrn_reg_80003es2lan return
an error value.
Also, when accessing the E1000_KMRNCTRLSTA_INBAND_PARAM offset to disable
far-end loopback on 80003es2lan devices, make the handling of a read or
write failure consistent between hw_init and hw_reset.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 14:20:24 +01:00
Wenzhuo Lu
a70cf8c3ee e1000/base: check more NVM read errors
Adding code to a case where e1000_nvn_read is called, but there is no
consideration for when the read fails (returns an error code).
Also, this patch adds an error message to a base NVM reading function that
is missing it for consistency.
This patch is not covering all cases of these conditions, it only covers
the code used by the e1000e driver.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 14:20:24 +01:00
Wenzhuo Lu
939d7978bd e1000/base: return code after setting receive address register
Previously, the rar_set functions were of type void, and when they failed
to program an address register they would, at most,  put a message into
the log and end.  The fact that they failed to program an address into a
address register, if checked for, should be captured and passed back to
the caller so that the drivers can deal with the situation (or not) as
they deem best.
Drivers can ignore or use the return value.  No change to base drivers
is mandated by this change unless a driver wants to handle the failure
to program an address register (e.g. evaluate the return value).

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 14:20:24 +01:00
Wenzhuo Lu
bf36acdc7d e1000/base: remove useless return variables
Although this change should be optimized out by the compiler, just
return a constant directly rather than declare a variable.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 14:20:24 +01:00
Wenzhuo Lu
3c027139fe e1000/base: remove obsolete comment
The "FIXME" comment is revomed from e1000_acquire_swfw_sync_80003es2lan
but forgotten being removed from e1000_acquire_swfw_sync_82575 while
the similar changes were made to both.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 14:20:24 +01:00
Wenzhuo Lu
cdef79acc2 e1000/base: cleanup unused tag
Remove all NAHUM6LP_HW tags.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 14:20:23 +01:00
Wenzhuo Lu
71ddb0b93c e1000/base: apply paranoia to macro arguments
Macro arguments need to be in parens since we can pass in expressions.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 14:00:36 +01:00