Commit Graph

496 Commits

Author SHA1 Message Date
Wei Dai
e39713e45f net/ixgbe/base: fix PHY reset check for x550em-ext
PHY type ixgbe_phy_x550em_ext_t requires different check
to verify reset status.

Fixes: af75078fec ("first public release")

Signed-off-by: Wei Dai <wei.dai@intel.com>
2017-01-17 19:40:51 +01:00
Bernard Iremonger
7e98b3af9e net/ixgbe: remove static set VF functions
remove the following static functions:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
2017-01-17 19:39:28 +01:00
Bernard Iremonger
57aa1fd284 net/ixgbe: move set VF functions from the ethdev
Move the following functions from eth_dev_ops to the ixgbe PMD and rename:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Rename the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Use public function internally

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
2017-01-17 19:39:28 +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
Qiming Yang
8b0b565742 net/ixgbe: add firmware version get
This patch adds a new function ixgbe_fw_version_get.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2017-01-17 22:34:36 +01:00
Tiwei Bie
b35d309710 net/ixgbe: add MACsec offload
MACsec (or LinkSec, 802.1AE) is a MAC level encryption/authentication
scheme defined in IEEE 802.1AE that uses symmetric cryptography.
This commit adds the MACsec offload support for ixgbe.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2017-01-15 19:16:37 +01:00
Ben Walker
22dda618c0 pci: separate detaching ethernet ports from PCI devices
Attaching and detaching ethernet ports from an application
is not the same thing as physically removing a PCI device,
so clarify the flags indicating support. All PCI devices
are assumed to be physically removable, so no flag is
necessary in the PCI layer.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-01-12 15:48:54 +01:00
Tomasz Kulasek
7829b8d52b net/ixgbe: add Tx preparation
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-01-04 20:40:22 +01:00
Olivier Matz
513c78ae3f ethdev: fix extended statistics name index
The function rte_eth_xstats_get() return an array of tuples (id,
value). The value is the statistic counter, while the id references a
name in the array returned by rte_eth_xstats_get_name().

Today, each 'id' returned by rte_eth_xstats_get() is equal to the index
in the returned array, making this value useless. It also prevents a
driver from having different indexes for names and value, like in the
example below:

  rte_eth_xstats_get_name() returns:
    0: "rx0_stat"
    1: "rx1_stat"
    2: ...
    7: "rx7_stat"
    8: "tx0_stat"
    9: "tx1_stat"
    ...
    15: "tx7_stat"

  rte_eth_xstats_get() returns:
    0: id=0, val=<stat>    ("rx0_stat")
    1: id=1, val=<stat>    ("rx1_stat")
    2: id=8, val=<stat>    ("tx0_stat")
    3: id=9, val=<stat>    ("tx1_stat")

This patch fixes the drivers to set the 'id' in their ethdev->xstats_get()
(except e1000 which was already doing it), and fixes ethdev by not setting
the 'id' field to the index of the table for pmd-specific stats: instead,
they should just be shifted by the max number of generic statistics.

Fixes: bd6aa172cf ("ethdev: fetch extended statistics with integer ids")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2017-01-04 19:04:30 +01:00
Jan Blunck
eac901ce29 ethdev: decouple from PCI device
This makes struct rte_eth_dev independent of struct rte_pci_device by
replacing it with a pointer to the generic struct rte_device.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2016-12-25 23:30:19 +01:00
Jan Blunck
ae34410a8a ethdev: move info filling of PCI into drivers
Only the drivers itself can decide if it could fill PCI information fields
of dev_info.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2016-12-25 23:25:42 +01:00
Stephen Hemminger
032e995864 net/ixgbe: localize mapping of ethdev to PCI device
Since later changes will change where PCI information is,
localize mapping in one macro.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jan Blunck <jblunck@infradead.org>
2016-12-24 18:54:41 +01:00
Olivier Matz
0880c40113 drivers: advertise kmod dependencies in pmdinfo
Add a new macro RTE_PMD_REGISTER_KMOD_DEP() that allows a driver to
declare the list of kernel modules required to run properly.

Today, most PCI drivers require uio/vfio.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-12-20 18:26:00 +01:00
Wei Zhao
d722022737 net/ixgbe: fix link up with X552
The links never coming up when bring up x552 NIC, device id is 15ac.
This is caused by delete some code which casing
removes X550em SFP iXFI setup for the drivers in function
ixgbe_setup_mac_link_sfp_x550em().
Fix method is recover the deleted code.

Fixes: 1726b9cd9c ("net/ixgbe/base: remove X550em SFP iXFI setup")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-11-11 00:53:22 +01:00
Wenzhuo Lu
4882214cee net/ixgbe: fix VF registers
Some VF registers are using PF's name or address by mistake.
Although some of them are sharing the same addresses.

Fixes: 0198848a47 ("ixgbe: add access to specific device info")

Reported-by: Xuekun Hu <xuekun.hu@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-11-07 16:19:30 +01:00
Bernard Iremonger
f3f9b17bb8 net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
Allow Data Center Bridge (DCB) configuration when SRIOV is enabled.

Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-10-26 20:12:45 +02:00
E. Scott Daniels
aaffc740ec net/ixgbe: fix VF VLAN insert API
The final parameter to rte_pmd_ixgbe_set_vf_vlan_insert is uint8_t
and treated as a binary flag when it needs to be a uint16_t
and treated as a VLAN id.  The data sheet (sect 8.2.3.27.13) describes
the right most 16 bits as the VLAN id that is to be inserted; the
16.11  code is accepting only a 1 or 0 thus effectively only
allowing the VLAN id 1 to be inserted (0 disables the insertion
setting).

This patch changes the final parm name to represent the data that
is being accepted (vlan_id), changes the type to permit all valid
VLAN ids, and validates the parameter based on the range of 0 to
4095. Corresponding changes to prototype and documentation in the
.h file.

Fixes: 49e248223e ("net/ixgbe: add API for VF management")

Signed-off-by: E. Scott Daniels <daniels@research.att.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-10-26 19:42:23 +02:00
Qi Zhang
bd85525efb net/ixgbe: fix out of order Rx read
In vPMD, when we load Rx desc with _mm_loadu_si128, the volatile
modifier will be cast away, allowing the compiler to reorder the
load instructions.

The Rx recv function's correctness is relying on these load
instructions following a strict sequence, reading the descriptors
in reverse order, so we add compiler barrier to prevent compiler
reorder.

Fixes: c95584dc2b ("ixgbe: new vectorized functions for Rx/Tx")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-10-26 19:38:18 +02:00
Wenzhuo Lu
3370618921 net/ixgbe: fix flow director mask
In mac-vlan mode, MAC address mask is not supported by HW.
The MAC address mask should not be set in mac-vlan mode.
Instead, only set it in tunnel mode.

Fixes: 82fb702077 ("ixgbe: support new flow director modes for X550")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-10-26 19:38:18 +02:00
Bernard Iremonger
57bee54e5a net/ixgbe: add application callback on VF to PF messsage
call _rte_eth_dev_callback_process from ixgbe_rcv_msg_from_vf function.

The callback asks the user application if it is allowed to perform
the function.

If the cb_param.retval is RTE_PMD_IXGBE_MB_EVENT_PROCEED then continue,
if 0, do nothing and send ACK to VF
if > 1, do nothing and send NAK to VF.

Signed-off-by: Alex Zelezniak <alexz@att.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
2016-10-14 02:04:24 +02:00
Bernard Iremonger
c1ceaf3ad0 ethdev: add an argument to internal callback function
add cb_arg parameter to the _rte_eth_dev_callback_process function.

Adding a parameter to this function allows passing information
to the application when an eth device event occurs such as
a VF to PF message.
This allows the application to decide if a particular function
is permitted.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Signed-off-by: Alex Zelezniak <alexz@att.com>
2016-10-14 02:01:52 +02:00
Shreyansh Jain
01f1922786 drivers: rename register macro prefix
All macros related to driver registeration renamed from DRIVER_*
to RTE_PMD_*

This includes:

 DRIVER_REGISTER_PCI -> RTE_PMD_REGISTER_PCI
 DRIVER_REGISTER_PCI_TABLE -> RTE_PMD_REGISTER_PCI_TABLE
 DRIVER_REGISTER_VDEV -> RTE_PMD_REGISTER_VDEV
 DRIVER_REGISTER_PARAM_STRING -> RTE_PMD_REGISTER_PARAM_STRING
 DRIVER_EXPORT_* -> RTE_PMD_EXPORT_*

