Commit Graph

248 Commits

Author SHA1 Message Date
Wenzhuo Lu
8bdbca1345 ixgbe/base: use a semaphore to serialize X550 IOSF accesses
Because each IOSF access requires the use of multiple registers,
use a semaphore to serialize those accesses.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:05 +02:00
Wenzhuo Lu
bde42a2209 ixgbe/base: add wait helper for X550 IOSF accesses
Add a helper function to wait for IOSF accesses to complete. Also
perform this wait before each access, as specified in the datasheet.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:05 +02:00
Wenzhuo Lu
2bbe36aaa0 ixgbe/base: add macros for X550em bus speed fuse
x550em has two different bus speeds, 300 MHz and 400 MHz.
A bit in a fuse register tells which it is, with a 1 meaning
the bus is running at 300 MHz.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:04 +02:00
Wenzhuo Lu
75a43979c7 ixgbe/base: fix X550em UniPHY link configuration
In UniPHY we have 2 IOSF targets that are UniPHY related. We can
write to PHY and PCS. In earlier times I've been told that there
were 2 separate PCS targets for IOSF commands and that's why I
implemented it with 2 defines and adding hw->bus.lan_id, but lately
I confirmed with HW that FW takes care of which PCS "slice" we are
talking to and is directing writes to correct one, so KX4_PCS1
target is dead now and we cannot use it.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:04 +02:00
Wenzhuo Lu
caab86b897 ixgbe/base: power down the X550em PHY on overtemp event
This patch powers down the x550em PHY on over-temp events. The
PHY firmware is supposed to do this autonomously but that isn't
implemented. The short-term stop-gap solution is for SW to power
down the PHY when it reports an overtemp event.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:04 +02:00
Wenzhuo Lu
6aeec66c4c ixgbe/base: check X550em SFP support
This patch adds identify SFP module support for x550em. x550em
support returns an error for SFP module types not supported by
x550em design.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:04 +02:00
Wenzhuo Lu
ac0fdeca93 ixgbe/base: fix X550em link setup without SFP
This patch updates the x550em SFP link setup by adding
ixgbe_sfp_type_unknown and ixgbe_sfp_type_not_present case expression
to the ixgbe_setup_mac_link_sfp_x550em SFP type switch statement. This
handles the case when no module is present.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:04 +02:00
Wenzhuo Lu
cf1be1167c ixgbe/base: fix uninitialized variable
Fix the warning caused by an uninitialized variable which might have
been used.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:04 +02:00
Wenzhuo Lu
c54ef7c59a ixgbe/base: fix X550em SFP+ link stability
Configure the CS4227 correctly for both 1G and 10G operation,
by moving the code to ixgbe_setup_mac_link_sfp_x550em(). It
needs to be in this function because we need both the module
type and the speed, and this is the only function in the init
flow that knows the speed. In contrast,
ixgbe_setup_sfp_modules_X550em() does not know the speed, so we
can't do anything useful here. This is a fundamental difference
from the 82599 flow.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:04 +02:00
Wenzhuo Lu
10f1868bac ixgbe/base: restore advertised autoneg after setting X550em LPLU
On systems that support LPLU in the firmware, the driver wouldn't be
aware of the LPLU speed change, and it wouldn't cache the new value when
the driver resumes. This patch emulates the same behavior by restoring
the previous autoneg settings to autoneg_advertised.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:04 +02:00
Wenzhuo Lu
bc07947332 ixgbe/base: update X550em LPLU
This patch updates x550em LPLU (Low Power Link Up) to use the
MAC ops setup_link function pointer.
This removes redundant code and provides iXFI and KR support
between internal and external PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:04 +02:00
Wenzhuo Lu
69651bbfcb ixgbe/base: release X540 semaphores in proper order
Because we acquire two semaphore bits before setting the SWFW_SYNC
register, we should release them in the reverse order that they
were acquired.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:04 +02:00
Wenzhuo Lu
dac9552bb9 ixgbe/base: fix X550 PCIe master disabling
This patch skips the PCI transactions pending check in
ixgbe_disable_pcie_master. The PCI transactions pending bit sticks high
when there were pending transactions, we should wait and then continue
with our reset flow.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:04 +02:00
Wenzhuo Lu
28e8a033f5 ixgbe/base: fix speed comments
This patch fixes comment description for setting 2.5G and 5G speeds in
ixgbe_setup_phy_link_generic.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:58:04 +02:00
Wenzhuo Lu
a07c83fcca ixgbe/base: add a shift constant for EEE
Adds define for the number of bits needed to shift the EEE_SU register
in order to get the value of TEEE_DLY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:42:18 +02:00
Wenzhuo Lu
270c4f7758 ixgbe/base: change register definition code style
This path changes ((P == 0) ? (<value for port 0>) : (<value for port 1>))
register definition into ((P) ? <value for port 1> : <value for port 0>)
style.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 12:42:16 +02:00
Wenzhuo Lu
73a601f53f ixgbe/base: update readme
Update readme file to show the version of the base code.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-26 11:37:18 +02:00
Cyril Chemparathy
82be8d5442 mbuf: use offset macro
This patch simply applies the transform previously committed in
scripts/cocci/mtod-offset.cocci.  No other modifications have been
made here.

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-06-24 12:01:14 +02:00
Cyril Chemparathy
7621d6a8d0 eal: add and use unaligned integer types
On machines that are strict on pointer alignment, current code breaks
on GCC's -Wcast-align checks on casts from narrower to wider types.
This patch introduces new unaligned_uint(16|32|64)_t types, which
correctly retain alignment in such cases.  Strict alignment
architectures will need to define CONFIG_RTE_ARCH_STRICT_ALIGN in
order to effect these new types.

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-06-24 12:00:41 +02:00
Bruce Richardson
9c6dfcb720 ring: fix return of new port id on creation
The rte_eth_from_rings API allowed the creation of an ethdev port at
runtime using rte_rings as the underlying storage. However, the return
value from this function was either 0 or -1, and these values were never
actually documented in the API documentation. Unfortunately, the programmers
guide doc examples for this API implied that the return value from this
function was the port id of the newly created ethdev.

