Commit Graph

3263 Commits

Author SHA1 Message Date
Bernard Iremonger
6799cfe407 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>
2015-11-03 18:46:52 +01:00
Bernard Iremonger
b1fb53a39d 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>
2015-11-03 18:41:03 +01:00
Bernard Iremonger
8fb9e2bbf9 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>
2015-11-03 18:39:42 +01:00
Bernard Iremonger
eeefe73f0a drivers: copy PCI device info to ethdev data
Use new function rte_eth_copy_pci_info.
Copy device info for the following pdevs:

bnx2x
cxgbe
e1000
enic
fm10k
i40e
ixgbe
mlx4
mlx5
virtio
vmxnet3

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2015-11-03 18:39:26 +01:00
Bernard Iremonger
494adb7f63 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]
2015-11-03 18:39:23 +01:00
Ravi Kerur
67b6d3039e 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]
2015-11-03 15:32:34 +01:00
Ravi Kerur
9c5b8d8b9f 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>
2015-11-03 14:18:34 +01:00
Marcel Apfelbaum
45c55d39c5 vhost: fix build with old kernels
Commit 15e9ee6982
uses the VIRTIO_F_VERSION_1 macro existing only in newer kernels.

Fixed it by manually defining it for older kernels.

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

Reported-by: Qian Xu <qian.q.xu@intel.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
2015-11-03 12:33:04 +01:00
Ivan Boule
b5b0467ca8 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>
2015-11-03 11:40:58 +01:00
Didier Pallard
6b39b947a9 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>
2015-11-03 11:40:36 +01:00
Nelio Laranjeiro
634efbc2c8 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>
2015-11-03 11:23:15 +01:00
Helin Zhang
647d1eaf75 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>
2015-11-03 11:13:32 +01:00
Helin Zhang
d0a349409b 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>
2015-11-03 11:11:43 +01:00
Helin Zhang
92fbf2cbdf 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>
2015-11-03 11:11:19 +01:00
Bruce Richardson
ea764afadd 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>
2015-11-03 02:01:58 +01:00
Bruce Richardson
f3a0daf347 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>
2015-11-03 02:01:56 +01:00
Bruce Richardson
4768c47500 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>
2015-11-03 01:59:06 +01:00
Bruce Richardson
651c505af8 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>
2015-11-03 01:57:11 +01:00
Maryam Tahhan
4eadb8ba11 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: 49f386542a ("ethdev: remove driver specific stats")

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
2015-11-03 00:39:45 +01:00
Harry van Haaren
48dd1a82a6 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>
2015-11-03 00:30:29 +01:00
Harry van Haaren
76d4c652e0 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>
2015-11-03 00:19:25 +01:00
Harry van Haaren
3a47e1583c 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>
2015-11-03 00:19:18 +01:00
Harry van Haaren
da61cd0849 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>
2015-11-03 00:19:12 +01:00
Harry van Haaren
f4a91c38b4 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>
2015-11-03 00:19:05 +01:00
Harry van Haaren
156712ba40 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>
2015-11-03 00:18:28 +01:00
Harry van Haaren
4c46f55173 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>
2015-11-03 00:18:09 +01:00
Harry van Haaren
c7e7256056 igbvf: add extended stats
Add xstats functionality to igbvf PMD, adding
necessary statistic strings.

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

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Maryam Tahhan <maryam.tahhan@intel.com>
2015-11-03 00:17:41 +01:00
Harry van Haaren
b291f3f96d 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>
2015-11-03 00:07:15 +01:00
Marcel Apfelbaum
15e9ee6982 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>
2015-11-02 23:12:27 +01:00
Huawei Xie
8d8393fb18 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>
2015-11-02 15:34:44 +01:00
Huawei Xie
c121c8d6d3 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>
2015-11-02 15:34:03 +01:00
Huawei Xie
fc3d66212f 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>
2015-11-02 15:33:43 +01:00
Huawei Xie
cab0461234 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>
2015-11-02 15:32:19 +01:00
Huawei Xie
b4ae9c505f 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>
2015-11-02 15:31:42 +01:00
Chen Jing D(Mark)
3764b6724b 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>
2015-11-02 10:00:21 +01:00
Chen Jing D(Mark)
d04e80f1e5 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>
2015-11-02 10:00:21 +01:00
Chen Jing D(Mark)
fb9066e479 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>
2015-11-02 10:00:02 +01:00
Chen Jing D(Mark)
21f13c541e 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>
2015-11-02 10:00:02 +01:00
Chen Jing D(Mark)
b6719f8a04 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>
2015-11-02 10:00:02 +01:00
Chen Jing D(Mark)
77a8ab47eb 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>
2015-11-02 10:00:02 +01:00
Chen Jing D(Mark)
fe65e1e1ce 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>
2015-11-02 10:00:01 +01:00
Chen Jing D(Mark)
f737f211f0 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>
2015-11-02 10:00:01 +01:00
Chen Jing D(Mark)
7092be8437 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>
2015-11-02 10:00:01 +01:00
Chen Jing D(Mark)
162f32290a 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>
2015-11-02 09:59:15 +01:00
Chen Jing D(Mark)
039991bc28 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>
2015-11-02 09:59:00 +01:00
Chen Jing D(Mark)
a6ce64a975 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>
2015-11-02 09:55:51 +01:00
Konstantin Ananyev
ab3257e13d 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>
2015-11-02 00:14:52 +01:00
Konstantin Ananyev
cac43b19e3 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>
2015-11-02 00:14:00 +01:00
Konstantin Ananyev
946c9ed956 cxgbe: get descriptor limits
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
2015-11-02 00:14:00 +01:00