Commit Graph

254 Commits

Author SHA1 Message Date
Konstantin Ananyev
2f9b171503 ixgbe: fix number of segments with vector scattered Rx
Fixes: cf4b4708a8 (ixgbe: improve slow-path perf with vector scattered Rx)

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-07-30 02:15:32 +02:00
Konstantin Ananyev
1b20b07d86 ixgbe: fix scalar scattered Rx with CRC
For 2.1 release, in attempt to minimize number of RX routines to support,
ixgbe scatter and ixgbe LRO RX routines were merged into one
that can handle both cases.
Though I completely missed the fact, that while LRO could only be used
when HW CRC strip is enabled, scatter RX should work for both cases
(HW CRC strip on/off).
That patch restores missed functionality.

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

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
2015-07-30 02:15:32 +02:00
Xuelin Shi
2e49ae79eb ixgbe: fix data access on big endian cpu
1. cpu use data owned by ixgbe must use rte_le_to_cpu_xx(...)
2. cpu fill data to ixgbe must use rte_cpu_to_le_xx(...)
3. checking pci status with converted constant

Signed-off-by: Xuelin Shi <xuelin.shi@freescale.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-30 02:15:32 +02:00
Jingjing Wu
8d2686c0e4 i40evf: fix crash when setup Tx queues
This patch fixes the issue:
Testpmd crashed with Segmentation fault when setup tx queues on vf
Steps for reproduce:
  - create one vf device from i40e driver
  - bind vf device to igb_uio and start testpmd

With debugging tools, we saw the struct i40e_vf is cleared after
memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf)) in
rte_eth_dev_configure, which should not happen, and the pointer to
i40e_vf isn't in the range of i40e_adapter.

The root cause is the dev_private_size in i40e virtual function driver
struct rte_i40evf_pmd was set incorrectly.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Marvin Liu <yong.liu@intel.com>
2015-07-30 02:15:32 +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
Cunming Liang
0eb609239e ixgbe: enable Rx queue interrupts for PF and VF
The patch does below things for ixgbe PF and VF:
- 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: Yong Liu <yong.liu@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
2015-07-27 23:13:57 +02:00
Bernard Iremonger
d1d1e664c6 bonding: free queue memory when closing
Add function bond_ethdev_free_queues() and call from the
bond_ethdev_close() function.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
2015-07-27 19:20:44 +02:00
Bernard Iremonger
8d30fe7fa7 bonding: support port hotplug
This patch depends on the Port Hotplug Framework.
It implements the rte_dev_uninit_t() function for the link bonding pmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2015-07-27 19:20:44 +02:00
Konstantin Ananyev
48e967695b ixgbe: fix Rx queue reset
As Steve pointed out, the commit 11b220c649 ("ixgbe: fix release queue mbufs")
is not complete.
As at queue stop we don't reset vector related rx queue fields to their
initial values.

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

Reported-by: Cunming Liang <cunming.liang@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-27 15:59:58 +02:00
Chen Jing D(Mark)
4dfda7fb3c fm10k: expose Tx checksum capability
fm10k has the capability to do checksum offload in TX side. This
change will expose the capability to application in infos_get
function.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
2015-07-27 14:43:45 +02:00
Bernard Iremonger
799d1c554a ring: support port hotplug
This patch depends on the Port Hotplug Framework.
It implements the rte_dev_uninit_t() function for the ring pmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.ruchardson@intel.com>
2015-07-27 04:53:04 +02:00
Stephen Hemminger
9fb557035d bnx2x: enable PMD build
This is build infrastructure changes for bnx2x driver.
 - enable BNX2X poll mode driver in default config.
 - add it to mk
 - put entry in MAINTAINERS

