dpdk.git
9 years agovmxnet3: support port hotplug
Bernard Iremonger [Tue, 27 Oct 2015 17:12:26 +0000 (17:12 +0000)]
vmxnet3: support port hotplug

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Yong Wang <yongwang@vmware.com>
9 years agobonding: remove fake pci interface
Bernard Iremonger [Tue, 3 Nov 2015 13:02:05 +0000 (13:02 +0000)]
bonding: remove fake pci interface

remove pci_dev, pci_drv, rte_bond_pmd and pci_id_table.
handle numa_node for vdevs
handle RTE_ETH_DEV_INTR_LSC for vdevs
rename the function valid_bonded_device to check_for_bonded_device
remove branches on pci_dev

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
9 years agompipe: remove fake pci interface
Bernard Iremonger [Tue, 3 Nov 2015 13:02:04 +0000 (13:02 +0000)]
mpipe: remove fake pci interface

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoxenvirt: remove fake pci interface
Bernard Iremonger [Tue, 3 Nov 2015 13:02:03 +0000 (13:02 +0000)]
xenvirt: remove fake pci interface

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoaf_packet: remove fake pci interface
Bernard Iremonger [Tue, 3 Nov 2015 13:02:02 +0000 (13:02 +0000)]
af_packet: remove fake pci interface

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John W. Linville <linville@tuxdriver.com>
9 years agopcap: remove fake pci interface
Bernard Iremonger [Tue, 3 Nov 2015 13:02:01 +0000 (13:02 +0000)]
pcap: remove fake pci interface

remove rte_pcap_pmd and pci_dev.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoring: remove fake pci interface
Bernard Iremonger [Tue, 3 Nov 2015 13:02:00 +0000 (13:02 +0000)]
ring: remove fake pci interface

remove rte_ring_pmd and pci_dev.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agonull: remove fake pci interface
Bernard Iremonger [Tue, 3 Nov 2015 13:01:59 +0000 (13:01 +0000)]
null: remove fake pci interface

remove rte_null_pmd and pci_dev.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoethdev: remove some PCI specific handling
Bernard Iremonger [Tue, 3 Nov 2015 13:01:58 +0000 (13:01 +0000)]
ethdev: remove some PCI specific handling

use dev_type to distinguish between vdev's and pdev's.
remove pci_dev branches.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agodrivers: copy fake PCI device info to ethdev data
Bernard Iremonger [Tue, 3 Nov 2015 13:01:57 +0000 (13:01 +0000)]
drivers: copy fake PCI device info to ethdev data

Initialise dev_flags, driver, kdrv, drv_name and numa_node fields
in eth_dev data.

for the following vdevs:
null
ring
pcap
af_packet
xenvirt
mpipe
bonding

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agodrivers: copy PCI device info to ethdev data
Bernard Iremonger [Tue, 3 Nov 2015 13:01:56 +0000 (13:01 +0000)]
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>
9 years agoethdev: add device fields from PCI layer
Bernard Iremonger [Tue, 3 Nov 2015 13:01:55 +0000 (13:01 +0000)]
ethdev: add device fields from PCI layer

The driver fields have been added the rte_eth_dev_data so that it is no
longer necessary access this data through the pci_dev pointer.

The following fields have been added to rte_eth_dev_data:

dev_flags, and macros for dev_flags.
kdrv
numa_node
drv_name

Add function rte_eth_copy_pci_info

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
[Thomas: remove useless flags]

9 years agoeal: set name to threads
Ravi Kerur [Wed, 29 Jul 2015 00:51:44 +0000 (17:51 -0700)]
eal: set name to threads

This patch adds support for pthread_setname_np on Linux and
pthread_set_name_np on FreeBSD.

Signed-off-by: Ravi Kerur <rkerur@gmail.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
[Thomas: add name in tep_termination example]

9 years agoethdev: clean port id retrieval when attaching
Ravi Kerur [Wed, 23 Sep 2015 21:16:17 +0000 (14:16 -0700)]
ethdev: clean port id retrieval when attaching

Removed following functions
   > rte_eth_dev_save and
   > rte_eth_dev_get_changed_port

Added 2 new functions
   > rte_eth_dev_get_port_by_name
   > rte_eth_dev_get_port_by_addr

Compiled on Linux for following targets
   > x86_64-native-linuxapp-gcc
   > x86_64-native-linuxapp-clang
   > x86_x32-native-linuxapp-gcc

Compiled on FreeBSD for following targets
   > x86_64-native-bsdapp-clang
   > x86_64-native-bsdapp-gcc

Tested on Linux/FreeBSD:
   > port attach eth_null
   > port start all
   > port stop all
   > port close all
   > port detach 0
   > port attach eth_null
   > port start all
   > port stop all
   > port close all
   > port detach 0

Successful run of checkpatch.pl on the diffs

Successful validate_abi on Linux for following targets

   > x86_64-native-linuxapp-gcc
   > x86_64-native-linuxapp-clang