Since this latter behaviour is more useful - and already implied by the
documentation, this patch changes the return 0 to "return
data->port_id". It also adds in doxygen comments for the function so it
can be correctly documented in the API reference.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2015-06-22 17:33:23 +02:00
Shaopeng He
5e73a1269b fm10k: fix mac/vlan filtering
This patch includes 3 changes related to MAC/VLAN address table
when the system (e.g. testpmd) is started and closed:
 - remove default MAC address with fixed VLAN 0 which was for the
   debug purpose before the MAC/VLAN filter function was implemented.
 - enable VF MAC/VLAN filter for the first valid MAC address
   and first valid VLAN ID. This is needed for system (e.g. testpmd)
   to setup default MAC address and default VLAN for VF.
   Later attempt to change these default value will be refused by
   under layer shared code and PF host functions.
 - un-register any combination of VLAN and MAC address from fm10k
   switch side MAC table when the system (e.g. testpmd) is closed.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:59 +02:00
Shaopeng He
4f7d9e383e fm10k: update vlan offload features
Fm10k PF/VF does not support QinQ; VLAN strip and filter are always on
for PF/VF ports.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-06-22 17:27:59 +02:00
Shaopeng He
f28dd9f43b fm10k: add mac filtering
MAC filter function was newly added, each PF and VF can have up to
64 MAC addresses.
VF filter needs support from PF host, which is not available now.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-06-22 17:27:59 +02:00
Shaopeng He
2e58464ca9 fm10k: update mac table with vlan filtering
VLAN filter was updated to add/delete one static entry in MAC table for
each combination of VLAN and MAC address. More sanity checks were added.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-06-22 17:27:59 +02:00
Chen Jing D(Mark)
f5c1a236a2 fm10k: fix default mac/vlan in switch
Since the communication between PF/Switch Manager, VF/PF is
asynchronous through mailbox, it's hard to determine when Switch
Manager/PF host will send the default vlan to PF/VF. So, it's
necessary to set default vlan until the device is started.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:59 +02:00
Chen Jing D(Mark)
a66ce098e8 fm10k: check mac address
After acquiring MAC address from HW, it's necessary to validate
MAC address before use.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:59 +02:00
Chen Jing D(Mark)
13cbb05d89 fm10k: fix switch synchronization
In fm10k, PF driver needs to communicate with switch through
mailbox if it needs to add/delete MAC address.
This fix will validate if switch is ready before going forward.
Then, it is necessary to acquire LPORT_MAP info after issuing
MAC addr request to switch.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:59 +02:00
Chen Jing D(Mark)
bb9e1c066a fm10k: fix Tx multi-segment frame
In TX side, bit FM10K_TXD_FLAG_LAST in TX descriptor only is set
in the last descriptor for multi-segment packets. But current
implementation didn't set all the fields of TX descriptor, which
will cause descriptors processed now to re-use fields set in last
scroll. If FM10K_TXD_FLAG_LAST bit was set in the last round and
it happened this is not the last descriptor of a multi-segnment
packet, HW will send out the incomplete packet out and leads to
data intergrity issue.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:58 +02:00
Chen Jing D(Mark)
bd9ada24da fm10k: fix jumbo frame issue
fm10k can't receive frame greater than 1536 and Scatter RX
function can't work correctly. The root cause is
SRRCTL.FM10K_SRRCTL_BUFFER_CHAINING_EN bit is not enabled.