Fix PMDINFOGEN tool to look for matches of RTE_PMD_REGISTER_*.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-10-14 01:49:32 +02:00
Xiao Wang
9bc52f49fc net/ixgbe: implement new Rx checksum flag
Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2016-10-14 01:41:34 +02:00
Olivier Matz
b4f3c136a1 net/ixgbe: support checksum flags in SSE vector Rx
Update desc_to_olflags_v() to set PKT_RX_IP_CKSUM_BAD and
PKT_RX_L4_CKSUM_BAD in the ol_fags of the mbuf.

The Rx vector function can now be used with hw_ip_checksum
enabled.

Tested with:

  cd dpdk.org/
  make config T=x86_64-native-linuxapp-gcc
  make -j32
  mkdir -p /mnt/huge
  mount -t hugetlbfs nodev /mnt/huge
  echo 256 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
  modprobe uio_pci_generic
  python tools/dpdk_nic_bind.py -b uio_pci_generic 0000:04:00.0
  ./build/app/testpmd -l 2,4 -- --total-num-mbufs=65536 -i --port-topology=chained --enable-rx-cksum --disable-hw-vlan-filter --disable-hw-vlan-strip
    set fwd rxonly
    set verbose 1
    start

  # send packets to testpmd using scapy
  eh = Ether(src="00:01:02:03:04:05", dst="00:1B:21:AB:8F:10")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2")/UDP()/Raw("x"*50)
  sendp(p, iface="ixgbe2")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2", chksum=42)/UDP()/Raw("x"*50)
  sendp(p, iface="ixgbe2")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2")/UDP(chksum=42)/Raw("x"*50)
  sendp(p, iface="ixgbe2")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2", chksum=45)/UDP(chksum=42)/Raw("x"*50)
  sendp(p, iface="ixgbe2")

  # result
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
    PKT_RX_IP_CKSUM_BAD
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
    PKT_RX_L4_CKSUM_BAD
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
    PKT_RX_L4_CKSUM_BAD
    PKT_RX_IP_CKSUM_BAD

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-10-14 01:23:40 +02:00
Bernard Iremonger
49e248223e net/ixgbe: add API for VF management
Add APIs to configure and manage VFs on an Intel 82559 NIC.

add rte_pmd_ixgbe_set_vf_vlan_anti_spoof function.
add rte_pmd_ixgbe_set_vf_mac_anti_spoof function.
add rte_pmd_ixgbe_set_vf_stripq function.

Signed-off-by: Alex Zelezniak <alexz@att.com>

add rte_pmd_ixgbe_set_vf_vlan_insert function.
add rte_pmd_ixgbe_set_tx_loopback function.
add rte_pmd_ixgbe_set_all_queues_drop function.
add rte_pmd_ixgbe_set_vf_split_drop_en function.
add rte_pmd_ixgbe_set_vf_mac_addr function.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
2016-10-13 15:38:55 +02:00
Xiao Wang
f8c8cc9980 net/ixgbe/base: add base driver update brief
The ixgbe base driver was updated to version
cid-10g-shared-code.2016.04.12.

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
4f7c34f1ee net/ixgbe/base: clean up
Change the parameter bypass_vlvf to vlvf_bypass for consistency
with ixgbe_common.c.

Clean up some whitespace and misalignment.

Change variable type of secrxreg from int to u32 as it's used
to store register value.

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
7834b63510 net/ixgbe/base: fix skipping PHY config
By exiting early we could skip the PHY configuration and as such
the driver may not configure the PHY correctly for SFP+.

This patch removes the logic which would previously skip the PHY
configuration in the case where we are already at the requested
speed in ixgbe_setup_mac_link_multispeed_fiber().

Fixes: f3430431ab ("ixgbe/base: add SFP+ dual-speed 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
bd9cd76382 net/ixgbe/base: remove unneeded flow control code
Support for flow control auto negotiation is defeatured from X550em_a
fiber when connected to speeds lower than 10Gbps. This patch cleans up
the code path which is mostly dead to begin with.

- add device IDs check in ixgbe_device_supports_autoneg_fc().
- ixgbe_fc_autoneg_fiber_x550em_a() is now used only to pass the user
  settings to ixgbe_fc_enable_generic().
- make sure that start_hw does not fail when setup_fc is not implemented.
- small fix in the debug message when ixgbe_device_supports_autoneg_fc()
  returns false.

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
377af5f38e net/ixgbe/base: update X550em_a backplane speed
Correct link flow for X550em_a backplane with ALEF.

Report the correct link capabilities:
   SKUs configured for 2.5G only support 2.5G.
   non-10G SKUs can only support 2.5 or 1G.

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
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
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
Alex Zelezniak
a9a68b61ad net/ixgbe: fix VF reset to apply to correct VF
In SR-IOV configuration, queues 0 - nb_rx_queues belong to VF0,
which means that with the current implementation when a reset mbox
message comes from any VF, it affects the settings of VF0.

Fix this by using PF queue index to update the correct queue.

Fixes: dbb0b8737f ("ixgbe: add vlan offload support")

Signed-off-by: Alex Zelezniak <alexz@att.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Wang Wei
a75e10c9f7 net/ixgbe: start Rx/Tx after all config done
Starting rxtx before flow director config will cause driver not to
receive packets from NIC.

Signed-off-by: Wang Wei <lnykww@gmail.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Yury Kylulin
f853230920 net/ixgbe: fix mbuf leak during Rx queue release
For the vector PMD, release all mbufs from the Rx queue if no packets
are received after device start.

Fixes: 11b220c649 ("ixgbe: fix release queue mbufs")

Signed-off-by: Yury Kylulin <yury.kylulin@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-09-30 12:27:18 +02:00
Yuanhan Liu
0af54f09d9 net: fix clang build
Interestingly, clang and gcc has different prototype for _mm_prefetch().
For gcc, we have

   _mm_prefetch (const void *__P, enum _mm_hint __I)

While for clang, it's

   #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), 0, (sel)))

That's how the following error comes with clang:

   error: cast from 'const void *' to 'void *' drops const qualifier
   [-Werror,-Wcast-qual]
           _mm_prefetch((const void *)rused, _MM_HINT_T0);
   /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/xmmintrin.h:684:58:
   note: expanded from macro '_mm_prefetch'
            #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a),
                                          0, (sel)))

What's weird is that the build was actaully Okay before. I met it while
apply Jerin's vector support for ARM patch set: he just move this piece
of code to another file, nothing else changed.

This patch fix the issue when Jerin's patchset is applied. Thus, I think
it's still needed.

Similarly, make the same change to other _mm_prefetch users, just in case
this weird issue shows up again somehow later.

Fixes: fc3d66212f ("virtio: add vector Rx")
Fixes: c95584dc2b ("ixgbe: new vectorized functions for Rx/Tx")
Fixes: 9ed94e5bb0 ("i40e: add vector Rx")
Fixes: 7092be8437 ("fm10k: add vector Rx")

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2016-09-28 02:18:39 +02:00
Jan Viktorin
2f3193cf0f pci: inherit common driver in PCI driver
Remove the 'name' member from rte_pci_driver and move to generic
rte_driver.

Most of the PMD drivers were initially using DRIVER_REGISTER_PCI(<name>..)
as well as assigning a name to eth_driver.pci_drv.name member.
In this patch, only the original DRIVER_REGISTER_PCI(<name>..) name has
been populated into the rte_driver.name member - assignments through
eth_driver has been removed.

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
[Shreyansh: Rebase and expand changes to newly added files]
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-10-03 16:33:55 +02:00
David Marchand
c830cb2954 drivers: use PCI registration macro
Simplify crypto and ethdev pci drivers init by using newly introduced
init macros and helpers.
Those drivers then don't need to register as "rte_driver"s anymore.

Exceptions:
- virtio and mlx* use RTE_INIT directly as they have custom initialization
  steps.
- VDEV devices are not modified - they continue to use PMD_REGISTER_DRIVER.

Update documentation for replacing an example referring to
PMD_REGISTER_DRIVER.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2016-10-03 16:33:23 +02:00
Pablo de Lara
2f45703c17 drivers: make driver names consistent
As discussed in the past release, driver names are modified
to be more consistent, and the future driver should follow
this new convention.