Signed-off-by: Ravi Kerur <rkerur@gmail.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agovhost: fix build with old kernels
Marcel Apfelbaum [Tue, 3 Nov 2015 11:28:41 +0000 (13:28 +0200)]
vhost: fix build with old kernels

Commit 15e9ee6982a4822ce395fd597dd500a61ceafa7c
uses the VIRTIO_F_VERSION_1 macro existing only in newer kernels.

Fixed it by manually defining it for older kernels.

Fixes: 15e9ee6982a4 ("vhost: enable virtio 1.0")

Reported-by: Qian Xu <qian.q.xu@intel.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
9 years agovirtio: fix size of MAC address array
Ivan Boule [Thu, 29 Oct 2015 08:46:15 +0000 (09:46 +0100)]
virtio: fix size of MAC address array

Make the virtio PMD allocate the array of unicast MAC addresses with
the maximum of entries (VIRTIO_MAX_MAC_ADDRS) that it exports.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
9 years agoixgbe: remove useless fields in checksum offload
Didier Pallard [Thu, 29 Oct 2015 08:47:53 +0000 (09:47 +0100)]
ixgbe: remove useless fields in checksum offload

According to Table 7-38: Valid Fields by Offload Option
of Intel ® 82599 10 GbE Controller Datasheet,
L4LEN field is not needed for L4 XSUM computation by the hardware.
So remove l4_len from tx_offload_mask in ixgbe_set_xmit_ctx
function used to build the context transmitted to the hardware.

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
9 years agomlx5: support RETA query and update
Nelio Laranjeiro [Mon, 2 Nov 2015 18:11:57 +0000 (19:11 +0100)]
mlx5: support RETA query and update

ConnectX-4 adapters do not have a constant indirection table size, which is
set at runtime from the number of RX queues. The maximum size is retrieved
using a hardware query and is normally 512.

Since the current RETA API cannot handle a variable size, any query/update
command causes it to be silently updated to RSS_INDIRECTION_TABLE_SIZE
entries regardless of the original size.

Also due to the underlying type of the configuration structure, the maximum
size is limited to RSS_INDIRECTION_TABLE_SIZE (currently 128, at most 256
entries).

A port stop/start must be done to apply the new RETA configuration.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agoi40evf: support AQ based RSS config
Helin Zhang [Tue, 13 Oct 2015 07:19:50 +0000 (15:19 +0800)]
i40evf: support AQ based RSS config

It supports both Admin queue based and directly writing registers
based RSS hash key and lookup table configuration, as X722 supports
AQ based configuration.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
9 years agoi40e: support AQ based RSS config
Helin Zhang [Tue, 13 Oct 2015 07:19:49 +0000 (15:19 +0800)]
i40e: support AQ based RSS config

It supports both Admin queue based and directly writing registers
based RSS hash key and lookup table configuration, as X722 supports
AQ based configuration.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
9 years agoi40e: support X722 and its A0 hardware
Helin Zhang [Tue, 13 Oct 2015 07:19:48 +0000 (15:19 +0800)]
i40e: support X722 and its A0 hardware

In order to provide users early access of X722 and its A0 hardware,
new device IDs are added, and also compilation with those support
in base driver is enabled.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
9 years agoapp/test: add performance test for ring driver
Bruce Richardson [Wed, 30 Sep 2015 12:12:22 +0000 (13:12 +0100)]
app/test: add performance test for ring driver

Add a performance test for ring pmd, comparing performance of the pmd
compared to the basic rte_ring APIs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoring: create device from a ring
Bruce Richardson [Wed, 30 Sep 2015 12:12:21 +0000 (13:12 +0100)]
ring: create device from a ring

Add a one-parameter function to take an existing rte_ring and wrap it as
an ethdev, returning the port id of the new ethdev instance.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoring: store memzone pointer
Bruce Richardson [Wed, 30 Sep 2015 12:12:20 +0000 (13:12 +0100)]
ring: store memzone pointer

Add a new field to the rte_ring structure to store the memzone pointer which
contains the ring. For rings created using rte_ring_create(), the field will
be set automatically.

This new field will allow users of the ring to query the numa node a ring is
allocated on, or to get the physical address of the ring, if so needed.

The rte_ring structure will also maintain ABI compatibility, as the
structure members, after the new one, are set to be cache line aligned,
so leaving a space.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoring: enhance device setup from rings
Bruce Richardson [Wed, 30 Sep 2015 12:12:19 +0000 (13:12 +0100)]
ring: enhance device setup from rings

The ring ethdev creation function creates an ethdev, but does not
actually set it up for use. Even if it's just a single ring, the user
still needs to create a mempool, call rte_eth_dev_configure, then call
rx and tx setup functions before the ethdev can be used.

This patch changes things so that the ethdev is fully set up after the
call to create the ethdev. The above-mentionned functions can still be
called - as will be the case, for instance, if the NIC is created via
commandline parameters - but they no longer are essential.

The function now also sets rte_errno appropriately on error, so the
caller can get a better indication of why a call may have failed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoethdev: do not deprecate imissed counter
Maryam Tahhan [Tue, 20 Oct 2015 10:34:18 +0000 (11:34 +0100)]
ethdev: do not deprecate imissed counter

