Commit Graph

5654 Commits

Author SHA1 Message Date
Xiao Wang
8709f63782 net/ixgbe/base: fix possible corruption of shadow RAM
Currently, not all shadow RAM accesses are being done under the
protection of a semaphore, which could result in corruption.

Refactor the code so that it is possible to hold the semaphore
around ixgbe_host_interface_command by introducing an unlocked form.
This patch also eliminates the function ixgbe_read_ee_hostif_data_X550
in favor of the function ixgbe_read_ee_hostif_X550.
The new arrangement is able to get both the management interface semaphore
and the EEPROM semaphore at the same time instead of separately.

Fixes: af75078fec ("first public release")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
7650af62b4 net/ixgbe/base: add two MAC ops for Hyper-V
This patch adds negotiate_api_version and set_rlpml into mac_ops. With the
introduction of Hyper-V functionality, we can have separate functions to
accommodate different implementations without have one break the other.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
d4b4c68454 net/ixgbe/base: add X550em_a FW ALEF support
This patch adds X550em_a FW ALEF support. ALEF is the new unified FW.
The driver uses the KRM_PMD_RX_FLEX_PORT/FLX_MASK_ST20 registers to
configure the lane mode.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
d5e7abb9b5 net/ixgbe/base: separate PHY ops init from PHY init
This patch moves PHY ops pointers initialization to
ixgbe_init_phy_ops_X550em and PHY identifying/initializing
to ixgbe_identify_phy_x550em.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
c1c543efb1 net/ixgbe/base: prevent link speed value conflict
This patch changes the value of IXGBE_LINK_SPEED_10_FULL from 4 to 2,
as 4 is reserved to 100Mbit Half Duplex in E1000 shared code.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
d957da1e25 net/ixgbe/base: remove X550em_a 100Mbps
X550em_a only supports 10G/1G link.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
4d3d096cbc net/ixgbe/base: report autoneg supported for X550
Make sure ixgbe_device_supports_autoneg_fc() returns true for the device
IDs of X550EM_A_1G_T and X550EM_A_1G_T_L.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
607599ae99 net/ixgbe/base: reduce delay for SWFW semaphore
This patch reduces the SWFW semaphore/PHY Token retry delay.

ixgbe_release_swfw_sync_X540: Reduce 5 ms delay after releasing
semaphore to 2 ms. HW team indicated 1 ms delay would be sufficient
for FW access.

ixgbe_acquire_swfw_sync_X540: Remove 5 ms delay after acquiring
semaphore.

ixgbe_acquire_swfw_sync_X550a: Remove 5 ms delay since there are
two 2 ms delays in the semaphore release flow.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
89763bb924 net/ixgbe/base: factorize mailbox write needing ack
ixgbevf_write_msg_read_ack() is now performing mailbox write and read,
so this patch use this function to commonize mailbox write and read.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
1eb4050817 net/ixgbe/base: add missing FDIRSCTPM mask setting
This patch adds missing FDIRSCTPM mask setting for tunneled packets.
It should be set the same way as FDIRTCPM and FDIRUDPM so that SCTP
packets can be filtered correctly.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
c9bc2f6d2d net/ixgbe/base: set default autoneg speed at reset
This patch avoids the situation where we initialize an adapter but have not
yet set up phy.autoneg_advertised speeds. In that case we could end
up with having no autoneg speeds enabled and therefore get no link until we
reset the link and set the autoneg speeds correctly.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
d10c7b638c net/ixgbe/base: use default check link for X550em_a
This patch removes the X550em_a specific check link function and uses
ixgbe_check_mac_link_generic instead. It is not necessary to
check both the MAC link register and external PHY registers when
checking the link.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
62478541f3 net/ixgbe/base: add bounds check in LED functions
Do parameter check to prevent exceptional value being written into
register.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
4673405fe0 net/ixgbe/base: add constants for GENEVE UDP port
X550em_a adds GENEVE support by using the upper 16 bits of VXLANCTRL
to store the UDP port (VXLANCTRL.GENEVE_UDP_PORT).

This patch adds definitions that can be used to manipulate the ports
depending on which protocol is being configured.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
78368ec72b net/ixgbe/base: support X550em_a SGMII FC autoneg
Create flow control (FC) setup and enable functions to configure PHY
registers. These registers advertise FC settings according to the user
requested mode. On link establishment, these settings are negotiated
with the link partner to agree on the settings to use: RX and TX enabled,
TX only enabled, or FC disabled and RX enabled (which also enables TX).

