Commit Graph

194 Commits

Author SHA1 Message Date
Aaron Conole
366113dbfb e1000: suppress misleading indentation warning
The register read/write mphy functions have misleading whitespace around
the `locked` check. This cleanup merely preserves the existing functionality
and suppresses future gcc versions' "misleading indentation" warning.

Suggested-by: Panu Matilainen <pmatilai@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-31 17:09:23 +02:00
Olivier Matz
ae844e5e68 igb: fix crash with offload on 82575
On the 82575 chipset, there is a pool of global TX contexts instead of 2
per queues on 82576. See Table A-1 "Changes in Programming Interface
Relative to 82575" of Intel® 82576EB GbE Controller datasheet (*).

In the driver, the contexts are attributed to a TX queue: 0-1 for txq0,
2-3 for txq1, and so on.

In igbe_set_xmit_ctx(), the variable ctx_curr contains the index of the
per-queue context (0 or 1), and ctx_idx contains the index to be given
to the hardware (0 to 7). The size of txq->ctx_cache[] is 2, and must
be indexed with ctx_curr to avoid an out-of-bound access.

Also, the index returned by what_advctx_update() is the per-queue
index (0 or 1), so we need to add txq->ctx_start before sending it
to the hardware.

(*) The datasheets says 16 global contexts, however the IDX fields in TX
    descriptors are 3 bits, which gives a total of 8 contexts. The
    driver assumes there are 8 contexts on 82575: 2 per queues, 4 txqs.

Fixes: 4c8db5f09a ("igb: enable TSO support")
Fixes: af75078fec ("first public release")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-03-25 19:03:48 +01:00
Wenzhuo Lu
2f5c0a4bc4 igb: fix address of device data pointer
In the function set_rx_mode, the pointer of device data points
to the wrong address as found in ixgbe code, and fixed in commit:
"ixgbe: fix PF promiscuous mode after VF closed"

Fixes: be2d648a2d ("igb: add PF support")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2016-03-25 19:03:48 +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
Stephen Hemminger
4a41c17dba igb: set default thresholds based on MAC type
This brings the DPDK igb driver inline with the behavior used by
the current Linux driver. The IGB hardware has several different
MAC types and the threshold values that work vary based on the hardware.

Since DPDK 1.8 it has been up to devices to provide the correct default
configuration parameter. But the igb driver gives values that are broken
on some devices, and always causes a warning message at startup.

Please test this on real hardware, I don't have the luxury of a
hardware lab full of variations of this chip.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 16:58:26 +01:00
Bernard Iremonger
8361d1ccdd e1000: fix VF MAC address on close
Allow reprogramming of the RAR with a zero mac address,
to ensure that the VF traffic goes to the PF after
stop, close and detach of the VF.

Fixes: be2d648a2d ("igb: add PF support")
Fixes: d82170d279 ("igb: add VF support")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 16:58:16 +01:00
Yury Kylulin
b37af6490f e1000: support VF promiscuous and allmulticast
Enable promiscuous and allmulticast mode control from the VF using
rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() and
rte_eth_allmulticast_enable()/rte_eth_allmulticast_disable().

For promiscuous mode host/PF igb driver should be built with
IGB_ENABLE_VF_PROMISC.

For allmulticast mode "allmulti" flag should be set for appropriate PF
ifconfig eth0 allmulti

Signed-off-by: Yury Kylulin <yury.kylulin@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 16:57:59 +01:00
Ravi Kerur
1da352d62e e1000: support I217 and I218 devices
Modified driver and eal code to support I217 and I218 Intel NICs.

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

Signed-off-by: Ravi Kerur <rkerur@gmail.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2016-03-16 16:57:48 +01:00
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
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
Stephen Hemminger
8862010a80 remove double semicolons
Trivial cleanup

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-12-07 04:57:16 +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
Wenzhuo Lu
2a3cf07108 igbvf: fix MAC address if none assigned by PF
If use DPDK PF + DPDK VF on igb NICs, we find the MAC address of VF
port is always 0. Because we forget to give it a value if this MAC
address is not assigned by PF. This patch'll assign a random MAC
address to igb VF port as ixgbe does.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-11-27 19:38:23 +01:00
Cunming Liang
4a4ee6c361 igb: 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: fe685de2b1 ("igb: fix VF start with PF stopped")