Remove the deprecation tag and notice for imissed as it is a generic
register that accounts for packets that were dropped by the HW,
because there are no available mbufs (RX queues are full). imissed is
different to ierrors and can help with general debug.

Fixes: 49f386542af4 ("ethdev: remove driver specific stats")

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
9 years agoixgbe: remove mac fault counts from Rx errors
Harry van Haaren [Mon, 2 Nov 2015 10:56:09 +0000 (10:56 +0000)]
ixgbe: remove mac fault counts from Rx errors

This patch removes the mac local fault count and
mac remote fault count from rx errors. The mac
fault count registers count faults, not packets,
and hence should not be added to packet counters.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
9 years agovirtio: add extended stats
Harry van Haaren [Mon, 2 Nov 2015 10:19:00 +0000 (10:19 +0000)]
virtio: add extended stats

Add xstats() functions and statistic strings to virtio PMD.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Maryam Tahhan <maryam.tahhan@intel.com>
9 years agofm10k: add extended stats
Harry van Haaren [Mon, 2 Nov 2015 10:19:07 +0000 (10:19 +0000)]
fm10k: add extended stats

Add xstats() functions and statistic strings.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Maryam Tahhan <maryam.tahhan@intel.com>
9 years agoi40evf: add extended stats
Harry van Haaren [Mon, 2 Nov 2015 10:19:06 +0000 (10:19 +0000)]
i40evf: add extended stats

Add implementation of xstats() functions in i40evf PMD.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Maryam Tahhan <maryam.tahhan@intel.com>
9 years agoi40e: add extended stats
Harry van Haaren [Mon, 2 Nov 2015 10:19:05 +0000 (10:19 +0000)]
i40e: add extended stats

Add xstats functions to i40e PMD, allowing extended statistics
to be retrieved from the NIC and exposed to the DPDK.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Maryam Tahhan <maryam.tahhan@intel.com>
9 years agoixgbevf: add extending stats
Harry van Haaren [Mon, 2 Nov 2015 10:19:04 +0000 (10:19 +0000)]
ixgbevf: add extending stats

Add xstats() functions and stat strings as necessary to ixgbevf PMD.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Maryam Tahhan <maryam.tahhan@intel.com>
9 years agoixgbe: add extended statistic strings
Harry van Haaren [Mon, 2 Nov 2015 10:19:03 +0000 (10:19 +0000)]
ixgbe: add extended statistic strings

Added and updated statistic strings as used by xstats_get(),
exposed extended queue statistics.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Maryam Tahhan <maryam.tahhan@intel.com>
9 years agoigbvf: add extended stats
Harry van Haaren [Mon, 2 Nov 2015 10:19:02 +0000 (10:19 +0000)]
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>
9 years agoigb: add extended stats
Harry van Haaren [Mon, 2 Nov 2015 10:19:01 +0000 (10:19 +0000)]
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>
9 years agoethdev: update extending stats strings
Harry van Haaren [Mon, 2 Nov 2015 10:18:59 +0000 (10:18 +0000)]
ethdev: update extending stats strings

Update the strings used for presenting stats to adhere
to the scheme previously presented. Updated xstats_get()
function to handle Q information only if xstats() is not
implemented in the PMD, providing the PMD with the needed
flexibility to expose its extended Q stats.

Add extended statistic section to the programmers
guide, poll mode driver section. This section describes
how the strings stats are formatted, and how the client
code can use this to gather information about the stat.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Maryam Tahhan <maryam.tahhan@intel.com>
9 years agovhost: enable virtio 1.0
Marcel Apfelbaum [Thu, 15 Oct 2015 11:08:39 +0000 (14:08 +0300)]
vhost: enable virtio 1.0

Make vhost-user virtio 1.0 compatible by adding it to the
supported features and keeping the header length
the same as for mergeable RX buffers.

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
9 years agovirtio: pick simple Rx/Tx
Huawei Xie [Thu, 29 Oct 2015 14:53:28 +0000 (22:53 +0800)]
virtio: pick simple Rx/Tx

simple rx/tx func is chose when merge-able rx is disabled and user
specifies single segment and no offload support.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
9 years agovirtio: add simple Tx
Huawei Xie [Thu, 29 Oct 2015 14:53:27 +0000 (22:53 +0800)]
virtio: add simple Tx

Bulk free of mbufs when clean used ring.
Shift operation of idx could be saved if vq_free_cnt means
free slots rather than free descriptors.

TODO: rearrange vq data structure, pack the stats var together so that
we could use one vec instruction to update all of them.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
9 years agovirtio: add vector Rx
Huawei Xie [Thu, 29 Oct 2015 14:53:26 +0000 (22:53 +0800)]
virtio: add vector Rx