Note: I intentionally did not list myself as maintainer of this
driver. QLogic has discussed taking over as maintainer.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Harish Patil <harish.patil@qlogic.com>
2015-07-27 04:27:15 +02:00
Stephen Hemminger
b5bf771922 bnx2x: driver support routines
More code for the Broadcom/Qlogic NetExtreme II poll mode driver.
Split into pieces for review and not to overwhelm mailers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Harish Patil <harish.patil@qlogic.com>
2015-07-27 04:27:10 +02:00
Stephen Hemminger
540a211084 bnx2x: driver core
This is the first of several parts for a new driver supporting
Broadcom/Qlogic NetXtremeII 10 gigabit devices.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Harish Patil <harish.patil@qlogic.com>
2015-07-27 04:27:05 +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
Bruce Richardson
f93f4e35d3 ixgbe: fix check for split packets
The check for split packets to be reassembled in the vector ixgbe PMD
was incorrectly only checking the first 16 elements of the array instead
of all 32. This is fixed by changing the uint32_t values to be uint64_t
instead.

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

Reported-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-26 14:41:27 +02:00
Pablo de Lara
7c574623ba ixgbe: remove Rx bulk allocation option
RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC config option is not really
necessary, as bulk alloc rx function can be used anyway, as long as the
necessary conditions are satisfied, which are checked already
in the library.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-26 12:40:09 +02:00
Konstantin Ananyev
0369957f27 ixgbe: remove awkward typecasts
The vector/SSE pmd used a different element type for the tx queue sw_ring
entries. This led to lots of typecasts in the code which required specific
use of bracketing, leading to subtle errors.
For example, in the original code:
	txe = (struct ixgbe_tx_entry_v *)&txq->sw_ring[i];
instead needs to be written as:
	txe = &((struct ixgbe_tx_entry_v *)txq->sw_ring)[i];

We can eliminate this problem, by having two software ring pointers in the
structure for the two different element types.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-26 10:47:51 +02:00
Konstantin Ananyev
f03b4ea048 ixgbe: rename Tx queue release function
The function inside the vector/SSE poll-mode driver for releasing
the mbufs on the TX queues had the same name as another function
inside the regular PMD. To keep consistency and avoid confusion,
rename the vector PMD version to have a "_vec" suffix.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-26 10:47:51 +02:00
Konstantin Ananyev
11b220c649 ixgbe: fix release queue mbufs
The calculations of what mbufs were valid in the RX and TX queues were
incorrect when freeing the mbufs for the vector PMD. This led to crashes
due to invalid reference counts when mbuf debugging was turned on, and
possibly other more subtle problems (such as mbufs being freed when in use)
in other cases.

To fix this, the following changes were made:
* correct counts and post-loop values in the TX release function for the
  vector code.
* create a new separate RX release function for the RX vector code, since the
  tracking of what mbufs are valid or not is different for that code path

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

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-26 10:47:51 +02:00
Konstantin Ananyev
ae77d1fbff ixgbe: revert mbuf refcnt check when clearing a ring
The bug fix was incorrect as it did not take account of the fact that
the mbufs that were previously freed may have since be re-allocated.

Reverts: b35d0d80f0 ("ixgbe: check mbuf refcnt when clearing a ring")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-26 10:47:51 +02:00
Konstantin Ananyev
5a731d5e70 ixgbe: fix comments on Rx queue fields
The two fields for vector RX rearming in the rx queue structure were
incorrectly labelled. Switching the comments on each around makes things
clearer.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-26 10:47:51 +02:00
Maryam Tahhan
3c47efd90d ixgbe: fix Rx error stats
Bug fix to remove (rxnfgpc - hw_stats->gprc) which does not account
for phy errors.
hw_stats->gprc is the Number of good (non-erred) Rx packets (from the
network) that pass L2 filtering and has a legal length as defined by
LongPacketEnable. While rxnfgpc is the Number of good (non-erred with
legal length) Rx packets (from the network) regardless of packet
filtering and receive enablement. Thus hw_stats->gprc can be > rxnfgpc
and this calculation should be removed from the calculation of ierrors.
Validated with testpmd by sending packets to the interface without
forwarding enabled - packets should be dropped and the error counters
incremented.