Driver names consist of:
"driver category"_"driver folder name"_"optional extra name".

For example:
- Crypto null driver       -> "crypto_null"
- Network IXGBE VF driver  -> "net_ixgbe_vf"

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2016-09-16 11:55:59 +02:00
Amine Kherbouche
f03723017a remove unused ring includes
This patch removes all unused <rte_ring.h> headers.

Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>
2016-09-16 10:16:02 +02:00
Ferruh Yigit
221fba3b98 net/ixgbe: move PCI device IDs from EAL
PCI device ids moved from common header into ixgbe driver itself.

KNI starts using pci_device_id from kni/ethtool/ixgbe driver, this is
only for KNI ethtool support, KNI data path is not affected.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-08-23 15:32:33 +02:00
Ido Barnea
ee5b56e4c9 net/ixgbe/base: fix C++ build
Signed-off-by: Ido Barnea <ibarnea@cisco.com>
2016-07-22 01:20:35 +02:00
Olivier Matz
ba9eebbb60 net/ixgbe: fix build whith offload flags disabled
The ixgbe driver does not compile if CONFIG_RTE_IXGBE_RX_OLFLAGS_ENABLE=n
because the macro has not the proper number of parameters. To reproduce
the issue:

  make config T=x86_64-native-linuxapp-gcc
  sed -i 's,\(IXGBE_RX_OLFLAGS_ENABLE\)=y,\1=n,' build/.config
  make -j4
  [...]
   ixgbe_rxtx_vec_sse.c: In function ‘_recv_raw_pkts_vec’:
   ixgbe_rxtx_vec_sse.c:345:53: error:
     macro "desc_to_olflags_v" passed 3 arguments, but takes just 2
      desc_to_olflags_v(descs, vlan_flags, &rx_pkts[pos]);
                                                        ^
   ixgbe_rxtx_vec_sse.c:345:3: error:
     ‘desc_to_olflags_v’ undeclared (first use in this function)
      desc_to_olflags_v(descs, vlan_flags, &rx_pkts[pos]);
      ^
   ixgbe_rxtx_vec_sse.c:231:10: error:
     variable ‘vlan_flags’ set but not used
     uint8_t vlan_flags;
             ^

This patch fixes the number of arguments in the macro, and ensures that
vlan_flags is marked as used to avoid the third error.

Fixes: b37b528d95 ("mbuf: add new Rx flags for stripped VLAN")

Reported-by: Amin Tootoonchian <amint@icsi.berkeley.edu>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-07-05 10:59:28 +02:00
Zyta Szpak
001a1c0f98 ethdev: get registers width
The ethtool app was allocating too little space for 64-bit
registers which resulted in memory corruption.

Removes hard-coded assumption that device registers
are always 32 bits wide. The rte_eth_dev_get_reg_length
and rte_eth_dev_get_reg_info callbacks did not
provide register size to the app in any way while is
needed to allocate correct number of bytes before
retrieving registers using rte_eth_dev_get_reg.

This commit changes rte_eth_dev_get_reg_info so that
it can be used to retrieve both the number of registers
and their width, and removes the now-redundant
rte_eth_dev_get_reg_length.

Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-07-10 14:55:42 +02:00
Neil Horman
cb6696d220 drivers: update registration macro usage
Modify the PMD_REGISTER_DRIVER macro, adding a name argument to it.  The
addition of a name argument creates a token that can be used for subsequent
macros in the creation of unique symbol names to export additional bits of
information for use by the pmdinfogen tool.  For example:

PMD_REGISTER_DRIVER(ena_driver, ena);

registers the ena_driver struct as it always did, and creates a symbol
const char this_pmd_name0[] __attribute__((used)) = "ena";

which pmdinfogen can search for and extract.  The subsequent macro

DRIVER_REGISTER_PCI_TABLE(ena, ena_pci_id_map);

creates a symbol const char ena_pci_tbl_export[] __attribute__((used)) =
"ena_pci_id_map";

Which allows pmdinfogen to find the pci table of this driver

Using this pattern, we can export arbitrary bits of information.

pmdinfo uses this information to extract hardware support from an object
file and create a json string to make hardware support info discoverable
later.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-07-06 23:21:40 +02:00
Remy Horton
d085232a14 ethdev: remove redundant id field in xstats name lookup
For all drivers that currently implement xstats, the id field in the
rte_eth_stats_name structure equals the entry's array index. This
patch eliminates the redundant id field as a direct index lookup is
faster than a search for the matching id field.

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-07-01 16:09:06 +02:00
Daniel Mrzyglod
b47b107fd0 net/ixgbe: remove useless assignment
The "end" variable is assigned and then two lines later is assigned a
different value, making the first assignment useless. Remove it.

Coverity issue: 13335
Fixes: cf4b4708a8 ("ixgbe: improve slow-path perf with vector scattered Rx")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-06-27 18:31:57 +02:00
Beilei Xing
e9e5435479 net/ixgbe/base: update documentation for base code update
The ixgbe base driver was updated to version
cid-10g-shared-code.2016.04.12

The changes include:
Added sgmii link for X550.
Added mac link setup for X550a SFP and SFP+.
Added KR support for X550em_a.
Added new phy definitions for M88E1500.
Added support for the VLVF to be bypassed when adding/removing
a VFTA entry.
Added X550a flow control auto negotiation support.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
e230e7433c net/ixgbe/base: define bit to enable crosstalk workaround
A work around for a new crosstalk erratum that causes link flap in
entry cages has been introduced. So this patch defines the bit in
NVM that will tell software if this work around is needed.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
ee80eb5565 net/ixgbe/base: add flow control autoneg for X550a
This patch adds X550a flow control auto negotiation support.
ixgbe_setup_fc_x550a and ixgbe_fc_autoneg_X550a functions are
added to setup and enable flow control. MAC ops function pointer
fc_autoneg was added so that hardware specific fc autoneg functions
can be called from ixgbe_fc_enable_generic.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
dad45d1765 net/ixgbe/base: allow setting MAC anti spoofing per VF
Make ixgbe_set_mac_anti_spoofing() consistent with the other
functions that deal with setting VLAN and Ethertype spoofing by
changing the prototype to accept a VF parameter.

Also change the logic for writing the PFVFSPOOF register to be similar
to the MAC and Ethertype functions.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
7887b02464 net/ixgbe/base: fix endianness
This patch fixes endianness issues about host interface command.

Fixes: ad66a85dce ("ixgbe/base: new FW values")
Fixes: 0790adeb56 ("ixgbe/base: support X550em_a device")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
3c5c9e096b net/ixgbe/base: use 8 bits for PCI functions
Since PCIe standard defines maximum of 8 functions per device lan_id
is a value 0..7. Because of that, lan_id don't need to be u16.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
72ceac0fca net/ixgbe/base: unify coding style
This patch changes static keyword to STATIC definition, which can be
redefined depending on the compiler used.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
0cb9fbacbe net/ixgbe/base: allow bypassing VLAN pool filters
This patch adds support for the VLAN pool filter (VLVF) to be
bypassed when adding or removing a VLAN filter table array (VFTA) entry.
The PF can utilize the default pool while preserving the VLVF for the
VFs use.
Meanwhile, update the VF operations and drivers where corresponding
functionality is invoked.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
b978f7b38c net/ixgbe/base: simplify VLAN management
This patch simplifies the adding and removing VLANs from
VFTA/VLVF/VLVFB registers. The logic to determine the registers to use
has been simplified to (vid / 32) and (1 - vid / 32). Many conditional
paths and checks are no longer needed with this patch.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
7c9a0b715d net/ixgbe/base: limit PHY token lock to MDIO access
This patch limits getting and putting the PHY Token to PHY MDIO
access only by adding ixgbe_read_phy_reg_x550a and
ixgbe_write_phy_reg_x550a. The PHY Token is only needed to
synchronize access to the MDIO shared between the two MAC instance.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
87d2b7c5ce net/ixgbe/base: fix register access error
This patch corrects the FLA/GSCL/GSCN access offset values according
to the datasheet.

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

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
1062ba821b net/ixgbe/base: fix race condition between ports
This patch fixes a possible race issue between ports, when issuing host
interface commands, by acquiring/releasing the management host interface
semaphore in ixgbe_host_interface_command.