Test report: http://dpdk.org/ml/archives/dev/2015-June/019242.html

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:58 +02:00
Chen Jing D(Mark)
a6912bbf3e fm10k: fix Rx buffer size
As RX buffer is aligned to 512B within mbuf, some bytes are reserved
for this purpose, and the worst case could be 511B. But SRR reg
assumes all buffers have the same size. In order to fill the gap,
we'll have to consider the worst case and assume 512B is reserved.
If we don't do so, it's possible for HW to overwrite data to next
mbuf.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:58 +02:00
Chen Jing D(Mark)
829db9e181 fm10k: fix maximum queue number for VF
Both PF and VF shared code in function fm10k_stats_get().
The function works well with PF, but has problem with VF since
VF has less queues than PF.

Fixes: a6061d9e70 ("fm10k: register PF driver")

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:58 +02:00
Chen Jing D(Mark)
87afbbc7ca fm10k: remove mbuf size sanity check
Original implementation required mbuf size should be greater than
ETHER_MAX_VLAN_FRAME_LEN, which is not necessary. If it's less
than that value, scatter function will be selected and incoming
packets greater than mbuf size will be filled into several mbufs.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:58 +02:00
Chen Jing D(Mark)
df02ba8646 fm10k: support promiscuous mode
Add functions to support promiscuous/allmulticast enable and
disable.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
2015-06-22 17:27:58 +02:00
Wenzhuo Lu
5d0d789279 ixgbe: fix X550 copper link
For there're only laser ports on x550 before, we only considered laser
ports for the testpmd CLIs "port start/stop ...". Now we have new x550
devices which have copper ports. Use the API for copper to enable/disable
these ports.

And also let the testpmd CLI "set link-up/down ..." support copper
ports.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-06-22 17:27:58 +02:00
Didier Pallard
4feec2f44b ixgbe: fix TSO in IPv6
When TSO is used with IPv6, generated frames are incorrect.
L4 frame is OK, but length field of IPv6 header was not populated correctly.

IXGBE_ADVTXD_TUCMD_IPV6 flag is set for better readability, even if it
does nothing.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-22 16:59:08 +02:00
Sergio Gonzalez Monroy
1c2bbcdfd7 ixgbevf: fix link status for PF up/down events
Current ixgbe VF base driver only really read the status register when:
 - get_link_status is true
 - link reset
 - mailbox timeout.

We only set get_link_status to true when we start the PF/VF, so
following calls to ixgbe_dev_link_update will just keep the old link
status unless the link has been reset.

Because of this behaviour, when the link status of the PF changes after
the VF has been initialized, we do not read the current status register
from the nic and instead we just keep the old link status.

Fix the problem by setting this field to true before calling
ixgbe_check_link function from base driver. We don't need to check after
this call for get_link_status anymore, so remove it.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2015-06-22 12:16:49 +02:00
Sergio Gonzalez Monroy
9884a5e6eb ixgbevf: fix Rx function selection
The logic to select ixgbe VF RX function is different than PF side.

There are a few issues with its current state:
 - it does not allow to select ixgbe_recv_pkts_vec among other options.
 - it can cause memory corruption for scatter mode as it does not allocate
   enough entries in sw_ring.
 - when checksum is enabled, incorrect vector RX function is selected.

To solve above issues, change the VF RX function selection logic to
mimic PF side.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-06-22 12:04:27 +02:00
Jingjing Wu
49b03b18b3 ixgbe: fix flow director flexbytes offset
The flexbytes offset can not be set, because the value is over written
when fdir is enabled.
This patch fixes this issue, and also removes some reduplicate lines.

Fixes: d54a988826 ("ixgbe: support flexpayload configuration of flow director")

