dpdk.git
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>
9 years agomlx4: fix missing unlock in case of error
Adrien Mazarguil [Fri, 30 Oct 2015 19:00:09 +0000 (20:00 +0100)]
mlx4: fix missing unlock in case of error

Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: do not complain about port state
Adrien Mazarguil [Fri, 30 Oct 2015 19:00:08 +0000 (20:00 +0100)]
mlx4: do not complain about port state

Port is considering inactive when the related netdevice is down. There is no
reason to warn about it (and confuse users) since it's automatically brought
up later by the PMD.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: improve Rx performance with better prefetching
Nelio Laranjeiro [Fri, 30 Oct 2015 19:00:07 +0000 (20:00 +0100)]
mlx4: improve Rx performance with better prefetching

Prefetching initial bytes of mbuf structures earlier and in two cache lines
instead of one improves performance of mlx4_rx_burst(), which accesses the
mbuf->next field not present in the first 128 bytes.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agomlx5: add documentation
Adrien Mazarguil [Fri, 30 Oct 2015 18:52:42 +0000 (19:52 +0100)]
mlx5: add documentation

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx5: support checksum offload
Adrien Mazarguil [Fri, 30 Oct 2015 18:52:41 +0000 (19:52 +0100)]
mlx5: support checksum offload

This is the same implementation as mlx4.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agomlx5: support VLAN filtering
Adrien Mazarguil [Fri, 30 Oct 2015 18:52:40 +0000 (19:52 +0100)]
mlx5: support VLAN filtering

All MAC RX flows must be updated with VLAN information when configuring a
VLAN filter.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agomlx5: support flow control
Adrien Mazarguil [Fri, 30 Oct 2015 18:52:39 +0000 (19:52 +0100)]
mlx5: support flow control

Like most other device control operations, those are handled by the related
kernel network device through syscalls.

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

Link information is retrieved using ethtool ioctls.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agomlx5: support promiscuous and allmulticast Rx modes
Adrien Mazarguil [Fri, 30 Oct 2015 18:52:37 +0000 (19:52 +0100)]
mlx5: support promiscuous and allmulticast Rx modes

These modes require special non-MAC flows.

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: add software counters
Adrien Mazarguil [Fri, 30 Oct 2015 18:52:36 +0000 (19:52 +0100)]
mlx5: add software counters

Hardware counters are not supported yet.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agomlx5: support MTU configuration
Adrien Mazarguil [Fri, 30 Oct 2015 18:52:35 +0000 (19:52 +0100)]
mlx5: support MTU configuration

Depending on the MTU and whether jumbo frames are enabled, RX queues may
switch between SG and non-SG modes for better performance.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agomlx5: support scattered Rx and Tx
Adrien Mazarguil [Fri, 30 Oct 2015 18:52:34 +0000 (19:52 +0100)]
mlx5: support scattered Rx and Tx

A dedicated RX callback is added to handle scattered buffers. For better
performance, it is only used when jumbo frames are enabled and MTU is larger
than a single mbuf.

On the TX path, scattered buffers are also handled in a separate function.
When there are more than MLX5_PMD_SGE_WR_N segments in a given mbuf, the
remaining segments are linearized in the last SGE entry.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agomlx5: add device configure/start/stop
Adrien Mazarguil [Fri, 30 Oct 2015 18:52:33 +0000 (19:52 +0100)]
mlx5: add device configure/start/stop

This commit adds the remaining missing callbacks to make mlx5 usable.
Like mlx4, device start and stop are implemented on top of MAC RX flows.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Francesco Santoro <francesco.santoro@6wind.com>
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
9 years agomlx5: add MAC handling
Adrien Mazarguil [Fri, 30 Oct 2015 18:52:32 +0000 (19:52 +0100)]
mlx5: add MAC handling

This commit adds support for MAC flow steering rules mandatory for the RX
path as well as the related callbacks to add/remove MAC addresses.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
9 years agomlx5: support non-scattered Tx and Rx
Adrien Mazarguil [Fri, 30 Oct 2015 18:52:31 +0000 (19:52 +0100)]
mlx5: support non-scattered Tx and Rx

RSS implementation with parent/child QPs comes from mlx4 and is temporary.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
9 years agomlx5: introduce new driver for Mellanox ConnectX-4 adapters
Adrien Mazarguil [Fri, 30 Oct 2015 18:52:30 +0000 (19:52 +0100)]
mlx5: introduce new driver for Mellanox ConnectX-4 adapters

In its current state, this driver implements the bare minimum to initialize
itself and Mellanox ConnectX-4 adapters without doing anything else
(no RX/TX for instance). It is disabled by default since it is based on the
mlx4 driver and also depends on libibverbs.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Or Ami <ora@mellanox.com>
9 years agovhost: use new eventfd copy
Pavel Boldin [Wed, 28 Oct 2015 18:33:49 +0000 (20:33 +0200)]
vhost: use new eventfd copy

Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovhost: add new eventfd copy ioctl
Pavel Boldin [Wed, 28 Oct 2015 18:33:48 +0000 (20:33 +0200)]
vhost: add new eventfd copy ioctl

Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agovhost: refactor eventfd copy handler
Pavel Boldin [Wed, 28 Oct 2015 18:33:47 +0000 (20:33 +0200)]
vhost: refactor eventfd copy handler