With fixed avail ring, we don't need to get desc idx from avail ring.
virtio driver only has to deal with desc ring.
This patch uses vector instruction to accelerate processing desc ring.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
9 years agovirtio: fill Rx avail ring with blank mbufs
Huawei Xie [Thu, 29 Oct 2015 14:53:22 +0000 (22:53 +0800)]
virtio: fill Rx avail ring with blank mbufs

Add software RX ring in virtqueue.
Add fake_mbuf in virtqueue for wraparound processing.
Fill avail ring with blank mbufs in virtio_dev_vring_start

Add virtio_rxtx.h header file for RTE_VIRTIO_PMD_MAX_BURST.
Would move all rx/tx related declarations into this header file in future.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
9 years agovirtio: optimize ring layout
Huawei Xie [Thu, 29 Oct 2015 14:53:24 +0000 (22:53 +0800)]
virtio: optimize ring layout

In DPDK based switching environment, mostly vhost runs on a dedicated core
while virtio processing in guest VMs runs on different cores.
Take RX for example, with generic implementation, for each guest buffer,
a) virtio driver allocates a descriptor from free descriptor list
b) modify the entry of avail ring to point to allocated descriptor
c) after packet is received, free the descriptor

When vhost fetches the avail ring, it need to fetch the modified L1 cache from
virtio core, which is a heavy cost in current CPU implementation.

This idea of this optimization is:
    allocate the fixed descriptor for each entry of avail ring, so avail ring will