Reported-by: Yong Liu <yong.liu@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-11-24 14:56:07 +01:00
Harry van Haaren
156c5a8cf9 e1000: 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
Jon DeVree
1be847dd45 e1000: fix PCI device info with secondary process
This fixes a bug added to em and igb drivers which causes the pci info
seen by the primary process to become invalidated by secondary process
startup.
This call was added after the process type check in the other drivers.

Fixes: eeefe73f0a ("drivers: copy PCI device info to ethdev data")

Signed-off-by: Jon DeVree <nuxi@vault24.org>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2015-11-23 23:51:14 +01:00
Pablo de Lara
9c857bf6be igb: 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: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Reviewed-by: John McNamara <john.mcnamara@intel.com>
2015-11-13 17:44:41 +01:00
Stephen Hemminger
65ed00f834 e1000: use common functions to manage DMA zone
Use common code to handle Xen support at runtime.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
2015-11-13 11:43:02 +01:00
Stephen Hemminger
66bf77cea8 e1000: do not report deprecated statistics
These fields are marked deprecated don't use them.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2015-11-12 23:04:14 +01:00
Julien Meunier
6a5f84590a igbvf: fix vlan filtering
Once posted through mailbox, we must check for nack from the PF
and report an error in this case.

Signed-off-by: Julien Meunier <julien.meunier@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-11-10 17:14:52 +01:00
Cunming Liang
fe685de2b1 igb: fix VF start with PF stopped
When igb runs as a PF, mbox interrupt is prerequisite to make VF
start normally.
And PF sometimes won't 'dev_start', so the mbox interrupt register
during 'dev_init' is required.
The patch rolls back the interrupt register for mbox,lsc to the 'dev_init'.
As UIO doesn't support multiple vector, mbox has to occupy the only one.
It adds condition check on 'dev_start', rxq interrupt is not allowed
when PF running in IOV mode via UIO.

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
2015-11-04 15:27:41 +01:00
Cunming Liang
5ede7566c3 igb: avoid enabling interrupt with zero vector
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
2015-11-04 15:27:41 +01:00
Cunming Liang
1c07ecb413 igb: reserve VFIO vector zero for misc interrupt
According to the VFIO interrupt mapping, the interrupt vector id
for rxq starts from RX_VEC_START.
It doesn't impact the UIO cases.

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
2015-11-04 15:27:41 +01:00
Bernard Iremonger
eeefe73f0a drivers: copy PCI device info to ethdev data
Use new function rte_eth_copy_pci_info.
Copy device info for the following pdevs:

bnx2x
cxgbe
e1000
enic
fm10k
i40e
ixgbe
mlx4
mlx5
virtio
vmxnet3

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-11-03 18:39:26 +01:00
Harry van Haaren
c7e7256056 igbvf: add extended stats
Add xstats functionality to igbvf PMD, adding
necessary statistic strings.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Maryam Tahhan <maryam.tahhan@intel.com>
2015-11-03 00:18:00 +01:00
Harry van Haaren
38552317dc igb: add extended stats
Add xstats_get() and xstats_reset() functions to igb
driver, and the necessary strings to expose these
NIC statistics.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Maryam Tahhan <maryam.tahhan@intel.com>
2015-11-03 00:17:41 +01:00
Konstantin Ananyev
b4755467c9 e1000: get queue info and descriptor limits
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2015-11-02 00:14:00 +01:00
Jingjing Wu
27b609cbd1 ethdev: move the multi-queue mode check to specific drivers
Different NIC has its specific constraint on the multi-queue
configuration, so move the checking from ethdev lib to drivers.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-11-01 14:44:31 +01:00
Yong Liu
921a72008f e1000: add Rx interrupt handler
When datapath rxq interrupt is enabled, enable related device rxq.
Remove the interrupt handler after device stopped.
e1000 only support one type of interrupt cause, so remove lsc interrupt
handler if rxq enabled.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
2015-10-29 19:08:38 +01:00
Yong Liu
dcfd32cfa2 e1000: support Rx interrupt setup
Enable rx interrupt support on e1000 physical and emulated device.
Implement rxq interrupt related functions in eth_dev_ops structure.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
2015-10-29 19:08:25 +01:00
Yong Liu
72d9269cd8 e1000: separate link and Rx interrupt disabling
Separate lsc and rxq interrupt for they have different interrupt handlers.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
2015-10-29 18:57:12 +01:00
Yong Liu
667b9313f9 e1000: restrict link interrupt setup scope
Only mask lsc interrupt bit when setup device interrupt.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
2015-10-29 18:55:07 +01:00
Harry van Haaren
f38770578f igb: fix build without ieee1588 enabled
This patch marks rxq with RTE_SET_USED in
rx_desc_hlen_type_rss_to_pkt_flags(), when
ieee1588 is disabled. Previously a compilation
error occurred on unused-parameter.