Reported-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2015-06-22 11:56:24 +02:00
Wenzhuo Lu
dc0c16105d ixgbe: fix X550 flow director check
On x550, flow director doesn't support other IP packets directly.
If we want to monitor IP other packets, the L4 protocol and ports must
be masked. It means, on x550, if we want to add a flow director filter
for other IP packets, a flow director mask must have been configed to
mask L4 protocol and ports.

Return err when the user try to config a flow director filter for other
IP packets without flow director mask configed before. And print err log
for it.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2015-06-15 22:56:12 +02:00
Wenzhuo Lu
669bc48bd9 ixgbe/base: restrict EEE to X550em KR backplane
This patch sets the setup_EEE function pointer to NULL for the
interfaces which do not support EEE (Energy Efficient Ethernet).
Currently only the KR backplane interface (0x15AB) supports EEE.
Setting this pointer to NULL prevents EEE registers from being
incorrectly modified and gives base drivers a flag to check for
EEE support.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:54 +02:00
Wenzhuo Lu
39592ace2f ixgbe/base: add X550em PHY reset
This patch adds x550em PHY reset function ixgbe_reset_phy_t_X550em.
ixgbe_reset_phy_t_X550em calls the reset PHY generic, and then enables
the x550em PHY LASI(Link Alarm Status Interrupt) interrupts.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:54 +02:00
Wenzhuo Lu
29b00dc3c1 ixgbe/base: fix lan id before first i2c access
Set the lan_id before the first I2C access. The existing call was
clearly being done after a previous I2C access in the same function
and that can't be right, so call the set_lan_id method earlier. At
this point it probably doesn't matter for this QSFP function, but
it makes sense to do it consistently anyway.

On X550, be sure to set the lan_id before using it to configure the
mux control output, else the mux will not be controlled.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:54 +02:00
Wenzhuo Lu
480b9a64ba ixgbe/base: fix lan id for X550em
The introduction of ixgbe_get_bus_info_X550em failed to call the
set_lan_id method to set the func and lan_id and deal with port-
swapped configurations. Add the call to resolve the problem.

Fixes: 4cf0bb32a9 ("ixgbe/base: get X550 bus info")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:53 +02:00
Wenzhuo Lu
a4c1aaf3c6 ixgbe/base: add X550em link check
This patch adds ixgbe_check_link_t_X550em for checking x550em
PHY link. We check that both the MAC and external x550em PHY have link.
This is to avoid a false link up between the internal and external PHY
when the external PHY doesn't have link.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:53 +02:00
Wenzhuo Lu
842247cac5 ixgbe/base: add X550em PHY interrupt and forced speeds
This patch adds x550em external PHY interrupt and forced 1G/10G
support. Support includes enabling and handling Link Status
Change and Thermal Sensor interrupt. ixgbe_handle_lasi has been added
to the API for handling the interrupts received from x550em PHY.
ixgbe_enable_lasi_ext_t_x550em and ixgbe_get_lasi_ext_t_x550em have been
added to X550em to enable mask and check interrupt flags for x550em PHY.

Forced 1G/10G link speed is handled via ixgbe_setup_mac_link_t_X550em.
ixgbe_setup_mac_link_t_X550em sets up the internal PHY and
external PHY link to either 10G or 1G based on the user selected auto
advertised link speed setting. Then sets up the external PHY auto
advertised link speed.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:53 +02:00
Wenzhuo Lu
9c7b19c17b ixgbe/base: add X550em autoneg flow control
This patch adds x550em Auto neg Flow Control support to
ixgbe_device_supports_autoneg_fc and sets the x550em setup_fc function
pointer to ixgbe_setup_fc_generic. ixgbe_setup_fc_generic is used for
x550em because flow control is setup on the external PHY via MDIO, when
ixgbe_setup_fc_X550em sets up flow control on the internal PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:53 +02:00
Wenzhuo Lu
54128402f4 ixgbe/base: rework X550em PHY setup function
This patch cleans up the ixgbe_setup_internal_phy_ x550em() function as follows:
 - Renames it to ixgbe_setup_internal_phy_t_x550em to clarify that it is
   specific to copper
 - Returns an error if called for non-copper devices
 - Corrects the comments
 - Removed the LASI(Link Alarm Status Interrupt) status register checks as
   this was incorrect and never worked correctly anyway.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:53 +02:00