always be the same during the run.
This removes L1M cache transfer from virtio core to vhost core for avail ring.
(Note we couldn't avoid the cache transfer for descriptors).
Besides, descriptor allocation and free operation is eliminated.
This also makes vector procesing possible to further accelerate the processing.

This is the layout for the avail ring(take 256 ring entries for example), with
each entry pointing to the descriptor with the same index.
                    avail
                    idx
                    +
                    |
+----+----+---+-------------+------+
| 0  | 1  | 2 | ... |  254  | 255  |  avail ring
+-+--+-+--+-+-+---------+---+--+---+
  |    |    |       |   |      |
  |    |    |       |   |      |
  v    v    v       |   v      v
+-+--+-+--+-+-+---------+---+--+---+
| 0  | 1  | 2 | ... |  254  | 255  |  desc ring
+----+----+---+-------------+------+
                    |
                    |
+----+----+---+-------------+------+
| 0  | 1  | 2 |     |  254  | 255  |  used ring
+----+----+---+-------------+------+
                    |
                    +

This is the ring layout for TX.
As we need one virtio header for each xmit packet, we have 128 slots available.

                         ++
                         ||
                         ||
+-----+-----+-----+--------------+------+------+------+
|  0  |  1  | ... |  127 || 128  | 129  | ...  | 255  |   avail ring
+--+--+--+--+-----+---+------+---+--+---+------+--+---+
   |     |            |  ||  |      |             |
   v     v            v  ||  v      v             v
+--+--+--+--+-----+---+------+---+--+---+------+--+---+
| 128 | 129 | ... |  255 || 128  | 129  | ...  | 255  |   desc ring for virtio_net_hdr
+--+--+--+--+-----+---+------+---+--+---+------+--+---+
   |     |            |  ||  |      |             |
   v     v            v  ||  v      v             v
+--+--+--+--+-----+---+------+---+--+---+------+--+---+
|  0  |  1  | ... |  127 ||  0   |  1   | ...  | 127  |   desc ring for tx dat
+-----+-----+-----+--------------+------+------+------+
                         ||
                         ||
                         ++

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
9 years agofm10k: fix crash in vector Rx
Chen Jing D(Mark) [Fri, 30 Oct 2015 08:03:06 +0000 (16:03 +0800)]
fm10k: fix crash in vector Rx

Vector RX function will process 4 packets at a time. When the RX
ring wrapps to the tail and the left descriptor size is not multiple
of 4, SW will overwrite memory that not belongs to it and cause crash.
The fix will allocate additional 4 HW/SW spaces at the tail to avoid
overwrite.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agofm10k: select best Tx function
Chen Jing D(Mark) [Fri, 30 Oct 2015 08:03:05 +0000 (16:03 +0800)]
fm10k: select best Tx function

Add func fm10k_set_tx_function to decide the best TX func in
fm10k_dev_tx_init.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agofm10k: reset and release mbuf for vector Tx
Chen Jing D(Mark) [Fri, 30 Oct 2015 08:03:03 +0000 (16:03 +0800)]
fm10k: reset and release mbuf for vector Tx

Vector TX use different way to manage TX queue, it's necessary
to use different functions to reset TX queue and release mbuf
in TX queue. So, introduce 2 function pointers to do such ops.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agofm10k: add vector Tx
Chen Jing D(Mark) [Fri, 30 Oct 2015 08:03:02 +0000 (16:03 +0800)]
fm10k: add vector Tx

Add Vector TX func fm10k_xmit_pkts_vec to transmit packets.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agofm10k: release mbuf for vector Rx
Chen Jing D(Mark) [Fri, 30 Oct 2015 08:03:01 +0000 (16:03 +0800)]
fm10k: release mbuf for vector Rx

Since Vector RX use different variables to trace RX HW ring, it
leads to need different func to release mbuf properly.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agofm10k: select best Rx function
Chen Jing D(Mark) [Fri, 30 Oct 2015 08:03:00 +0000 (16:03 +0800)]
fm10k: select best Rx function

Add func fm10k_set_rx_function to decide best RX func in
fm10k_dev_rx_init

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agofm10k: add vector scatter Rx
Chen Jing D(Mark) [Fri, 30 Oct 2015 08:02:59 +0000 (16:02 +0800)]
fm10k: add vector scatter Rx

Add func fm10k_recv_scattered_pkts_vec to receive chained packets
with SSE instructions.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agofm10k: add vector Rx condition check
Chen Jing D(Mark) [Fri, 30 Oct 2015 08:02:58 +0000 (16:02 +0800)]
fm10k: add vector Rx condition check

Add func fm10k_rx_vec_condition_check to check if Vector RX
func can be applied.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agofm10k: add vector Rx
Chen Jing D(Mark) [Fri, 30 Oct 2015 08:02:57 +0000 (16:02 +0800)]
fm10k: add vector Rx

This patch add below functions:
1. Add function fm10k_rxq_rearm to re-allocate mbuf for used desc
in RX HW ring.
2. Add 2 functions, in which using SSE instructions to parse RX desc
to get pkt_type and ol_flags in mbuf.
3. Add func fm10k_recv_raw_pkts_vec to parse raw packets, in which
includes possible chained packets.
4. Add func fm10k_recv_pkts_vec to receive single mbuf packet.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agofm10k: move parameters initialization
Chen Jing D(Mark) [Fri, 30 Oct 2015 08:02:56 +0000 (16:02 +0800)]
fm10k: move parameters initialization

Add new function fm10k_params_init to initialize all fm10k related
variables.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agofm10k: add vector pre-condition check
Chen Jing D(Mark) [Fri, 30 Oct 2015 08:02:55 +0000 (16:02 +0800)]
fm10k: add vector pre-condition check

Add condition check in rx_queue_setup func. If number of RX desc
can't satisfy vPMD requirement, record it into a variable. Or
call fm10k_rxq_vec_setup to initialize Vector RX.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agofm10k: introduce vector driver
Chen Jing D(Mark) [Fri, 30 Oct 2015 08:02:54 +0000 (16:02 +0800)]
fm10k: introduce vector driver

Add new file fm10k_rxtx_vec.c and add it into compiling.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agoapp/testpmd: add command to display queue info
Konstantin Ananyev [Tue, 27 Oct 2015 12:51:50 +0000 (12:51 +0000)]
app/testpmd: add command to display queue info

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
9 years agovmxnet3: get descriptor limits
Konstantin Ananyev [Tue, 27 Oct 2015 12:51:49 +0000 (12:51 +0000)]
vmxnet3: get descriptor limits

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Yong Wang <yongwang@vmware.com>
Acked-by: Remy Horton <remy.horton@intel.com>
9 years agocxgbe: get descriptor limits
Konstantin Ananyev [Tue, 27 Oct 2015 12:51:48 +0000 (12:51 +0000)]
cxgbe: get descriptor limits

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
9 years agofm10k: get descriptor limits
Konstantin Ananyev [Tue, 27 Oct 2015 12:51:47 +0000 (12:51 +0000)]
fm10k: get descriptor limits

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
9 years agoe1000: get queue info and descriptor limits
Konstantin Ananyev [Tue, 27 Oct 2015 12:51:46 +0000 (12:51 +0000)]
e1000: get queue info and descriptor limits

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
9 years agoixgbe: get queue info and descriptor limits
Konstantin Ananyev [Tue, 27 Oct 2015 12:51:45 +0000 (12:51 +0000)]
ixgbe: get queue info and descriptor limits

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
9 years agoi40e: get queue info and descriptor limits
Konstantin Ananyev [Tue, 27 Oct 2015 12:51:44 +0000 (12:51 +0000)]
i40e: get queue info and descriptor limits

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
9 years agoethdev: add API to retrieve queue information
Konstantin Ananyev [Tue, 27 Oct 2015 12:51:43 +0000 (12:51 +0000)]
ethdev: add API to retrieve queue information

Add the ability for the upper layer to query RX/TX queue information.
Add into rte_eth_dev_info new fields to represent information about
RX/TX descriptors min/max/alig nnumbers per queue for the device.

Add new structures:
struct rte_eth_rxq_info
struct rte_eth_txq_info

new functions:
rte_eth_rx_queue_info_get
rte_eth_tx_queue_info_get

into rte_etdev API.

Left extra free space in the queue info structures,
so extra fields could be added later without ABI breakage.

Add new fields:
rx_desc_lim
tx_desc_lim
into rte_eth_dev_info.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
9 years agoi40e: fix alignment of HW descriptors number
Konstantin Ananyev [Wed, 30 Sep 2015 19:04:30 +0000 (20:04 +0100)]
i40e: fix alignment of HW descriptors number

According to XL710 datasheet:
RX QLEN restrictions: When the PXE_MODE flag in the GLLAN_RCTL_0
register is cleared, the QLEN must be whole number of 32
descriptors.
TX QLEN restrictions: When the PXE_MODE flag in the GLLAN_RCTL_0
register is cleared, the QLEN must be whole number of 32
descriptors.

So make sure that for both RX and TX queues number of HW descriptors is
a multiple of 32.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
9 years agobonding: support stats per queue
Tomasz Kulasek [Fri, 30 Oct 2015 14:25:54 +0000 (15:25 +0100)]
bonding: support stats per queue

This patch adds fills bonding port's stats with a sum of corresponding
values taken from bonded slaves, when stats are requested for bonding port.

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agoapp/test: add dynamic bonding RSS configuration
Tomasz Kulasek [Fri, 30 Oct 2015 14:25:53 +0000 (15:25 +0100)]
app/test: add dynamic bonding RSS configuration

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agonull: add virtual RSS configuration
Tomasz Kulasek [Fri, 30 Oct 2015 14:25:52 +0000 (15:25 +0100)]
null: add virtual RSS configuration

This implementation allows to set and read RSS configuration for null
device, and is used to validate right values propagation over the slaves,
in test units for dynamic RSS configuration for bonding.

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agonull: export creation function
Tomasz Kulasek [Fri, 30 Oct 2015 14:25:51 +0000 (15:25 +0100)]
null: export creation function

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agonull: extend number of virtual queues
Tomasz Kulasek [Fri, 30 Oct 2015 14:25:50 +0000 (15:25 +0100)]
null: extend number of virtual queues

This patch adds a possibility to configure more than one queue on null
device.

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agonull: fix crash when added to bonding
Tomasz Kulasek [Fri, 30 Oct 2015 14:25:49 +0000 (15:25 +0100)]
null: fix crash when added to bonding

This patch initializes eth_dev->link_intr_cbs queue used when null pmd is
added to the bonding.

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agobonding: support RSS dynamic configuration
Tomasz Kulasek [Fri, 30 Oct 2015 14:25:48 +0000 (15:25 +0100)]
bonding: support RSS dynamic configuration

Bonding device implements independent management of RSS settings. It
stores its own copies of settings i.e. RETA, RSS hash function and RSS
key. It’s required to ensure consistency.

1) RSS hash function set for bonding device is maximal set of RSS hash
functions supported by all bonded devices. That mean, to have RSS support
for bonding, all slaves should be RSS-capable.