Fixes: f6bf669b99 ("ixgbe: account more Rx errors")

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Acked-by: Balazs Nemeth <balazs.nemeth@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Tested-by: Marvin Liu <yong.liu@intel.com>
2015-07-23 14:55:25 +02:00
Rahul Lakkireddy
1f8613f16d cxgbe: enable build on FreeBSD
Fix "MACRO redefined" and "function redefined" compilation errors in FreeBSD
by adding CXGBE prefix to them.  Also remove reference to a linux header
linux/if_ether.h and use DPDK macros directly.  Finally, enable CXGBE PMD
for FreeBSD.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-07-22 15:04:16 +02:00
Stephen Hemminger
5fd61965ef fm10k: fix interrupt fault handling
The fm10k driver was reading the interrupt cause register but then
using the interrupt mask register defines to look at the bits.
The result is that if a fault happens, the driver would never clear
the fault and would get into an infinite cycle of interrupts.

Note: I don't work for Intel or have the hardware manuals (probably
requires NDA anyway), but this looks logical and matches how the
known working Linux driver handles these bits.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-07-22 12:46:43 +02:00
Stephen Hemminger
28d0cf90e0 fm10k: remove useless code
The return in fm10k_dev_handle_fault has useless conditional
since it always returns 0 here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-07-22 12:44:41 +02:00
Stephen Hemminger
f577a753f0 fm10k: fix missing newline in debug log
If FM10K_DEBUG_DRIVER is enabled, then the log messages about
function entry are missing newline causing extremely long lines.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-07-22 12:42:44 +02:00
Pablo de Lara
b50c10cc89 ixgbe: fix build with bulk alloc disabled
ixgbe_recv_pkts_lro uses field rx_free_trigger
in structure ixgbe_rx_queue, but that field is only defined
if IXGBE_RX_ALLOW_BULK_ALLOC is enabled, so even though
that field is not used when it is disabled,
compiler complains about it.
Therefore, the lines of code that use that field
have been ifdef.

Fixes: 8eecb329 ("ixgbe: add LRO support")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2015-07-22 11:56:54 +02:00
Stephen Hemminger
27b31d130e virtio: small cleanups
Some minor cleanups.
  * pass constant to virtio_dev_queue_setup
  * fix message on rx_queue_setup
  * get rid of extra double spaces

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-07-22 10:55:26 +02:00
Stephen Hemminger
945884f14b virtio: fix queue size and number of descriptors
The virtual queue ring size and the number of slots actually usable
are separate parameters. In the most common environment (QEMU)
the virtual queue ring size is 256, but some environments the
ring maybe much larger.

The ring size comes from the host and the driver must use the
actual size passed.

The number of descriptors can be either zero to use the whole
available ring, or some value smaller. This is used to limit
the number of mbufs allocated for the receive ring. If more
descriptors are requested than available the size is silently
truncated.

Note: the ring size (from host) must be a power of two, but
the number of descriptors used can be any size from 1 to the
size of the virtual ring.

Fixes: d78deadae4 ("virtio: fix ring size negotiation")

Reported-by: Changchun Ouyang <changchun.ouyang@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-07-22 10:33:50 +02:00
Stephen Hemminger
fa8cc60774 bonding: fix name and port validation
Cleanup the code in bonding that checks ports.
  * Use standard rte_eth_dev_is_valid_port
  * Change name of driver string to avoid variable namespace conflicts
  * Get rid of unnecessary string comparison stuff. A simple pointer
    check is enough here.
  * Get rid of unnecessary assignment of driver_name, it is already
    done by common code.
  * Don't generate unnecessary log messages on error.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2015-07-20 02:47:38 +02:00