* Move ioctl `EVENTFD_COPY' code to a separate function
* Remove extra #includes
* Introduce function fget_from_files
* Fix ioctl return values

Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agoenic: improve Tx packet rate
John Daley [Thu, 29 Oct 2015 18:45:16 +0000 (11:45 -0700)]
enic: improve Tx packet rate

For every packet sent, a completion was being requested and the
posted_index register on the nic was being updated. Instead, request a
completion and update the posted index once per burst after all
packets have been sent by the burst function.

Signed-off-by: John Daley <johndale@cisco.com>
Acked-by: Sujith Sankar <ssujith@cisco.com>
9 years agoxenvirt: free queues when closing
Bernard Iremonger [Tue, 27 Oct 2015 16:03:14 +0000 (16:03 +0000)]
xenvirt: free queues when closing

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agoxenvirt: support port hotplug
Bernard Iremonger [Tue, 27 Oct 2015 16:03:13 +0000 (16:03 +0000)]
xenvirt: support port hotplug

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
9 years agoi40e: allow vector Rx and Tx usage
Zhe Tao [Fri, 30 Oct 2015 14:16:38 +0000 (22:16 +0800)]
i40e: allow vector Rx and Tx usage

To support FVL PMD can select which RX and TX function should be used
according to the queue config.

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agoi40e: add vector scatter Rx
Zhe Tao [Fri, 30 Oct 2015 14:16:37 +0000 (22:16 +0800)]
i40e: add vector scatter Rx

To support the multiple segments in one packets when the received pkts exceed
 one buffer size.

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agoi40e: add vector Tx
Zhe Tao [Fri, 30 Oct 2015 14:16:36 +0000 (22:16 +0800)]
i40e: add vector Tx

The way to increase the performance of the vPMD TX is to use some fast mbuf
release method compares to the scalar TX.

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agoi40e: add vector Rx
Zhe Tao [Fri, 30 Oct 2015 14:16:35 +0000 (22:16 +0800)]
i40e: add vector Rx

The vPMD RX function uses the multi-buffer and SSE instructions to
accelerate the RX speed, but now the pktype cannot be supported by the vPMD RX,
because it will decrease the performance heavily.

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agovhost: fix build with kernel < 3.8
Yuanhan Liu [Thu, 29 Oct 2015 03:37:45 +0000 (11:37 +0800)]
vhost: fix build with kernel < 3.8

Fix build error:
  virtio-net.c:80:89: error: ‘VIRTIO_NET_F_MQ’ undeclared here
  rte_virtio_net.h:109: error: ‘VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX’ undeclared here

Above two virtio-net MQ macros are introduced since kernel v3.8.
For older kernel, we should not reference them directly, hence,
this patch introduced two wrapper macros, with proper values
being set depending on we support MQ or not.

Fixes: b09b198bfb5c ("vhost-user: announce queue number in message")

Reported-by: Yongjie Gu <yongjiex.gu@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: David Marchand <david.marchand@6wind.com>
9 years agovhost: fix crash with multiqueue enabled
Tetsuya Mukawa [Wed, 28 Oct 2015 03:47:40 +0000 (12:47 +0900)]
vhost: fix crash with multiqueue enabled

The patch fixes wrong handling of virtqueue array index when
GET_VRING_BASE message comes.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
9 years agoi40e: support flow control
Zhe Tao [Fri, 30 Oct 2015 04:57:35 +0000 (12:57 +0800)]
i40e: support flow control

Feature Add: Rx/Tx flow control support for the i40e

All the Rx/Tx LFC enable/disable operation is done by the F/W,
so PMD driver need to use the Set PHY Config AD command to trigger the PHY
to do the auto-negotiation, after the Tx/Rx pause ability is negotiated,
the F/W will help us to set the related LFC enable/disable registers.
PMD driver also need to configure the related registers to control
how often to send the pause frame and what the value in the pause frame.

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoi40evf: fix write back with virtual channel 1.1
Jingjing Wu [Wed, 21 Oct 2015 02:17:51 +0000 (10:17 +0800)]
i40evf: fix write back with virtual channel 1.1

If DPDK is used on VF while the host is using Linux Kernel driver
as PF driver on FVL NIC, then VF Rx is reported only in batches of
4 packets. It is due to the kernel driver assumes VF driver is working
in interrupt mode, but DPDK VF is working in Polling mode.
This patch fixes this issue by using the V1.1 virtual channel with
Linux i40e PF driver.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoi40e: drop flow control frames from VF
Jingjing Wu [Mon, 19 Oct 2015 06:31:57 +0000 (14:31 +0800)]
i40e: drop flow control frames from VF

This patch adds a workaround to drop flow control frames from being
transmitted from VSIs.
With this patch in place a malicious VF cannot send flow control or PFC
packets out on the wire.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoapp/testpmd: modify mac in csum forwarding
Michael Qiu [Fri, 7 Aug 2015 03:29:16 +0000 (11:29 +0800)]
app/testpmd: modify mac in csum forwarding

For some ethnet-switch like intel RRC, all the packet forwarded
out by DPDK will be dropped in switch side, so the packet
generator will never receive the packet.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agofm10k: support Boulder Rapid device
Michael Qiu [Mon, 26 Oct 2015 04:53:55 +0000 (12:53 +0800)]
fm10k: support Boulder Rapid device

Boulder Rapid is Intel new NIC within fm10k family.
This patch make DPDK driver support this new NIC.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
9 years agofm10k: enable TSO support
Wang Xiao W [Mon, 12 Oct 2015 06:37:16 +0000 (14:37 +0800)]
fm10k: enable TSO support

This patch enables fm10k TSO feature for both non-tunneling packet
and tunneling packet.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>