Wenzhuo Lu
b7453742a9 ixgbe/base: fix init handling of X550em link down
This patch changes the return value for ixgbe_setup_internal_phy_t_x550em
when link is down to IXGBE_SUCCESS.
The driver will call ixgbe_setup_internal_phy_t_x550em when a link status
change is reported. The links status change can occur on link up or link
down, and if the link status change is for link down then there is no iXFI
setup necessary and no error condition needs to be returned.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:53 +02:00
Wenzhuo Lu
2c8ee5af0b ixgbe/base: move i2c mux function for X550em
The following patch moves the handling of the I2C MUX (which is only
used for x550em SFP+ devices) out of the ixgbe_x540.c file and
into the ixgbe_x550.c file where it belongs.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:53 +02:00
Wenzhuo Lu
ade9b24847 ixgbe/base: new simplified X550em init flow
The init flow is simplified. We no longer wait for the PHY FW init
complete bit to be set as this bit is only set once by the PHY at power
on and then cleared on the first read. So only the first instance of
running SW (or possibly MAC FW) needs to initialize the PHY.

The PHY initialization has been simplified and now only requires that
the PHY FW be "un-stalled". SW no longer needs to put the PHY in
low-power mode or enable the transceiver.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:53 +02:00
Wenzhuo Lu
3fc884897a ixgbe/base: fix X550em flow control for KR backplane
For the KR backplane which is different from other backplane,
in that we can't use auto-negotiation to determine the
mode. Instead, use whatever the user configured.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:53 +02:00
Wenzhuo Lu
64b91e05b1 ixgbe/base: add X550em LPLU support
This patch adds SW Low Power Link Up (LPLU) support for x550em PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:53 +02:00
Wenzhuo Lu
f3430431ab ixgbe/base: add SFP+ dual-speed support
This patch adds SFP+ dual-speed support.
82599 fiber link code was moved from ixgbe_82599.c to ixgbe_commom.c
for use by X550em, and the API was updated to support the common code
usage. SFP MAC link code is added to x550em.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:44:53 +02:00
Wenzhuo Lu
d4c9ffd4fe ixgbe/base: disable X550em FEC to save power
The FEC (Forward Error Correction) feature can improve BER (Bit Error Rate)
but uses more power to do so. It also cannot be used with
EEE (Energy Efficient Ethernet).
EEE is an important feature, and we have no known BER issues, so FEC
is not needed.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:42:44 +02:00
Wenzhuo Lu
e9c72a4129 ixgbe/base: fix X550em mux after MAC reset
The I2C mux control relies on the SDP setting in the ESDP register
so it is necessary to restore the value after a MAC reset. So,
put the code in a function so it can be used in more than one place.

Fixes: d2e72774e5 ("ixgbe/base: support X550")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:42:38 +02:00
Wenzhuo Lu
937e5f5b25 ixgbe/base: reset X550em CS4227 when needed
On some hardware platforms, the CS4227 does not initialize properly.
Detect those cases and reset it appropriately.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:42:34 +02:00
Wenzhuo Lu
241d31f473 ixgbe/base: issue firmware command when resetting X550em
The driver now needs to issue a firmware command to inform the
firmware that a driver is coming up. This prevents the possibility
of the firmware and the driver configuring the PHY at the same
time. Upon completion of the command, the firmware will no longer
be configuring the PHY.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 22:42:30 +02:00
Wenzhuo Lu
487b329e5e ixgbe/base: reduce i2c retry count for X550
A retry count of 10 is likely to run into problems on X550 devices
that have to detect and reset unresponsive CS4227 devices. So,
reduce the I2C retry count to 3 for X550 and above. This should
avoid any possible regressions in existing devices.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 18:24:40 +02:00
Wenzhuo Lu
7e61e847c1 ixgbe/base: provide unlocked i2c methods
Most I2C accesses take and release semaphores for each access. It's
also necessary to perform multiple I2C operations under the same
holding of the semaphore, so provide unlocked I2C methods for that
purpose.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 18:24:40 +02:00
Wenzhuo Lu
44d15731e3 ixgbe/base: remove useless function
Remove the function which is not called by the drivers.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 18:24:40 +02:00
Wenzhuo Lu
5f79e8a7ce ixgbe/base: fix tunnelled UDP and TCP frames in flow director
All bits in FDIRTCPM and FDIRUDPM are set to 1 when
ixgbe_fdir_set_input_mask_82599 is called. Not settings these bits will cause
TCP and UDP packets to be filtered out when NVGRE or VXLAN mode is enabled.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 18:24:40 +02:00
Wenzhuo Lu
683a2c8a28 ixgbe/base: check return value after calling
This patch moves the check of the return value from
ixgbe_start_hw_generic after the function is called.
Previously we had the code to disable relaxed ordering in
between, which seems a bit out of place.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 18:24:40 +02:00
Wenzhuo Lu
17e80ad00f ixgbe/base: fix typos
Remove the redundant "from".