Fixes: 36f43e8679 ("ixgbe/base: refactor manageability block communication")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
6e42840a4d net/ixgbe/base: add function to reset swfw semaphore
For X540 onwards it is possible if a system reset occurs at the
right time to leave the SWFW semaphore high. This new function will
attempt to grab and release the semaphore. If the grab times out it
will still release the semaphore placing it in a known good state.
The idea is to call this when you know no one should be holding the
semaphore (i.e. probe time)

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
f2a5f0b8ee net/ixgbe/base: update device IDs
There are two device IDs changed from 15C6/15C7 to 15E4/15E5 because of
PHY info changes. 15C6/15C7 IDs are now used for the backplane
SGMII versions.
Also, clean up some discovery kludges from the previous shared ID,
and also add 15C6/15C7 to ixgbe_set_mdio_speed just for paranoia
to control MDIO speed even though nothing should be attached.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
ad09635647 net/ixgbe/base: support new PHY types
This patch adds new phy definitions and support functions to enable those
new phy types.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
5e0920d93c net/ixgbe/base: refactor internal PHY mode determination
NW_MNG_IF_SEL register is a PHY link configuration register.
Add ixgbe_read_mng_if_sel_x550em to read NW_MNG_IF_SEL, validate
register values and save fields such as PHY MDIO address. This
centralises the reading and checking of the register in one place

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
d20977088c net/ixgbe/base: rename header guard
The ixgbe_vf.h file did not use _<FILENAME>_ and instead used
__<FILENAME>__ which is not the standard used in every other file.

Fixes: af75078fec ("first public release")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
4fe0982ee7 net/ixgbe/base: fix error path to release lock
When there is an error getting the PHY token, the error path
fails to release the locks that it has taken. Release those
locks in that failure case.

Fixes: 86b8fb293f ("ixgbe/base: add sw-firmware sync for resource sharing on X550em_a")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
64529722b3 net/ixgbe/base: fix macro name
This patch renames IXGBE_PVFTTDLEN to IXGBE_PVFTDLEN according to
abbreviation of Transmit Descriptor Length in datasheet.

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

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
eb1ef7bea1 net/ixgbe/base: clear stale VMDq pool mappings
This patch adds clearing the pool mappings when configuring default
MAC addresses for the interface. Without this there will be the risk
of leaking an address into pool 0 which really belongs to VF 0 when
SR-IOV is enabled.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:53 +02:00
Beilei Xing
fc0559bdb5 net/ixgbe/base: add link MAC setup for X550a SFP+
This patch updates ixgbe_setup_mac_link_sfp_x550a for X550 SFP+.
ixgbe_set_lan_id_multi_port_pcie has been updated to set the MAC
instance(0/1) which is needed when configuring the external PHY,
since X550a has two instances of MGPK. The MAC instance is read
from the EEPROM.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:52 +02:00
Beilei Xing
eb540e47c6 net/ixgbe/base: allow per-device-type method calls
Use the method pointers instead of direct function calls for IOSF
access so that the right functions can be called on X550EM_a,
compared to other devices using the driver.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:52 +02:00
Beilei Xing
c00433544e net/ixgbe/base: add KR support for X550em_a devices
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:52 +02:00
Beilei Xing
a05454ba5f net/ixgbe/base: refactor EEE setup for X550
Break ixgbe_setup_eee_X550 down to better handle a change from if
statements to switch statements needed to add X550em_a KR support.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:52 +02:00
Beilei Xing
928d240123 net/ixgbe/base: fix firmware command checksum error
When software sends commands to firmware using the host
slave command interface, firmware fails to receive the
command due to a checksum failed error, as the checksum is
not being correctly set by the driver software.

This patch sets command checksum to the default value of
0xFF, as per the datasheet, therefore the checksum won't
be checked by firmware.

Fixes: 86b8fb293f ("ixgbe/base: add sw-firmware sync for resource sharing on X550em_a")
Fixes: 0790adeb56 ("ixgbe/base: support X550em_a device")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:52 +02:00
Beilei Xing
ce8beb5a75 net/ixgbe/base: add MAC link setup for X550a SFP
This patch adds ixgbe_setup_mac_link_sfp_x550a for X550a SFP.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:52 +02:00
Beilei Xing
e367815d20 net/ixgbe/base: return error on VF MAC address failure
An error code indicating that the PF rejects the MAC address change
should be returned, in case that the PF has already assigned a MAC
for the VF.

Fixes: af75078fec ("first public release")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:52 +02:00
Beilei Xing
833df43399 net/ixgbe/base: add SGMII link for X550
This patch adds new phy type and media type to support
SGMII link for X550, and add ixgbe_setup_sgmii to support
SGMII link setup.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:52 +02:00
Beilei Xing
16239b7711 net/ixgbe/base: add new VF requests to mailbox API
This patch adds two new VF requests of IXGBE_VF_GET_RETA and
IXGBE_VF_GET_RSS_KEY to the mailbox API.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:52 +02:00
Beilei Xing
2b84092427 net/ixgbe: fix single VLAN tag to be outer VLAN tag
Previously, a single VLAN header is treated as inner VLAN,
but generally, a single VLAN header is treated as the outer
VLAN header.
The patch fixes the ether type of a single VLAN type, and
enables configuring inner and outer TPID for double VLAN.

Fixes: 19b16e2f64 ("ethdev: add vlan type when setting ether type")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
2016-06-27 16:17:45 +02:00
Jerin Jacob
6d04eb4c97 net/ixgbe: use mbuf prefetch function
made second cache line access behavior same as IA

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
2016-06-24 18:28:09 +02:00
Konstantin Ananyev
1160de6779 net/ixgbe: fix missed packet types on Rx
ixgbe PMD RX function(s) misses some packet types that are:
 - correctly recognised by the underlying HW.
 - marked as supported by ixgbe_dev_supported_ptypes_get().

Fixes: 9586ebd358 ("ixgbe: replace some offload flags with packet type")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Tested-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-23 15:59:02 +02:00
Wenzhuo Lu
77234603fb net/ixgbe: support VF mailbox interrupt for link up/down
When using kernel PF and DPDK VF, when the PF driver finds the link
state changes, up -> down or down -> up, the driver will send a
message to VF by mailbox. This link state change may be
triggered by PHY disconnection/reconnection, user config change
like *ifconfig down/up* or interface parameter, like MTU change.

This patch enables the support of the mailbox interrupt,
so VF driver can receive the message for link up/down.
After VF receives this message, VF port need to be reset to
recover. This needs to be handled by the application so this patch
allows the app to register a reset callback so it can reset the VF port.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2016-06-20 17:21:50 +02:00
Jianbo Liu
0e51f9dc48 net/ixgbe: rename x86 vector driver file
To be consistent with the naming for ARM NEON implementation,
ixgbe_rxtx_vec.c is renamed to ixgbe_rxtx_vec_sse.c.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-06-15 17:13:54 +02:00
Jianbo Liu
b20971b6cc net/ixgbe: implement vector driver for ARM
Use ARM NEON intrinsic to implement ixgbe vPMD

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
[style fixes as highlighted by checkpatch.pl]
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2016-06-15 17:13:54 +02:00
Jianbo Liu
8a44c15aa5 net/ixgbe: extract non-x86 specific code from vector driver
move scalar code which does not use x86 intrinsic functions to new file
"ixgbe_rxtx_vec_common.h", while keeping x86 code in ixgbe_rxtx_vec.c.
This allows the scalar code to to be shared among vector drivers for
different platforms.

Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-06-15 17:13:54 +02:00
Remy Horton
e2aae1c1ce ethdev: remove name from extended statistic fetch
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the test-pmd
and proc_info applications to use the new xstats API, and removes
deprecated code associated with the old API.

Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-06-16 18:12:00 +02:00
Remy Horton
e3f3a0ab17 net/ixgbe: fetch extended statistics with integer ids
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the ixgbe driver
to use the new API that seperates name string and value queries.

Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-06-16 17:42:28 +02:00
Olivier Matz
b37b528d95 mbuf: add new Rx flags for stripped VLAN
The behavior of PKT_RX_VLAN_PKT was not very well defined, resulting in
PMDs not advertising the same flags in similar conditions.

Following discussion in [1], introduce 2 new flags PKT_RX_VLAN_STRIPPED
and PKT_RX_QINQ_STRIPPED that are better defined:

  PKT_RX_VLAN_STRIPPED: a vlan has been stripped by the hardware and its
  tci is saved in mbuf->vlan_tci. This can only happen if vlan stripping
  is enabled in the RX configuration of the PMD.