Fixes: 1ce6591e23 ("igb: fix ieee1588 frame identification in i210")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-10-28 18:30:05 +01:00
Harry van Haaren
795618c0aa igbvf: fix statistic wraparound
Fix a misinterpreatation of VF statistic macro in e1000/igb.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Roger Melton <rmelton@cisco.com>
2015-10-28 14:41:11 +01:00
Pablo de Lara
1ce6591e23 igb: fix ieee1588 frame identification in i210
Fixed issue where the flag PKT_RX_IEEE1588_PTP was not being set
in Intel I210 NIC, as EtherType in RX descriptor is in bits 8:10 of
Packet Type and not in the default bits 0:2.

Fixes known issue "IEEE1588 support possibly not working
with an Intel Ethernet Controller I210 NIC"

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-28 14:41:11 +01:00
Wang Xiao W
4c8db5f09a igb: enable TSO support
This patch enables igb TSO feature, the feature works on both PF and VF.
The TCP segmentation offload needs to write the offload related information
into the advanced context descriptors, which is similar to checksum offload.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 19:28:06 +01:00
Harry van Haaren
67b38d93c9 e1000: fix total byte statistics
This patch fixes a bug in reading the 64 bit register reading
which was causing the total octets counters to show zero.
Now the code reads both the lower and higher 32 bits.
Tested in testpmd, byte values are correct.

Fixes: 805803445a ("e1000: support EM devices (also known as e1000/e1000e)")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 18:39:44 +01:00
Wenzhuo Lu
d5f46be3d5 e1000/base: minor changes
Some minor code change. No functionality impact.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-27 14:00:36 +01:00
Wenzhuo Lu
212deae353 e1000/base: add new devices
Add some new i218 devices.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-26 21:52:50 +01:00
Wenzhuo Lu
36b2330acc e1000/base: update readme and copyright
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-10-26 21:46:37 +01:00
Thomas Monjalon
ab351fe1c9 mbuf: remove packet type from offload flags
The extended unified packet type is now part of the standard ABI.
As mbuf struct is changed, the mbuf library version is incremented.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-09-03 19:22:48 +02:00
Thomas Monjalon
d8c4ae2755 ethdev: remove Rx interrupt switch
The Rx interrupt feature is now part of the standard ABI.
Because of changes in rte_intr_handle and struct rte_eth_conf,
the eal and ethdev library versions are incremented.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-09-03 19:22:48 +02:00
John McNamara
eebeb3f60b drivers: add warning note to base dirs
This patch adds a note to the README files in the
drivers/net/pmd/base dirs to highlight that the code should not
be modifed by the user apart from the pmd_osdep.[ch] files.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
2015-08-11 00:22:41 +02:00
Wenzhuo Lu
cff4a985ef igb: fix ieee1588 timestamping
Ieee1588 reads system time to set its timestamp. On 1G NICs, for example,
i350, system time is disabled by default. It means the ieee1588 timestamp
will always be 0.
This patch enables system time when ieee1588 is enabled.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2015-08-03 14:42:22 +02:00
Wenzhuo Lu
a711f4dbb5 e1000: fix descriptor done flag with odd address
Header buffer address for header split will be filled with the physical
address for DMA, which is actually not needed at all, as header split
hasn't been supported. Hardware requires the least bit of header address
which is 'Descriptor Done' bit when write back should be set to 0 by driver.
The issue is that if the user wants to reserve an odd number of bytes between
the mbuf header and data buffer, the physical address to be filled in the
descriptor would happen to be odd. That means the DD bit would be set to
non-zero by driver. That will result in reporting descriptor done wrongly.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-08-03 00:38:27 +02:00
Stephen Hemminger
7cf90aeb8d drivers: allow pruning log during build
Some drivers was not following DPDK convention and
was leaving logging always in even if LOG_LEVEL was configured
to disable debug logs.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
[Thomas: apply same fix to i40e, fm10k and bnx2x]
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-07-30 20:16:04 +02:00
Stephen Hemminger
03e93ba4f6 e1000: raise log level of significant events
Any message about incorrect API usage should be at NOTICE
level or above.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2015-07-30 20:15:50 +02:00
Stephen Hemminger
f9ea79e670 e1000: fix log level of debug messages
Any debug messages about hardware should be under debug (or removed)
and reduce customer visible log spam.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2015-07-30 20:15:50 +02:00
Cunming Liang
c3cd3de0ab igb: enable Rx queue interrupts for PF
The patch does below for igb PF:
- Setup NIC to generate MSI-X interrupts
- Set the IVAR register to map interrupt causes to vectors
- Implement interrupt enable/disable functions

Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
2015-07-27 23:13:57 +02:00
Klaus Degner
39cbe613d2 e1000: enable jumbo frame for 82583V device
This patch enables jumbo frame support for the 82583V.
It has been tested ( rx and tx ) with real HW.