2) RSS key is propagated over the slaves "as is".

3) RETA for bonding is an internal table managed by bonding API, and is
used as a pattern to set up slaves. Its size is GCD of all RETA sizes, so
it can be easily used as a pattern providing expected behavior, even if
slaves RETA sizes are different.

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agodoc: fix spelling in bonding guide
Tomasz Kulasek [Fri, 30 Oct 2015 14:25:55 +0000 (15:25 +0100)]
doc: fix spelling in bonding guide

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agofm10k: support VMDQ in multi-queue configuration
Shaopeng He [Sat, 31 Oct 2015 02:44:43 +0000 (10:44 +0800)]
fm10k: support VMDQ in multi-queue configuration

Add separate functions to configure VMDQ and RSS.
Update dglort map and logic ports accordingly.
Reset MAC/VLAN filter after VMDQ config was changed.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agofm10k: support VMDQ in MAC/VLAN filter
Shaopeng He [Sat, 31 Oct 2015 02:44:42 +0000 (10:44 +0800)]
fm10k: support VMDQ in MAC/VLAN filter

The patch does below things for fm10k MAC/VLAN filter:
- Add separate functions for VMDQ and main VSI to change
  MAC filter.
- Disable modification to VLAN filter in VMDQ mode.
- In device close phase, delete logic ports to remove all
  MAC/VLAN filters belonging to those ports.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agofm10k: check multi-queue mode
Shaopeng He [Sat, 31 Oct 2015 02:44:41 +0000 (10:44 +0800)]
fm10k: check multi-queue mode

Add multi-queue checking in device configure function.
Currently, VMDQ and RSS are supported.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agoapp/testpmd: add command to display DCB info
Jingjing Wu [Sat, 31 Oct 2015 15:57:31 +0000 (23:57 +0800)]
app/testpmd: add command to display DCB info

This patch adds a command to display DCB info in ports.

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>
9 years agoapp/testpmd: setup DCB forwarding based on traffic class
Jingjing Wu [Sat, 31 Oct 2015 15:57:30 +0000 (23:57 +0800)]
app/testpmd: setup DCB forwarding based on traffic class

This patch changes the testpmd DCB forwarding stream to make it
based on traffic class.
It also fixes some coding style issues.

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>
9 years agoethdev: get DCB information
Jingjing Wu [Sat, 31 Oct 2015 15:57:27 +0000 (23:57 +0800)]
ethdev: get DCB information