There's a typo in the code comment for FC end
of Frame Exception (FCEOFe/IPE), so fixed the typo.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 18:24:02 +02:00
Wenzhuo Lu
cd417874b2 ixgbe/base: update copyright and readme
Update copyright in every file.
Update README file.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-15 17:52:36 +02:00
Nelio Laranjeiro
d6145abec4 mlx4: fix 32-bit build
Fix warning messages "cast to pointer from integer of different size" when
compiling DPDK in 32 bit with Mellanox PMD.

SGE addresses are 64 bit integers, converting them to pointers must be done
through uintptr_t to avoid compilation warnings when those have a different
size.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2015-06-12 17:38:14 +02:00
Ivan Boule
d4f891b5fc ixgbe: add multicast MAC address filtering
Support the function "set_mc_addr_list" in the "ixgbe" and in the
"ixgbe-vf" Poll Mode Drivers.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
2015-06-12 15:55:38 +02:00
Ivan Boule
23138c4a88 e1000: add multicast MAC address filtering
Support the PMD function "set_mc_addr_list" in the "igb", "igb-vf",
and "em" Poll Mode Drivers.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
2015-06-12 15:55:38 +02:00
Damjan Marion
9e71668b42 virtio: fix crash if CQ is not negotiated
Fix NULL dereference if virtio control queue is not negotiated.

Signed-off-by: Damjan Marion <damarion@cisco.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2015-06-12 14:50:06 +02:00
Stephen Hemminger
d78deadae4 virtio: fix ring size negotiation
Negotiate the virtio ring size. The host may allow for very large
rings but application may only want a smaller ring.
Conversely, if the number of descriptors requested exceeds the virtio
host queue size, then just silently use the smaller host size.

This fixes issues with virtio in non-QEMU envirionments.
For example Google Compute Engine allows up to 16K elements
in ring.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:44:59 +02:00
Stephen Hemminger
4a92b67151 virtio: clarify feature bit handling
Change the features from bit mask to bit number. This allows the
DPDK driver to use the definitions from Linux (yes the header
files already use a license compatiable with DPDK). This makes DPDK
driver handle future feature bit changes.