For now, the old flag PKT_RX_VLAN_PKT is kept but marked as deprecated.
It should be removed from applications and PMDs in a future revision.

This patch also updates the drivers. For PKT_RX_VLAN_PKT:

- e1000, enic, i40e, mlx5, nfp, vmxnet3: done, PKT_RX_VLAN_PKT already
  had the same meaning than PKT_RX_VLAN_STRIPPED, minor update is
  required.
- fm10k: done, PKT_RX_VLAN_PKT already had the same meaning than
  PKT_RX_VLAN_STRIPPED, and vlan stripping is always enabled on fm10k.
- ixgbe: modification done (vector and normal), the old flag was set
  when a vlan was recognized, even if vlan stripping was disabled.
- the other drivers do not support vlan stripping.

For PKT_RX_QINQ_PKT, it was only supported on i40e, and the behavior was
already correct, so we can reuse the same bit value for
PKT_RX_QINQ_STRIPPED.

[1] http://dpdk.org/ml/archives/dev/2016-April/037837.html,

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-06-15 17:18:57 +02:00
Jerin Jacob
52b50e8a6b mk: fix cross-compilation
Removed comparison against $CC in Makefiles as
in cross-compiling mode CC can be a different string
instead of string "gcc"

Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-06-07 10:02:39 +02:00
Olivier Matz
e89880957f mbuf: add prefetch helpers
Some architectures (ex: Power8) have a cache line size of 128 bytes,
so the drivers should not expect that prefetching the second part of
the mbuf with rte_prefetch0(&m->cacheline1) is valid.

This commit add helpers that can be used by drivers to prefetch the
rx or tx part of the mbuf, whatever the cache line size.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2016-05-24 11:21:14 +02:00
Olivier Matz
fbfd99551c mbuf: add raw allocation function
Many drivers provide their own implementation of rte_mbuf_raw_alloc(),
duplicating the code. Introduce a new public function in rte_mbuf to
allocate a raw mbuf (uninitialized).

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-05-17 08:31:33 +02:00
Tomasz Kulasek
1554106b22 ixgbe: fix bit shift overflow in VMDQ pool setup
Fix issue reported by Coverity.

Coverity ID 13193: Bad bit shift operation (BAD_SHIFT)
large_shift: In expression 1 << pool, left shifting by more than 31 bits
has undefined behavior. The shift amount, pool, is at least 32.

This patch is a rework of register addr selection logic and mask
computation to made it more readable and avoid bit overflow when 32 bit
value is shifted over its size for pool > 31.

Fixes: fe3a45fd41 ("ixgbe: add VMDq support")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2016-05-06 15:51:22 +02:00
Piotr Azarewicz
8ea3bacb37 ixgbe: fix bit masking in queue stop
The masking for the RX/TX enable bit was incorrect in the rx and tx
queue stop functions. Instead of using "& MASK" it used "| MASK" which
would always return true. This error was found by converity scan.

CID 13215 : Wrong operator used (CONSTANT_EXPRESSION_RESULT)
operator_confusion: txdctl | 33554432 is always 1/true regardless of the
values of its operand. This occurs as the logical second operand of
'&&'.

CID 13216 : Wrong operator used (CONSTANT_EXPRESSION_RESULT)
operator_confusion: rxdctl | 33554432 is always 1/true regardless of the
values of its operand. This occurs as the logical second operand of
'&&'.

Coverity issue: 13215
Coverity issue: 13216
Fixes: 029fd06d40 ("ixgbe: queue start and stop")

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-05-06 15:51:22 +02:00
Stephen Hemminger
f83f50394b ixgbe: clean up code style
Run ixgbe driver through checkpatch and fix the issues highlighted
Fix line spacing, some bad indentation, and in a couple
of cases use short circuit (already there) return to lessen indentation.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Applied with four additional fixes for issues highlighted by checkpatch
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2016-05-06 15:51:22 +02:00
Thomas Monjalon
a61dc000d5 ethdev: remove deprecated statistics
Some statistics were deprecated since release 2.1 (49f386542a).
The last deprecated counter to be used was imcasts.

The VF loopback statistics are also removed as they are used only
in igb and duplicated in extended statistics.

The new counters should be added to extended statistics.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2016-04-20 13:49:31 +02:00
Wenzhuo Lu
533e050a06 ixgbe: fix packet type for VXLAN and NVGRE on X550
VxLAN & NVGRE are supported by x550. As we know HW can parse
the packet and tell SW the type info. For VxLAN & NVGRE packets
there's some change. HW will not tell SW the info of the outer
header but the inner header instead. But we always take the
info as it's for the outer header. So the packet type info is
not right when x550 receives VxLAN & NVGRE packets.

As x550 only supports IPv4 VxLAN & NVGRE packets, we can tell
the outer header of VxLAN is IPv4 + UDP, and the outer header
of NVGRE is IPv4 only. What we don't know is if there's
optional field in the outer IPv4 header.

This patch implement the support of packet type for VxLAN &
NVGRE. And it fixes the wrong packet type issue either.

BTW:
It doesn't fix any existing commit as although it resolve an
issue it's more like a new feature but not a fix.

Reported-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-04-08 22:33:19 +02:00
Marc Sune
82113036e4 ethdev: redesign link speed config
This patch redesigns the API to set the link speed/s configuration
of an ethernet port. Specifically:

- it allows to define a set of advertised speeds for
  auto-negociation.
- it allows to disable link auto-negociation (single fixed speed).
- default: auto-negociate all supported speeds.

A flag autoneg in struct rte_eth_link indicates if link speed was a
result of auto-negociation or was fixed by configuration.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
Tested-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-04-01 21:38:34 +02:00
Marc Sune
e274f57322 ethdev: add speed capabilities
The speed capabilities of a device can be retrieved with
rte_eth_dev_info_get().

The new field speed_capa is initialized in the drivers without
taking care of device characteristics in this patch.
When the capabilities of a driver are accurate, the table in
overview.rst must be filled.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
2016-04-01 21:38:34 +02:00
Marc Sune
39fd068a27 ethdev: rename link speed constants
The speed numbers ETH_LINK_SPEED_ are renamed ETH_SPEED_NUM_.
The prefix ETH_LINK_SPEED_ is kept for AUTONEG and will be used
for bit flags in next patch.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
2016-04-01 21:38:34 +02:00
Marc Sune
1131900006 ethdev: use constants for link duplex
Some duplex values are replaced from 0 to half-duplex when link is down.

Some drivers are still using their own constants for duplex modes.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
2016-04-01 21:38:34 +02:00
Thomas Monjalon
09419f235e ethdev: use constants for link state
Define and use ETH_LINK_UP and ETH_LINK_DOWN where appropriate.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-04-01 21:38:34 +02:00
Aaron Conole
e64a0edb01 ixgbe: fix uninitialized warning
Silence a compiler warning that this variable may be used uninitialized.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-03-31 17:09:56 +02:00
Aaron Conole
c0de18e856 ixgbe: fix VLAN filter missing brackets
The ixgbe vlan filter code has an if check with an incorrect whitespace.

Fixes: fe3a45fd41 ("ixgbe: add VMDq support")

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-03-31 17:09:56 +02:00
Aaron Conole
d3ff9b8334 ixgbe: fix constant sign in left shift operator
Tell the compiler to use an unsigned constant for the config shifts.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-03-31 17:09:56 +02:00
Wang Xiao W
5bcd7b5d2f ixgbe: fail if too many queues for interrupt
The lower 16 bits of EICR register are used for queue interrupts,
dpdk framework take over the first bit for other interrupts like
LSC, so there're only 15 bits left for queue interrupts mapping.
This patch adds a check for the num of interrupt queues at
dev_start.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-30 20:17:58 +02:00
Wenzhuo Lu
3cf835665a ixgbe/base: fix VF multi-queue
When starting testpmd with multiple queues on a ixgbe VF
port, it failed with this printing, "nb_rxq(4) is greater
than max_rx_queues(1)".

The root cause is the VF doesn't get the right max rx queue
number from PF and it uses the default value 1.
VF max rx queue number is set by PF through mailbox messages.
The message for this setting only supports version 1.1. As
message version is updated to 1.2, VF cannot parse the rx queue
number setting message correctly.

This patch raise a specific base code update for this issue.