Zhe Tao
b0343d8b36 i40e: fix registers access from big endian CPU
Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
2015-07-20 01:14:08 +02:00
Jingjing Wu
999a867c93 i40evf: fix RSS with less Rx queues than Tx queues
I40e VF driver uses the num_queue_pairs in vf structure to construct
queue index look up table. When the nb_rx_queue is less than nb_tx_queue,
num_queue_pairs is equal to nb_tx_queue. It will make the table use
invalid queue index, then application cannot poll packets on these queues.

This patch also moves the inline function i40e_align_floor from
i40e_ethdev.c to i40e_ethdev.h.

Test report: http://dpdk.org/ml/archives/dev/2015-July/021838.html

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
2015-07-20 01:13:55 +02:00
Jingjing Wu
492a028c65 i40e: fix SCTP flow director
Due to the NIC's firmware update, the input set of sctp flow is changed
to source IP, destination IP, source port, destination port and
Verification-Tag. This patch adds the sport and dport in the programming
packet of flow director.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Marvin Liu <yong.liu@intel.com>
2015-07-20 01:13:17 +02:00
Bernard Iremonger
941d64b5bf virtio: free queue memory when closing
Add function virtio_free_queues() and call from virtio_dev_close()
Use virtio_dev_rx_queue_release() and virtio_dev_tx_queue_release()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2015-07-19 22:24:42 +02:00
Bernard Iremonger
5382b188fb virtio: add queue release
Add functions virtio_dev_queue_release(), virtio_dev_rx_queue_release() and
virtio_dev_tx_queue_release().

Use queue_release in virtio_dev_uninit().

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
2015-07-19 22:24:42 +02:00
Bernard Iremonger
2f7fdb9d52 virtio: check virtqueue parameter when detaching
If vq is NULL, there is a segmentation fault.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2015-07-19 22:24:42 +02:00
Bernard Iremonger
abf4c84b25 virtio: support port hotplug
This patch depends on the Port Hotplug Framework.
It implements the eth_dev_uninit_t() function for virtio pmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2015-07-19 22:24:42 +02:00
Michael Qiu
456d36e6b1 fm10k: support port hotplug
Add hotplug support for fm10k.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
2015-07-19 22:24:41 +02:00
Michael Qiu
2cb9c53449 fm10k: free queue memory when closing
When close a port, lots of memory should be released,
such as software rings, queues, etc.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
2015-07-19 22:24:41 +02:00
Bernard Iremonger
6b45371283 i40e: free queue memory when closing
Add i40e_dev_free_queues() function and call it from close() functions.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-19 21:36:24 +02:00
Bernard Iremonger
1ee9e82289 i40e: check Rx queue parameter when resetting
There is a segmentation fault if rxq is NULL.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-19 21:33:58 +02:00
Bernard Iremonger
de605cb1bc i40evf: clear queues when stopping
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-19 21:31:38 +02:00
Bernard Iremonger
0b475bb5bb i40evf: clear command when error occurs
_clear_cmd() was not being called in failure situations,
resulting in the next command also failing.
Fix several typos.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-19 21:30:19 +02:00
Bernard Iremonger
37d7b38b51 i40evf: increase messaging wait time
Increase delay from 50 * 10 to 100 * 20 to avoid i40evf_read_pfmsg() failures.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-19 21:28:51 +02:00
Bernard Iremonger
3cb446b4ae i40e: free vmdq vsi when closing
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-19 21:28:46 +02:00
Bernard Iremonger
d42aaf3000 i40e: support port hotplug
This patch depends on the Port Hotplug Framework.
It implements the eth_dev_uninit functions for rte_i40e_pmd and
rte_i40evf_pmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
2015-07-19 21:22:23 +02:00
Bernard Iremonger
5b5edfd040 ixgbe: free queue memory when closing
Add ixgbe_dev_free_queues() function and call it from close() functions.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-19 21:22:14 +02:00
Bernard Iremonger
2866c5f1b8 ixgbe: support port hotplug
This patch depends on the Port Hotplug Framework.
It implements the eth_dev_uninit functions for rte_ixgbe_pmd and
rte_ixgbevf_pmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2015-07-19 21:22:14 +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