Get rid of double negative code in the feature bit intialization.
Instead just have a new define with the list of feature bits implemented.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:43:40 +02:00
Stephen Hemminger
2704623620 virtio: do not set mac table unless negotiated
Don't attempt to set the MAC address table unless the host allows
it in feature negotiation. Also, don't return a value from mac_table_set
since all callers ignore the return value.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:40:15 +02:00
Stephen Hemminger
e9e414a41a virtio: do not enable/disable Rx modes unless supported
If negotiation with host says that controlling Rx mode is
not supported, then don't try.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:36:38 +02:00
Stephen Hemminger
4ecce8356e virtio: remove blank lines
Putting blank line between function and following conditional
just wastes screen space, and makes code less obvious.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:35:10 +02:00
Stephen Hemminger
6c52c126f2 drivers: explicit initialization of pci drivers
Upcoming drivers will need to be able to support other bus types.
This is a transparent change to how struct eth_driver is initialized.
It has not function or ABI layout impact, but makes adding a later
bus type (Xen, Hyper-V, ...) much easier.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-12 11:10:10 +02:00
Stephen Hemminger
a84b014cb5 drivers: fix whitespace
Note: ignored whitespace issues in base (external code).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-12 11:10:10 +02:00
Stephen Hemminger
ce6bc60c57 vmxnet3: fix spelling
Fix spelling errors in strings and comments.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2015-06-11 14:19:38 +02:00
Helin Zhang
c1715402df i40evf: fix jumbo frame support
It wouldn't check the configured maximum packet length, and then
the scattered receiving function wouldn't be selected at all even
if it wants to receive a jumbo frame. The fix is to select the
correct RX function according to the configurations.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2015-06-04 12:01:56 +02:00
Stephen Hemminger
e46e3ba5f0 bonding: remove useless memset
Remove 2 unneeded memset's.  The info area is already cleared rte_eth_dev_info_get
and the statistics buffer is cleared by rte_eth_stats_get

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-04 10:46:45 +02:00
Stephen Hemminger
8ade036008 null: remove useless memset
The stats area is already cleared before calling eth_stats_get().

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-04 10:46:45 +02:00
Bruce Richardson
b34141b284 null: fix build with gcc 5.1
On Fedora 22, with GCC 5.1, errors are reported due to array accesses
being potentially out of bounds. This commit fixes this by adding in an
extra bounds check to the loop counters, or, in the case of stats reset,
by blindly zeroing the whole array, rather than just the part that is in
use.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-06-02 18:24:28 +02:00
Bruce Richardson
36501efdfc i40e: fix build with gcc 5.1
On Fedora 22, with GCC 5.1, errors are reported due to array accesses
being potentially out of bounds. This commit fixes this by adding in an
extra bounds check to the loop counter.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-06-02 18:24:28 +02:00
Michael Qiu
bbd8a6f64a fm10k: fix maximum VF number
In DPDK, max_vfs means vf numbers created, not the max number vfs
the device supported.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-06-02 17:48:52 +02:00
Jijiang Liu
7c4c66bf66 i40e: fix condition to get VMDQ infos
To get device VMDQ info when only i40e VMDQ feature is enabled.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-05-29 20:27:23 +02:00
Bruce Richardson
6d71d3b6ee xenvirt: move drivers/net/
Move xenvirt PMD to drivers/net directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:06:23 +02:00
Bruce Richardson
09452c07ed vmxnet3: move to drivers/net/
Move vmxnet3 PMD to drivers/net directory.
As part of the move, rename the "vmxnet3" subdirectory, containing the
original FreeBSD drivers, from "vmxnet3" to the more standard name
"base", to indicate it contains the base drivers used for the
implementation.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:06:23 +02:00
Bruce Richardson
6c3169a3dc virtio: move to drivers/net/
Move virtio PMD to drivers/net directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:06:23 +02:00
Bruce Richardson
f3aec9f070 ring: move to drivers/net/
Move ring PMD to drivers directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:06:22 +02:00
Bruce Richardson
232771c793 pcap: move drivers/net/
Move pcap pmd to drivers/net directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:06:22 +02:00
Bruce Richardson
b3b413f724 null: move to drivers/net/
Move null PMD to drivers/net directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:06:22 +02:00
Bruce Richardson
98a1f3776f mlx4: move to drivers/net/
move mlx4 PMD to drivers/net directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:06:22 +02:00
Bruce Richardson
abf7275bba ixgbe: move to drivers/net/
move ixgbe PMD to drivers/net directory.
As part of the move, we rename the ixgbe directory, containing the
ixgbe "base driver" code, from "ixgbe" to "base".

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:06:22 +02:00
Bruce Richardson
5c9222058d i40e: move to drivers/net/
Move i40e PMD to drivers/net directory.
As part of the move, rename the "i40e" directory, containing the "base
driver" code, from "i40e" to "base".

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:06:22 +02:00
Bruce Richardson
637bb7694d fm10k: move to drivers/net/
move fm10k PMD to drivers/net directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:06:22 +02:00
Bruce Richardson
72f3de308f enic: move to drivers/net/
move enic PMD to drivers/net directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
[Thomas: move vnic/ to base/]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:05:52 +02:00
Bruce Richardson
d15fcf76c8 e1000: move to drivers/net/
Move e1000 pmd to drivers/net directory
As part of move, rename "e1000" subdirectory, which contains the code
from the "base driver", to "base".

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 15:51:38 +02:00
Bruce Richardson
3eb6bdd89e bond: move to drivers/net/
Move bonded ethdev pmd to drivers/net

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 15:51:38 +02:00
Bruce Richardson
df65e967a8 af_packet: move to drivers/net/
move af_packet pmd to drivers/net directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 15:51:38 +02:00
Bruce Richardson
980ed498eb drivers: create new directory
Add a new top-level "drivers" directory to which all PMDs will be moved
for easier maintenance of both lib folder and drivers themselves. This
new directory is a dependency of all the apps in the app folder, so
the makefiles for each app are updated.
To the new top-level directory add a "net" subdirectory to classify
more specifically our existing PMDs as ethernet drivers

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
[Thomas: fix dependencies and merge several patches]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 15:51:38 +02:00