Fixes: 72dec9e37a ("ixgbe: support multicast promiscuous mode on VF")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-30 20:17:58 +02:00
Wenzhuo Lu
214b0619fc ixgbe: fix tunnelling support for X550em_a
l2 tunnel and e-tag are not supported on the new x550em_a NICs, due
to missing checks for that mac type in the code.
This patch adds in the necessary conditional checks to enable the features
for x550em_a.

Fixes: 22e77d4501 ("ixgbe: support L2 tunnel operations")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-25 19:03:48 +01:00
Wenzhuo Lu
f19b504231 ixgbe: fix timer support for X550em
An issue is found on x550em NICs: ieee1588 is not working, the time is
always reported as 0.
The root cause is that the timer is only supported by the driver for x550,
switch statement entries are missing for x550em_x and x550em_a. This patch
adds those missing entries.

Fixes: a7740dc130 ("ixgbe: support new devices and MAC types")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-25 19:03:48 +01:00
Ferruh Yigit
9d2f7db9c0 ixgbe: disable icc false positive warning
icc (icc (ICC) 16.0.1 20151021) is generating following compile error:
  CC ixgbe_rxtx.o
  .../drivers/net/ixgbe/ixgbe_rxtx.c(153): error #3656: variable
  "free" may be used before its value is set
                      (nb_free > 0 && m->pool != free[0]->pool)) {
			                         ^

Indeed this is a false positive and code is correct.
"nb_free" check prevents the free[] access before its value set.

Disabling this icc warning (#3656) for file ixgbe_rxtx.c.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-03-25 19:03:48 +01:00
Wenzhuo Lu
96c0450dff ixgbe: fix dropping packets from unsupported Tx queues
Ixgbe HW supports 128 TX queues. However, the full 128 queues are only
available in VT and DCB mode.  In normal default "none" mode (VT/DCB off)
the maximum number of available queues is only 64.

The driver doesn't check the mode when reporting the available
number of queues, allowing more that 64 queues to be used in all cases.
If a queue no. >=64 is used in default mode, the TX packets will be dropped
silently.

This change adds a check to forbid using a queue number larger than 64
during device configuration (in default mode), so that the problem is
reported as early as possible.

Fixes: 27b609cbd1 ("ethdev: move the multi-queue mode check to specific drivers")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2016-03-25 19:03:48 +01:00
Wenzhuo Lu
c2b9607052 ixgbe: fix Tx queue number
Internal variable containing the number of TX queues for a device,
was being incorrectly assigned the number of RX queues, instead of TX.

Fixes: 27b609cbd1 ("ethdev: move the multi-queue mode check to specific drivers")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2016-03-25 19:03:48 +01:00
Wenzhuo Lu
ca4a155783 ixgbe: fix PF promiscuous mode after VF closed
There's an issue reported. In the scenario DPDK PF + DPDK VF,
if the VF port is closed, PF port cannot receive packets.
I found at that time the promicuous mode is disabled on the PF
port. But it should be enabled.
When VF port is closed, it will send a message to its PF port to
reset it. During this, PF port will also reset its own
promicuous mode. Which promiscuous mode should be set depends on
the parameter stored in the device data. In the function
set_rx_mode, the pointer of device data points to the wrong
address. So, the promiscuous mode is wrong.

Fixes: 00e30184da ("ixgbe: add PF support")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Reported-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2016-03-25 19:03:48 +01:00
Konstantin Ananyev
d9a2009a81 ixgbe: fix packet type from vector Rx
Current vector RX can't always set the packet_type properly.
To be more specific:
a) it never sets RTE_PTYPE_L2_ETHER
b) it doesn't handle tunnel ipv4/ipv6 case correctly.
c) it doesn't check is IXGBE_RXDADV_PKTTYPE_ETQF set or not.
While a) is pretty easy to fix, b) and c) are not that straightforward
in terms of SIMD ops (specially b).
So far I wasn't able to make vRX support packet_type properly without
noticeable performance loss.
So for now, just remove that functionality from vector RX and
update dev_supported_ptypes_get().

Fixes: 3962541758 ("mbuf: redefine packet type")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
2016-03-25 19:03:28 +01:00
Xiao Wang
2c4ee442c4 ixgbe: fix RETA query and update on X550
For x550 device, the reta table has 512 entries, but in function
ixgbe_dev_rss_reta_query and ixgbe_dev_rss_reta_update we use an
"uint8_t i" to traverse the entries, this will lead the function
to an endless loop.

This patch changes the data type from uint8_t to uint16_t to fix
the issue.

Fixes: 4bee94a6c2 ("ixgbe: support 512 RSS entries on x550")

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-25 19:01:37 +01:00
Jianfeng Tan
78a38edf66 ethdev: query supported packet types
Add a new API rte_eth_dev_get_supported_ptypes to query what packet types
can be filled by a given device. The device should be already started or
its PMD RX burst function already decided, since the packet types supported
may vary depending on RX function.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2016-03-25 18:56:43 +01:00
Igor Ryzhov
86057c9992 ethdev: remove missed packets from error counter
Comment for "ierrors" counter says that it counts erroneous received
packets. But for some reason "imissed" counter is added to "ierrors"
counter in most drivers.
It is a mistake, because missed packets are obviously not received.
This patch fixes it.

Fixes: 70bdb18657 ("ethdev: add Rx error counters for missed, badcrc and badlen packets")
Fixes: 6bfe648406 ("i40e: add Rx error statistics")
Fixes: 856505d303 ("cxgbe: add port statistics")

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-03-22 11:07:28 +01:00
Jingjing Wu
23a5ba8922 ixgbe: disallow unsupported Rx mode
The multi queue mode ETH_MQ_RX_VMDQ_DCB_RSS is not supported in
ixgbe driver.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-03-16 17:18:11 +01:00
Bernard Iremonger
5b8a98d69c ixgbe: fix VF close to remove MAC address
Call the ixgbevf_remove_mac_addr() function in the ixgbevf_dev_close()
function to ensure that the VF traffic goes to the PF after stop,
close and detach of the VF.

Fixes: af75078fec ("first public release")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-03-16 17:17:29 +01:00
Bernard Iremonger
726ced2015 ixgbe: add more information to multiqueue error message
Add the nb_rx_q and nb_tx_q values to the error message
to give details about the error.

Fixes: 27b609cbd1 ("ethdev: move the multi-queue mode check to specific drivers")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-03-16 17:15:51 +01:00
Bernard Iremonger
c961566c82 ixgbe: fix releasing queues twice when detaching VF
Releasing the rx and tx queues is already done in ixgbe_dev_close()
so it does not need to be done in eth_ixgbevf_dev_uninit().

Fixes: 2866c5f1b8 ("ixgbe: support port hotplug")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-03-16 17:12:28 +01:00
Zhe Tao
a379430126 ixgbe: fix VF Rx/Tx function assignment
For the secondary process of DPDK to initialize ixgbevf, it will always
use the simple RX function or LRO RX function, and this behavior is not
the same RX/TX function selection logic as it is for the primary process.
Use the ixgbe_set_tx_function and ixgbe_set_rx_function to select the
RX/TX function when secondary process calls the init function for eth dev.

Fixes: 9d8a92628f ("ixgbe: remove simple scalar scattered Rx method")

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-03-16 17:11:05 +01:00
Wenzhuo Lu
6be3dfec31 ixgbe: support link speed auto-negotiation on X550em_x
Normally the auto-negotiation is supported by FW. SW need not care about
that. But on x550em_x, FW doesn't support auto-neg. As the x550em_x ports
are 10G, if we connect the port will a peer which is 1G, the link will
always be down.
We need support auto-neg by SW to avoid this link down issue. As we already
have the code to handle the link speed setting, what we need is a trigger.
When the advertised link speed changes, a PHY interruption will be
triggered. So, we should handle this interrupt and call ixgbe_handle_lasi
to set the link speed correctly.

Please be aware it's working when auto-neg is on. If the auto-neg of the
peer port is turned off and its speed is indicated manually, we should also
set the speed of our own port manually.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
2016-03-16 17:10:46 +01:00
Wenzhuo Lu
72dec9e37a ixgbe: support multicast promiscuous mode on VF
Add multicast promiscuous mode support on ixgbe VF driver.