Signed-off-by: Klaus Degner <kd@allegro-packets.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-07-26 14:57:41 +02:00
Bernard Iremonger
54a385fa47 e1000: free queue memory when closing
Queues were freed in clear function called in stop function.
Split clearing and freeing in separate functions to
move queue freeing from stop to close function.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-19 21:22:03 +02:00
Bernard Iremonger
b9eee2cb8c e1000: support port hotplug
This patch depends on the Port Hotplug Framework.
It implements the eth_dev_uninit functions for rte_em_pmd,
rte_igb_pmd and rte_igbvf_pmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-19 21:22:03 +02:00
Liang-Min Larry Wang
83c314da4c igb: add access to specific device info
add function to support ethtool ops:
- get_reg_length
- get_regs
- get_eeprom_length
- get_eeprom
- set_eeprom

Signed-off-by: Liang-Min Larry Wang <liang-min.wang@intel.com>
Acked-by: Andrew Harvey <agh@cisco.com>
Acked-by: David Harton <dharton@cisco.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-16 23:56:13 +02:00
Liang-Min Larry Wang
04b51c5af5 igb: add default mac address modifier
- set_mac_addr

Signed-off-by: Liang-Min Larry Wang <liang-min.wang@intel.com>
Acked-by: Andrew Harvey <agh@cisco.com>
Acked-by: David Harton <dharton@cisco.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-16 23:56:13 +02:00
Sergio Gonzalez Monroy
2f9d47013e mem: move librte_malloc to eal/common
Move malloc inside eal and create a new section in MAINTAINERS file for
Memory Allocation in EAL.

Create a dummy malloc library to avoid breaking applications that have
librte_malloc in their DT_NEEDED entries.

This is the first step towards using malloc to allocate memory directly
from memsegs. Thus, memzones would allocate memory through malloc,
allowing to free memzones.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2015-07-16 13:44:48 +02:00
Helin Zhang
e6a10f3e80 igb: replace some offload flags with packet type
To unify packet types among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.

To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-16 00:57:14 +02:00
John McNamara
b8a1a1e7b7 e1000: add ieee1588 timestamping
Add e1000/igb support for new ethdev APIs to enable and read
IEEE1588 PTP timestamps.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-07-10 02:36:25 +02:00
Helin Zhang
8208e85a22 ethdev: add the hash key size per device
To support querying hash key size per port, an new field of
'hash_key_size' was added in 'struct rte_eth_dev_info' for storing
hash key size in bytes.

The correct hash key size in bytes should be filled into the
'struct rte_eth_dev_info', to support querying it.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-09 01:14:51 +02:00
Zoltan Kiss
72514b5d55 ethdev: fix check of threshold for Tx freeing
The parameter tx_free_thresh is not consistent between the drivers:
some use it as rte_eth_tx_burst() requires, some release buffers when
the number of free descriptors drop below this value.
Let's use it as most fast-path code does, which is the latter, and update
comments throughout the code to reflect that.

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-07 16:31:48 +02:00
Ivan Boule
23138c4a88 e1000: add multicast MAC address filtering
Support the PMD function "set_mc_addr_list" in the "igb", "igb-vf",
and "em" Poll Mode Drivers.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
2015-06-12 15:55:38 +02:00
Stephen Hemminger
6c52c126f2 drivers: explicit initialization of pci drivers
Upcoming drivers will need to be able to support other bus types.
This is a transparent change to how struct eth_driver is initialized.
It has not function or ABI layout impact, but makes adding a later
bus type (Xen, Hyper-V, ...) much easier.

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-06-12 11:10:10 +02:00
Bruce Richardson
d15fcf76c8 e1000: move to drivers/net/
Move e1000 pmd to drivers/net directory
As part of move, rename "e1000" subdirectory, which contains the code
from the "base driver", to "base".

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