This patch adds one new API to get dcb related info.
  rte_eth_dev_get_dcb_info

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>
9 years agoixgbe: support DCB+RSS multi-queue mode
Jingjing Wu [Sat, 31 Oct 2015 15:57:26 +0000 (23:57 +0800)]
ixgbe: support DCB+RSS multi-queue mode

This patch enables DCB+RSS multi-queue mode, and also fix some coding
style.

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>
9 years agoi40e: support DCB mode
Jingjing Wu [Sat, 31 Oct 2015 15:57:25 +0000 (23:57 +0800)]
i40e: support DCB mode

This patch enables DCB feature on Intel XL710/X710 NICs. It includes:
  Receive queue classification based on traffic class
  Round Robin ETS schedule (rx and tx)
  Priority flow control

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>
9 years agoethdev: move the multi-queue mode check to specific drivers
Jingjing Wu [Sat, 31 Oct 2015 15:57:24 +0000 (23:57 +0800)]
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>
9 years agoethdev: rename DCB field in config structs
Jingjing Wu [Sat, 31 Oct 2015 15:57:23 +0000 (23:57 +0800)]
ethdev: rename DCB field in config structs

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>
9 years agomlx5: handle link status interrupts
Nelio Laranjeiro [Fri, 30 Oct 2015 18:57:23 +0000 (19:57 +0100)]
mlx5: handle link status interrupts

Add interrupts handler for port status notification.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: handle link status interrupts
Nelio Laranjeiro [Fri, 30 Oct 2015 18:57:22 +0000 (19:57 +0100)]
mlx4: handle link status interrupts

Add interrupts handler for port status notification.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agoeal: allow external interrupt handler
Nelio Laranjeiro [Fri, 30 Oct 2015 18:57:21 +0000 (19:57 +0100)]
eal: allow external interrupt handler

Add RTE_INTR_HANDLE_EXT handler type for PMDs that do not support VFIO or
UIO.  Those are expected to manage the file descriptor themselves.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agomlx5: update documentation
Adrien Mazarguil [Fri, 30 Oct 2015 18:55:19 +0000 (19:55 +0100)]
mlx5: update documentation

Add new features related to Mellanox OFED 3.1 support.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx5: fix build with GCC < 4.6
Yaacov Hazan [Fri, 30 Oct 2015 18:55:18 +0000 (19:55 +0100)]
mlx5: fix build with GCC < 4.6

Seen with GCC < 4.6:

 error: unknown field ‘tcp_udp’ specified in initializer
 error: extra brace group at end of initializer

Static initialization of anonymous structs/unions is a C11 feature
properly supported only since GCC 4.6.

Work around compilation errors with older versions by expanding
struct ibv_exp_flow_spec into struct hash_rxq_init.

Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx5: enable multi packet send WR in Tx CQ
Adrien Mazarguil [Fri, 30 Oct 2015 18:55:17 +0000 (19:55 +0100)]
mlx5: enable multi packet send WR in Tx CQ

For adapters that support it, this flag improves performance outside of VF
context.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx5: support IPv6 RSS using experimental flows
Adrien Mazarguil [Fri, 30 Oct 2015 18:55:16 +0000 (19:55 +0100)]
mlx5: support IPv6 RSS using experimental flows

Normal flows do not currently provide IPv6 support.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agomlx5: disable useless flows in promiscuous mode
Nelio Laranjeiro [Fri, 30 Oct 2015 18:55:15 +0000 (19:55 +0100)]
mlx5: disable useless flows in promiscuous mode

Only a single flow per hash RX queue is needed in promiscuous mode.
Disable others to free up hardware resources.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
9 years agoapp/testpmd: fix missing init in RSS hash show command
Adrien Mazarguil [Fri, 30 Oct 2015 18:55:14 +0000 (19:55 +0100)]
app/testpmd: fix missing init in RSS hash show command

The "show port X rss-hash" command sometimes displays garbage instead of the
expected RSS hash key because the maximum key length is undefined. When the
requested key is too large to fit in the buffer,
rte_eth_dev_rss_hash_conf_get() does not update it.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agoapp/testpmd: add missing type to RSS hash commands
Nelio Laranjeiro [Fri, 30 Oct 2015 18:55:13 +0000 (19:55 +0100)]
app/testpmd: add missing type to RSS hash commands

DPDK uses a structure to get or set a new hash key (see
eth_rte_rss_hash_conf).  rss_hf field from this structure is used in
rss_hash_get_conf to retrieve the hash key and in rss_hash_update uses
it to verify the key exists before trying to update it.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agomlx5: use one RSS hash key per flow type
Nelio Laranjeiro [Fri, 30 Oct 2015 18:55:12 +0000 (19:55 +0100)]
mlx5: use one RSS hash key per flow type

DPDK expects to have an RSS hash key per flow type (IPv4, IPv6, UDPv4,
etc.), to handle this the PMD must keep a table of hash keys to be able
to reconfigure the queues at each start/stop call.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx5: support RSS hash update and get
Nelio Laranjeiro [Fri, 30 Oct 2015 18:55:11 +0000 (19:55 +0100)]
mlx5: support RSS hash update and get