Please note if we want to use this promiscuous mode, we need both PF
and VF driver to support it. The reason is this VF feature is
configged on PF.
If use kernel PF driver + dpdk VF driver, make sure kernel PF driver
support VF multicast promiscuous mode. If use dpdk PF + dpdk VF,
better make sure PF driver is the same version as VF.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
2016-03-16 17:10:26 +01:00
Wenzhuo Lu
a7740dc130 ixgbe: support new devices and MAC types
Add the support for new devices and mac types, as supported by the base
code update.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 17:09:27 +01:00
Wenzhuo Lu
e793afe5b7 ixgbe/base: update readme
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 17:09:16 +01:00
Wenzhuo Lu
e4f4722c14 ixgbe/base: abstract out link read/write
It's more valuable to abstract the link read/write interface. As such,
change the following method names, and add them to a new link info
structure:
  read_i2c_combined               => read_link
  read_i2c_combined_unlocked      => read_link_unlocked
  write_i2c_combined              => write_link
  write_i2c_combined_unlocked     => write_link_unlocked

This will allow X550EM_a to override these methods for MDIO access
while X550EM_x provides methods to use I2C combined access.
Initially the structure is just method pointers and a bus
address.

Two functions involved in combined I2C accesses were moved from
ixgbe_phy.c to ixgbe_x550.c. The underlying functions that carry
out the combined I2C accesses were left in ixgbe_phy.c because
they share some functions with other I2C methods.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 17:08:36 +01:00
Wenzhuo Lu
0cf7c6a6f3 ixgbe/base: set MDIO speed after MAC reset
The MDIO clock speed must be reconfigured after the MAC reset.
The MDIO clock speed becomes invalid, therefore the driver reads
invalid PHY register values. The driver now set the MDIO clock
speed prior to initializing PHY ops and again after the MAC reset.

As now the MDIO speed gets set in more than one place, make a
function for it so it will always be done correctly.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 17:08:33 +01:00
Wenzhuo Lu
e2f368a4bf ixgbe/base: fix setting flow director flag twice
Do not set FDIRCTRL.DROP_NO_MATCH in ixgbe_init_fdir_perfect_82599(),
this bit is already set in ixgbe_set_fdir_drop_queue_82599() which
makes more sense for drivers that call that function.

This resolves an issue where packets were being dropped when switching
to perfect filters mode.

Setting this bit makes no sense in perfect filters mode for the
driver as we do not want to route all packets that don't match an FDIR
rule to a single queue and instead fall back to RSS.
Drivers that need this bit set can call ixgbe_set_fdir_drop_queue_82599()
and the ones that don't, can preserve the old behavior.

Fixes: 2241ce2816 ("ixgbe/base: add flow director drop queue")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 17:08:23 +01:00
Wenzhuo Lu
0c14952f17 ixgbe/base: add register definition for SGMII busy
The X550EM_a device provides the MAC_SGMII_BUSY register to
indicate when slow SGMII register writes complete. Add
definitions for the register. No definitions are provided for
the individual bits under the theory that it is better to wait
for everything to complete when needed rather than try to map
out which reads need to wait for which writes. So we should wait
when anything is marked as "busy".

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 17:07:30 +01:00
Wenzhuo Lu
2aeac71a5a ixgbe/base: ignore manageability for PHY power on
Instead of not defining the callback for set_phy_power when
manageability is enabled, put the check in the set_phy_power
function so that only turning the power off is conditional on
management, but not turning the PHY on.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 17:07:13 +01:00
Wenzhuo Lu
ce7a410081 ixgbe/base: set VF MAC address only when acked by PF
This patch resolves an issue where VF mac address is zeroed out
in cases where the VF driver is loaded while the PF interface
is down.
The solution is to only set it when we get an ACK from the PF.

Fixes: 6202266e56 ("ixgbe/base: vf changes")
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 17:06:53 +01:00
Wenzhuo Lu
86b8fb293f ixgbe/base: add sw-firmware sync for resource sharing on X550em_a
Use a PHY token, shared between sw-fw for PHY access on X550EM_a.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 17:05:29 +01:00
Wenzhuo Lu
e44844ce1c ixgbe/base: support X550em_x V2 device
Only x550em_x V1 was supported before. Now V2 is supported.
A mask for V1 and V2 is defined and used to support both.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 17:05:12 +01:00
Wenzhuo Lu
0790adeb56 ixgbe/base: support X550em_a device
Add new X550EM_a devices and their mac types, X550EM_a
and X550EM_a_vf.
Update the code to use the new devices and mac types.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 17:04:49 +01:00
Michael Qiu
276ddef262 ixgbe: fix disable interrupt twice
Currently, ixgbe vf and pf will disable interrupt twice in
stop stage and uninit stage. It will cause an error:

    testpmd> quit

    Shutting down port 0...
    Stopping ports...
    Done
    Closing ports...
    EAL: Error disabling MSI-X interrupts for fd 26
    Done

because the interrupt has already been disabled in stop stage.
Since it is enabled in init stage, better remove from
stop stage.

Fixes: 0eb609239e ("ixgbe: enable Rx queue interrupts for PF and VF")

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-03-16 17:04:39 +01:00
Stephen Hemminger
02fb58d4c7 ixgbe: fix whitespace
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2016-03-16 17:04:37 +01:00
Stephen Hemminger
06554d381d ixgbe: speed up non-vector Tx
The freeing of mbuf's in ixgbe is one of the observable hot spots
under load. Optimize it by doing bulk free of mbufs using code similar
to i40e and fm10k.

Drop the no longer needed micro-optimization for the no refcount flag.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-03-16 16:58:39 +01:00
Wenzhuo Lu
d87c3058bb ixgbe: offload VxLAN and NVGRE Tx checksum on X550
The patch add VxLAN & NVGRE TX checksum off-load. When the flag of
outer IP header checksum offload is set, we'll set the context
descriptor to enable this checksum off-load.

Also update release notes for VxLAN & NVGRE checksum off-load support.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-03-13 11:52:58 +01:00
Wenzhuo Lu
d909af8f72 ixgbe: offload VxLAN and NVGRE Rx checksum on X550
X550 will do VxLAN & NVGRE RX checksum off-load automatically.
This patch exposes the result of the checksum off-load.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-03-13 11:52:52 +01:00
Wenzhuo Lu
01c631b724 ixgbe: configure UDP tunnel port
Add UDP tunnel port add/del support on ixgbe. Now only
support VxLAN port configuration.
Although according to the specification the VxLAN port has
a default value 4789, it can be changed. We support VxLAN
port configuration to meet the change.
Note, the default value of VxLAN port in ixgbe NICs is 0. So
please set it when using VxLAN off-load.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-03-13 11:48:26 +01:00
Wenzhuo Lu
22e77d4501 ixgbe: support L2 tunnel operations
Add support of l2 tunnel configuration and operations.
1, Support modifying ether type of a type of l2 tunnel.
2, Support enabling and disabling the support of a type of l2 tunnel.
3, Support enabling/disabling l2 tunnel tag insertion/stripping.
4, Support enabling/disabling l2 tunnel packets forwarding.
5, Support adding/deleting forwarding rules for l2 tunnel packets.
Only support E-tag now.

Also update the release note.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Yong Liu <yong.liu@intel.com>
2016-03-11 23:25:58 +01:00
Wenzhuo Lu
43a942393d ixgbe: select pool by MAC when using double VLAN
On X550, as required by datasheet, E-tag packets are not expected
when double VLAN are used. So modify the register PFVTCTL after
enabling double VLAN to select pool by MAC but not MAC or E-tag.

An introduction of E-tag:
It's defined in IEEE802.1br. Please reference this website,
http://www.ieee802.org/1/pages/802.1br.html.

A brief description.
E-tag means external tag, and it's a kind of l2 tunnel. It means a
tag will be inserted in the l2 header. Like below,
   |31            24|23           16|15         8|7           0|
  0|                   Destination MAC address                 |
  4|     Dest MAC address(cont.)    |     Src MAC address      |
  8|                  Source MAC address(cont.)                |
 12| E-tag Etherenet type (0x893f)  |      E-tag header        |
 16|                    E-tag header(cont.)                    |
 20|   VLAN Ethertype(optional)     |   VLAN header(optional)  |
 24|         Original type          |         ......           |
...|                              ......                       |
The E-tag format is like below,
   |0                    15|16   18|19 |20                   31|
   |   Ethertype - 0x893f  | E-PCP |DEI|   Ingress E-CID_base  |

   |32  33|34 35|36      47|48         55    |56             63|
   |  RSV | GRP |E-CID_base|Ingress_E-CID_ext|    E-CID_ext    |