Remove the part of code that performs FC auto-negotiation (AN) in
ixgbe_setup_m88 and put it in a new function to maintain consistency
with other FC AN implementations so far. Add function pointers to the
setup-fc and enable-fc functions so that they get called during init
to perform FC AN.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
dd3a93cf5a net/ixgbe/base: bypass checking link for crosstalk
When HW starts, first read the NVM to see if the crosstalk fix should
be used on the given HW and cache that information in the HW structure.

When we check_link we first see if 1) NVM requests this fix 2) if
we are an SFP+ device 3) see if a module is not in the SFP+ cage.
If all the above are true then don't bother checking the link, just
say it is down.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
f0f856aad3 net/ixgbe/base: define X550 PCIe serial MAC address
Add SERIAL_NUMBER_MAC_ADDR definition for X550.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
644a79d931 net/ixgbe/base: fix check for NACK
Previously we checked return buffer for
(IXGBE_VF_SET_MACVLAN | IXGBE_VT_MSGTYPE_NACK), but this would not
work if index is not 0 and as a result NACK will not be detected.

Fixes: af75078fec ("first public release")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
3e150d721d net/ixgbe/base: access IOSF by host interface
This patch makes sure that we access IOSF registers through the
host interface command (HIC) for the majority of X550em devices.
All devices with NVM are capable of using the HIC.

For consistency all instances where the ixgbe_write_phy_reg_mdi is called
directly are converted to function pointer calls.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
09acd80e3a net/ixgbe/base: increment PF-VF mailbox version
This patch will pave the way for the new VF unicast promiscuous
mode support.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
1784af7c4e net/ixgbe/base: report VF MTU setting failure
Propagate return value when trying to set the maximum packet length. A
PF driver could return a NACK for this request, and the VF driver will
need to know this.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
1b8dd5d825 net/ixgbe/base: fix function comments about X550
Some function comments are obviously wrong, this patch rewords them.

Fixes: d2e72774e5 ("ixgbe/base: support X550")
Fixes: 0790adeb56 ("ixgbe/base: support X550em_a device")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
1caa5909ae net/ixgbe/base: configure DMA coalescing for 10Mb
Provide a DMA coalescing configuration for 10Mb link speed.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
92d4079a8c net/ixgbe/base: clear page register in error path
The error exit should at least try to set the page register to 0
since other code will assume that state.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
d60a2d3a10 net/ixgbe/base: add flow control autoneg for X550em_a fiber
This patch adds a separate function for enabling Flow Control (FC)
auto-negotiation on X550em_a:

- rename ixgbe_fc_autoneg_x550a() to ixgbe_fc_autoneg_backplane_x550em_a().
- create ixgbe_fc_autoneg_fiber_x550em_a() specifically for fiber.
- add definitions for KRM_PCS_KX_AN_LP register and related bits.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
658dfaa2bf net/ixgbe/base: add flow control for X550em_a fiber
This patch adds a separate function for setting up Flow Control (FC)
on X550em_a fiber:

- rename ixgbe_setup_fc_x550a() to ixgbe_setup_fc_backplane_x550em_a().
- create ixgbe_setup_fc_fiber_x550em_a() to configure FC for fiber.
- add definitions for KRM_AN_CNTL_4 and KRM_PCS_KX_AN along with related
  definitions.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
193ed38a3d net/ixgbe/base: add VF promiscuous mode constants
Add new definitions to support VF unicast promiscuous mode which
will be implemented in a later patch.

Besides, rename definitions of subdevice IDs on SFP LOM to make it
easier to distinguish.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
4ec839e43b net/ixgbe/base: rework X550em_a 1G PHY init
Fully initialize X550em_a 1G PHYs; move the PHY definitions from
ixgbe_x550.h to ixgbe_phy.h, where they really belong; define
register numbers in decimal because that is how they are in the spec.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
c3dcab83a4 net/ixgbe/base: extract PHY probing function
Move the PHY probe code into a separate function so that it can be
reused. A subsequent patch will use it for configurations that
provide the PHY address explicitly.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
b080425751 net/ixgbe/base: move X550 MAC ops init into functions
This patch introduces new init_ops functions for X550EM_a and X550EM_x.
This makes it easier to assign function pointers with specific
dependencies (like media type) for each MAC.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
260e2e22e2 net/ixgbe/base: move multicast mode update
This patch adds update_xcast_mode callback in mac ops, and moves
ixgbevf_update_xcast_mode function into base code.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
c3fb605491 net/ixgbe/base: support X550em_a 10G PHY
This patch uses the shared Management Data Input/output (MDIO)
functions ixgbe_read_phy_reg_x550a and ixgbe_write_phy_reg_x550a
for X550em_a 10G PHY which supports flow control auto-negotiation.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
39eab21092 net/ixgbe/base: change endianness of PHY data
The x550a related firmware reverses the endianness of the PHY data read
and written via host interface command, so make corresponding changes
to that.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
1726b9cd9c net/ixgbe/base: remove X550em SFP iXFI setup
This patch removes X550em SFP iXFI setup for the drivers since there
is no released hardware production with SFP iXFI.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Xiao Wang
11c1941b4a net/ixgbe/base: fix pointer check
The vfta_delta value rather than the pointer should be checked.