First implementation of rss_hash_update and rss_hash_conf_get, those
functions still lack in functionality but are usable to change the RSS
hash key.  For now, the PMD does not handle an indirection table for
each kind of flow (IPv4, IPv6, etc.), the same RSS hash key is used
for all protocols.  This situation explains why the rss_hash_conf_get
returns the RSS hash key for all DPDK supported protocols and why the
hash key is set for all of them too.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx5: use alternate method to configure promisc and allmulti modes
Olga Shern [Fri, 30 Oct 2015 18:55:10 +0000 (19:55 +0100)]
mlx5: use alternate method to configure promisc and allmulti modes

Promiscuous and allmulticast modes were historically enabled by adding
specific flows with types IBV_FLOW_ATTR_ALL_DEFAULT or
IBV_EXP_FLOW_ATTR_MC_DEFAULT to each hash RX queue, but this method is
deprecated.

- Promiscuous mode is now enabled by omitting destination MAC addresses from
  basic flow specifications.
- Allmulticast mode is now enabled by using flow specifications that match
  the broadcast bit in destination MAC addresses.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
9 years agomlx5: define specific flow steering rules for each hash Rx QP
Olga Shern [Fri, 30 Oct 2015 18:55:09 +0000 (19:55 +0100)]
mlx5: define specific flow steering rules for each hash Rx QP

All hash RX QPs currently use the same flow steering rule (L2 MAC filtering)
regardless of their type (TCP, UDP, IPv4, IPv6), which prevents them from
being dispatched properly. This is fixed by adding flow information to the
hash RX queue initialization data and generating specific flow steering
rules for each of them.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agomlx5: adapt indirection table size depending on Rx queues number
Nelio Laranjeiro [Fri, 30 Oct 2015 18:55:08 +0000 (19:55 +0100)]
mlx5: adapt indirection table size depending on Rx queues number

Use the maximum size of the indirection table when the number of requested
RX queues is not a power of two, this help to improve RSS balancing.

A message informs users that balancing is not optimal in such cases.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx5: use separate indirection table for default hash Rx queue
Olga Shern [Fri, 30 Oct 2015 18:55:07 +0000 (19:55 +0100)]
mlx5: use separate indirection table for default hash Rx queue

The default hash RX queue handles packets that are not matched by more
specific types and requires its own indirection table of size 1 to work
properly.

This commit implements support for multiple indirection tables by grouping
their layout and properties in a static initialization table.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
9 years agomlx5: refactor Rx code for the new verbs RSS API
Adrien Mazarguil [Fri, 30 Oct 2015 18:55:06 +0000 (19:55 +0100)]
mlx5: refactor Rx code for the new verbs RSS API

The new Verbs RSS API is lower-level than the previous one and much more
flexible but requires RX queues to use Work Queues (WQs) internally instead
of Queue Pairs (QPs), which are grouped in an indirection table used by a
new kind of hash RX QPs.

Hash RX QPs and the indirection table together replace the parent RSS QP
while WQs are mostly similar to child QPs.

RSS hash key is not configurable yet.

Summary of changes:

- Individual DPDK RX queues do not store flow properties anymore, this info
  is now part of the hash RX queues.
- All functions affecting the parent queue when RSS is enabled or the basic
  queues otherwise are modified to affect hash RX queues instead.
- Hash RX queues are also used when a single DPDK RX queue is configured (no
  RSS) to remove that special case.
- Hash RX queues and indirection table are created/destroyed when device
  is started/stopped in addition to create/destroy flows.
- Contrary to QPs, WQs are moved to the "ready" state before posting RX
  buffers, otherwise they are ignored.
- Resource domain information is added to WQs for better performance.
- CQs are not resized anymore when switching between non-SG and SG modes as
  it does not work correctly with WQs. Use the largest possible size
  instead, since CQ size does not have to be the same as the number of
  elements in the RX queue. This also applies to the maximum number of
  outstanding WRs in a WQ (max_recv_wr).

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Or Ami <ora@mellanox.com>
Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
9 years agomlx5: get rid of the WR structure in Rx queue elements
Adrien Mazarguil [Fri, 30 Oct 2015 18:55:05 +0000 (19:55 +0100)]
mlx5: get rid of the WR structure in Rx queue elements

Removing this structure reduces the size of SG and non-SG RX queue elements
significantly to improve performance.

An nice side effect is that the mbuf pointer is now fully stored in
struct rxq_elt instead of relying on the WR ID data offset hack.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Or Ami <ora@mellanox.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agomlx5: use fast verbs interface for scattered Rx
Adrien Mazarguil [Fri, 30 Oct 2015 18:55:04 +0000 (19:55 +0100)]
mlx5: use fast verbs interface for scattered Rx

This commit updates mlx5_rx_burst_sp() to use the fast verbs interface for
posting RX buffers just like mlx5_rx_burst(). Doing so avoids a loop in
libmlx5 and an indirect function call through libibverbs.

Note: recv_sg_list() is not implemented in the QP burst API, this commit is
only to prepare transition to the WQ-based API.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>