The Ingess_E-CID_ext and E-CID_ext are always zero for endpoints
and are effectively reserved.

The more details of E-tag is in IEEE 802.1BR. 802.1BR is used to
replace 802.1Qbh. 802.1BR is a standard for Bridge Port Extension.
It specifies the operation of Bridge Port Extenders, including
management, protocols, and algorithms. Bridge Port Extenders
operate in support of the MAC Service by Extended Bridges.
The E-tag is added to l2 header to identify the VM channel and
the virtual port.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Yong Liu <yong.liu@intel.com>
2016-03-11 22:56:00 +01:00
Helin Zhang
19b16e2f64 ethdev: add vlan type when setting ether type
In order to set ether type of VLAN for single VLAN, inner
and outer VLAN, the VLAN type as an input parameter is added
to 'rte_eth_dev_set_vlan_ether_type()'.
In addition, corresponding changes in e1000, ixgbe and i40e
are also added.

It is an ABI break but ethdev library is already bumped for 16.04.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-11 22:21:06 +01:00
Jingjing Wu
1409f127d7 ethdev: fix byte order consistency of flow director
Fixed issue of byte order in ethdev library that the structure
for setting fdir's mask and flow entry is inconsist and made
inputs of mask be in big endian.

Fixes: 2d4c1a9ea2 ("ethdev: add new flow director masks")
Fixes: 76c6f89e80 ("ixgbe: support new flow director masks")

Reported-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-04 16:50:58 +01:00
Ravi Kerur
d6b324c00f mbuf: get DMA address
Macros RTE_MBUF_DATA_DMA_ADDR and RTE_MBUF_DATA_DMA_ADDR_DEFAULT
are defined in each PMD driver file. Convert macros to inline
functions and move them to common lib/librte_mbuf/rte_mbuf.h file.
PMD drivers include rte_mbuf.h file directly/indirectly hence no
additioanl header file inclusion is necessary.

Signed-off-by: Ravi Kerur <rkerur@gmail.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-03-04 16:01:15 +01:00
Huawei Xie
693f715da4 remove extra parentheses in return statement
fix the error reported by checkpatch:
  "ERROR: return is not a function, parentheses are not required"

remove parentheses in return like:
  "return (logical expressions)"

remove parentheses in return a function like:
  "return (rte_mempool_lookup(...))"

Fixes: 6307b909b8 ("lib: remove extra parenthesis after return")

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
2016-02-10 15:47:50 +01:00
Wenzhuo Lu
ad66a85dce ixgbe/base: new FW values
This patch addes some new defines for FW, and includes some minor change.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
33f4f30afa ixgbe/base: add X550T1 device
Adds a new single-port Sage Pond device X550T1.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
dfc7e1c90a ixgbe/base: support new thermal alarm
This patch adds support for the new thermal sensor alarms indication.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
fd766412ee ixgbe/base: add new X550 iXFI configuration function
This patch should allow native SPI SFP+ to work as we understand it now.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
28ee76db18 ixgbe/base: move X550 MDIO clock speed init
The x550 MDIO clock speed must be configured prior to first MDIO read or
write. The default MDIO clock speed is not valid, therefore the driver
is configuring a valid speed prior to reading the copper PHY device id.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
bd33a76533 ixgbe/base: prevent X550 KR PHY reset in init
This patch removes KR PHY reset from ixgbe_init_phy_ops_X550em. Since
this function is meant to initialize function pointers for detected PHY
type. Internal PHY reset was moved to ixgbe_setup_internal_phy_t_x550em
which will now detect which mode does internal PHY work in, and setup it
as required.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
1a92547a39 ixgbe/base: support KR mode for X550 link
KR auto-neg mode is what we will be using going forward. The SW
interface for this mode is different than what was used for iXFI.

While debugging, it was determined that the ucode diagnostic was
no longer needed. This code has been removed to simplify the init
flow.

A subtle semaphore error in the CS4227 reset flow was fixed.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
796f322dd1 ixgbe/base: remove X550 driver config of KX4 PHY
The KX4 PHY will be configured by the NVM image. The driver
had been overwriting this config.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
4e7466cccd ixgbe/base: avoid needless copper PHY access
Avoid a needless PHY access on copper phys to save the 10ms wait
time for each PHY access. A helper function is introduced to
actually do the register access and process the contents.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
52f20c7fa8 ixgbe/base: check MAC type when setting X550 callbacks
Check mac type when accessing iosf registers and using the PHY token
for PHY access.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
2ecf53223d ixgbe/base: use mac-dependent values
This patch changes code to use registers offsets stored in mvals table
instead of values defined statically.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
2241ce2816 ixgbe/base: add flow director drop queue
This patch adds ixgbe_set_fdir_drop_queue_82599 for enabling and
setting flow director drop queue, and adds sets drop no match in
ixgbe_init_fdir_perfect_82599 for x550.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
9243820b25 ixgbe/base: remove wait and check flow director signature addition
Waiting for FDIRCMD completion is an expensive thing to do in the
transmit hot path. This wait was added to catch problems with perfect
filter rules, and, at least in the Linux driver, there is no error
check anyway, so there is no point to adding the delay. So do not wait
for completion. Change the return of the function to void, since it has
no meaningful return value.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
59acf817b2 ixgbe/base: add flow control ethertype for filtering
This patch adds the flow control ethertype to the defines for the
ETQF filter list. This only adds the define. Each driver
can add this ethertype to the filter. This is needed to prevent
denial of service by malicious VFs sending out flow control
packets.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:21 +01:00
Wenzhuo Lu
b7fbe1a801 ixgbe/base: fix Tx hang in CEE mode
Currently credit_refill and credit_max could be zero for a TC and that
is causing Tx hang for CEE mode configuration, so to fix that have at
min credit assigned to a TC and that is as what IEEE mode already does.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:43:20 +01:00
Wenzhuo Lu
8487a24edc ixgbe/base: update readme
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-01-14 09:20:37 +01:00
Robin Jarry
41264853e0 ixgbe: restore imissed stat counter
This counter was left unmodified. Restore it in ixgbe_dev_stats_get.

The ierrors counter still includes imissed for ixgbe. This behaviour is
not consistent amongst all drivers. Another patch may be needed to unify
the meaning of the ierrors counter.

Fixes: 5e50ad1c1b ("ixgbe: add specific stats")

Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2015-12-15 18:05:53 +01:00
Harry van Haaren
3f07cc4906 ixgbe: fix Tx bytes statistics with link down
This patch fixes tx byte statistics when transmitting packets
with link down.

Previously, the counter would decrement 4 bytes for each packet that
was transmitted with link down, causing the uint64 to wrap around.

Fixes: c03fcee9ab ("ixgbe: remove CRC size from byte counters")

Reported-by: Michael Qiu <michael.qiu@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-12-07 00:55:51 +01:00
Michael Qiu
6329b56776 drivers: fix constant suffix for 32-bit platforms
There is a compilation issue with some compilers.
In i686 platform, long is 32bit, so XXX_CYCLECOUNTER_MASK
need define as 'ULL'

Fixes: 9c857bf6be ("igb: support ieee1588 functions for device time")
Fixes: 1c4445e1f2 ("ixgbe: support ieee1588 functions for device time")
Fixes: f3a4e40eca ("i40e: support ieee1588 functions for device time")

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
2015-11-27 21:41:58 +01:00
Cunming Liang
4ba427971a ixgbe: fix VFIO interrupt vector
The vector number may change during 'dev_start'. Before enabling a new vector mapping,
it's necessary to disable/unmap the previous setting.

Fixes: 7ab8500037 ("ixgbe: fix VF start with PF stopped")

Reported-by: Yong Liu <yong.liu@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Tested-by: Yong Liu <yong.liu@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-11-24 14:56:08 +01:00
Harry van Haaren
c03fcee9ab ixgbe: remove CRC size from byte counters
This patch removes the crc bytes from byte counter statistics.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-11-23 23:51:14 +01:00
Daniel Mrzyglod
1c4445e1f2 ixgbe: support ieee1588 functions for device time
Add additional functions to support the existing IEEE1588
functionality and to enable getting, setting and adjusting
the device time.

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: John McNamara <john.mcnamara@intel.com>
2015-11-13 17:44:39 +01:00