Fixes: b978f7b38c ("net/ixgbe/base: simplify VLAN management")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Qi Zhang
75d133dd32 net/i40e: enable 25G device
Add support for 25G link speed to enable 25G device.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2016-09-30 12:27:18 +02:00
Qi Zhang
edfb226f69 net/i40e: use PHY type to check PHY capability
Using device ID to check PHY capability is not extensible.

Now we are using PHY type to detect PHY capability.

All link speeds supported by the device are encoded into PHY type,
and PHY type value can be read by admin queue "get_phy_capability"
command at initialization stage.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2016-09-30 12:27:18 +02:00
John Daley
c3e09182bc net/enic: support scatter Rx in MTU update
Re-initialize Rq's when MTU is changed. This allows for more
efficient use of mbufs when moving from an MTU that is greater
than the mbuf size to one that is less. Also move to using Rx
scatter mode when moving from an MTU less than the mbuf size
to one that is greater.

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
2016-09-30 12:27:18 +02:00
Nelson Escobar
d10798072c net/enic: fix freeing memory for descriptor ring
The function vnic_dev_free_desc_ring() didn't actually free memory. Fix
this by first changing vnic_dev_alloc_desc_ring() to use the common
allocation function, then in vnic_dev_free_desc_ring call the common
free function.

Fixes: fefed3d1e6 ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
2016-09-30 12:27:18 +02:00
Nelson Escobar
53fa8cc0d5 net/enic: enable link check interrupt
Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2016-09-30 12:27:18 +02:00
Nelson Escobar
cf8d9826b7 net/enic: extract code for checking link status
Move link check code to a new function so that it can be reused
by the interrupt handler.

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2016-09-30 12:27:18 +02:00
Nelson Escobar
667b8a3bd4 net/enic: unregister interrupt handler when stopping
enic_disable() wasn't calling rte_intr_disable() or
rte_intr_callback_unregister().  stopping/starting a port would
result in the same interrupt callback being registered multiple
times, which would then cause it to be called multiple times on
every interrupt.

Fixes: fefed3d1e6 ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2016-09-30 12:27:18 +02:00
Nélio Laranjeiro
c904ae25fe net/mlx5: support Mellanox OFED 3.4
Some macros are renamed by Mellanox OFED 3.4.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-09-30 12:27:18 +02:00
Ajit Khaparde
0c79d5aa1a maintainers: add new bnxt driver maintainer
Add Ajit Khaparde as the maintainer of the bnxt PMD

Reviewed-by: David Christensen <david.christensen@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Stephen Hurd <stephen.hurd@broadcom.com>
2016-09-30 12:27:18 +02:00
Jianbo Liu
7b0cf70135 net/i40e: support ARM platform
And add read memory barrier to avoid status inconsistency
between two Rx descriptors readings.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2016-09-30 12:27:18 +02:00
Nelson Escobar
a787f7e69f net/enic: get Rx queue count
Add support to enic for rte_eth_rx_queue_count().

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2016-09-30 12:27:18 +02:00
Yunjian Wang
6e67657c26 net/ixgbe: use macro for PCI log format
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-09-30 12:27:18 +02:00
Qi Zhang
d536192e7c net/i40e/base: support FCoE
Add Fibre Channel Over Ethernet (FCoE) in PHY capabilities.
Add data structure for FCoE statistics collection.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2016-09-30 12:27:18 +02:00
Qi Zhang
fc1d8b8a16 net/i40e/base: get SAN MAC address
Add function that reads the adapter's Storage Area Network (SAN) MAC
address from NVM.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2016-09-30 12:27:18 +02:00
Qi Zhang
68cae24ffd net/i40e/base: minor clean up
Remove unused device ID.
Remove unused compile option.
Adjust code alignment.
Standardize macros.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2016-09-30 12:27:18 +02:00