dpdk.git
8 years agodoc: fix nics features matrix for mlx
Adrien Mazarguil [Thu, 7 Apr 2016 10:34:30 +0000 (12:34 +0200)]
doc: fix nics features matrix for mlx

Enable "other kdrv" because both NICs require kernel support to work.

Unicast and multicast MAC filters are also enabled as both address types can
be filtered on through the MAC add/remove/set callbacks.

Fixes: e86b85ca757b ("doc: fill nics features matrix for mlx")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agodoc: fix nics features matrix for ixgbe
Wenzhuo Lu [Thu, 7 Apr 2016 02:08:53 +0000 (10:08 +0800)]
doc: fix nics features matrix for ixgbe

Fixes: 83a4a15404ef ("doc: fill nics features matrix for e1000/igb and ixgbe")

Reported-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agodoc: fill nics features matrix for fm10k
Chen Jing D(Mark) [Thu, 7 Apr 2016 09:34:47 +0000 (17:34 +0800)]
doc: fill nics features matrix for fm10k

Add feature support list for fm10k, fm10k-vec, fm10kvf and
fm10kvf-vec.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
8 years agodoc: update multi process memory figure
Harry van Haaren [Wed, 6 Apr 2016 13:17:43 +0000 (14:17 +0100)]
doc: update multi process memory figure

This patch updates the titles in the multiprocess memory image
to read "Primary Process" and "Secondary Process" instead of
"DPDK Server Process" and "Customer Client Process".

The rest of the image has been converted from PNG to SVG.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
8 years agodoc: add initialization section for crypto vdevs
Pablo de Lara [Mon, 4 Apr 2016 13:14:37 +0000 (14:14 +0100)]
doc: add initialization section for crypto vdevs

Explain how to create/initialize virtual crypto PMDs,
through command line and within an application.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agodoc: fix typos in crypto titles
Pablo de Lara [Mon, 4 Apr 2016 13:14:35 +0000 (14:14 +0100)]
doc: fix typos in crypto titles

Fixes: eec136f3c54f ("aesni_gcm: add driver for AES-GCM crypto operations")
Fixes: 94b0ad8e0aa5 ("null_crypto: add driver for null crypto operations")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agodoc: update libsso link for SNOW 3G
Pablo de Lara [Fri, 1 Apr 2016 11:23:57 +0000 (12:23 +0100)]
doc: update libsso link for SNOW 3G

A new process to request the libsso library required by the SNOW3G PMD
has been put in place, through a website, replacing the previous email method.
This commit updates the SNOW3G documentation, to reflect this change.

Since the library does not support newer gcc versions, the documentation
also contains a patch to make the library work with gcc > 5.0.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agocryptodev: remove experimental label
Fiona Trahe [Wed, 6 Apr 2016 11:05:08 +0000 (12:05 +0100)]
cryptodev: remove experimental label

The cryptodev API was introduced in the DPDK 2.2 release.
Since then it has
 - been reviewed and iterated for the DPDK 16.04 release
 - had extensive use by the l2fwd-crypto app,
the ipsec-secgw example app,
the test app.
We believe it is now stable and the EXPERIMENTAL label should be removed.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agocryptodev: rename elements for clarity
Fiona Trahe [Mon, 4 Apr 2016 17:14:35 +0000 (18:14 +0100)]
cryptodev: rename elements for clarity

renamed rte_cryptodev_sym_session.type -> dev_type
(as it's not a session type, but a device type)

renamed rte_crypto_sym_op.type -> sess_type
(as it's not an op type, but a session type)

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
8 years agoaesni_gcm: fix supported key sizes
Pablo de Lara [Wed, 6 Apr 2016 15:39:31 +0000 (16:39 +0100)]
aesni_gcm: fix supported key sizes

AES-GCM PMD only supports 128-bit keys, but not 192 and 256,
which the capabilities structure was reporting.

Fixes: 26c2e4ad5ad4 ("cryptodev: add capabilities discovery")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agovhost: fix retrieval of numa node in driver
Ciara Loftus [Tue, 5 Apr 2016 16:09:47 +0000 (17:09 +0100)]
vhost: fix retrieval of numa node in driver

After some testing, it was found that retrieving numa information
about a vhost device via a call to get_mempolicy is more
accurate when performed during the new_device callback versus
the vring_state_changed callback, in particular upon initial boot
of the VM.  Performing this check during new_device is also
potentially more efficient as this callback is only triggered once
during device initialisation, compared with vring_state_changed
which may be called multiple times depending on the number of
queues assigned to the device.

Reorganise the code to perform this check and assign the correct
socket_id to the device during the new_device callback.

Fixes: ee584e9710b9 ("vhost: add driver on top of the library")

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agoapp/test: fix reentrancy autotest
Olivier Matz [Wed, 6 Apr 2016 13:28:01 +0000 (15:28 +0200)]
app/test: fix reentrancy autotest

The previous code in func_reentrancy autotest was doing in parallel
something close to:

  name = "common_name";
  do several times {
      obj = allocate_an_object(name)   // obj = ring, mempool, hash, lpm, ...
      if (obj == NULL && lookup(name) == NULL)
          return TEST_FAIL;
  }

This code is not safe. For instance:

   mempool_create() is called on core 0, it creates a ring. At the same
   time on core 1, mempool_create() is called too and the creation of the
   ring fails (EEXIST). But the mempool lookup can fail on core 1 if
   the mempool is not added in the list by core 0.

This commit fixes the func_reentrancy autotest that now works with all
tested class of objects.

Fixes: 104a92bd02 ("app: add reentrancy tests")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agohash: fix race condition at creation
Olivier Matz [Wed, 6 Apr 2016 13:28:00 +0000 (15:28 +0200)]
hash: fix race condition at creation

To avoid a race condition while creating a new hash object, the
list has to be locked before the lookup, and released only once the
new object is added in the list.

As the lock is held by the rte_ring_create(), move its creation at the
beginning of the function and only take the lock after the ring is
created to avoid a deadlock.

Fixes: 48a3991196 ("hash: replace with cuckoo hash implementation")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agohash: fix allocation of an existing object
Olivier Matz [Wed, 6 Apr 2016 13:27:59 +0000 (15:27 +0200)]
hash: fix allocation of an existing object

Change rte_hash*_create() functions to return NULL and set rte_errno to
EEXIST when the object name already exists. This is the behavior
described in the API documentation in the header file.

These functions were returning a pointer to the existing object in that
case, but it is a problem as the caller did not know if the object had
to be freed or not.

Doing this change also makes the hash API more consistent with the other
APIs (mempool, rings, ...).

Fixes: 916e4f4f4e ("memory: fix for multi process support")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agolpm: fix allocation of an existing object
Olivier Matz [Wed, 6 Apr 2016 13:27:58 +0000 (15:27 +0200)]
lpm: fix allocation of an existing object

Change rte_lpm*_create() functions to return NULL and set rte_errno to
EEXIST when the object name already exists. This is the behavior
described in the API documentation in the header file.

These functions were returning a pointer to the existing object in that
case, but it is a problem as the caller did not know if the object had
to be freed or not.

Doing this change also makes the lpm API more consistent with the other
APIs (mempool, rings, ...).

Fixes: 916e4f4f4e ("memory: fix for multi process support")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoethdev: refine API to query supported packet types
Jianfeng Tan [Wed, 6 Apr 2016 03:51:13 +0000 (11:51 +0800)]
ethdev: refine API to query supported packet types

This change is to  make user code simpler. For PMDs which do not fill any
packet types, return 0 instead of -ENOTSUP as suggested by Bruce.

Usually, users only care if the required (by ptype_mask) ptypes can be
filled by the specified PMD. If the PMD implements dev_supported_ptypes_get
func is not important. And the introduce of another return value (-ENOTSUP)
would increase the complexity of user programs to check it.

Besides, there are ways to know if a PMD implements the func:
  a. see doc/guides/nics/overview.rst.
  b. use (~1) as parameter ptype_mask, then check if return 0.

Fixes: 78a38edf66de ("ethdev: query supported packet types")

Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoena: fix build with icc
Ferruh Yigit [Wed, 6 Apr 2016 12:17:26 +0000 (13:17 +0100)]
ena: fix build with icc

With (ICC) 16.0.2 20160204, getting following warnings:

.../drivers/net/ena/base/ena_com.c(492): error #3656: variable
 "flags" may be used before its value is set
 ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags);

.../drivers/net/ena/base/ena_com.c(1971): error #3656: variable
 "mem_handle" may be used before its value is set
 ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, len,

For both warnings the variable value is ignored, so there is no defect.
To comfort compiler warning, a initial value provided to variables.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
8 years agoi40e: fix TSO
Zhe Tao [Wed, 6 Apr 2016 08:16:32 +0000 (16:16 +0800)]
i40e: fix TSO

Issue:

when using the following CLI in testpmd to enable ipv6 TSO feature
(set --txqflags=0 in the testpmd command)
set verbose 1
csum set ip hw 0
csum set udp hw 0
csum set tcp hw 0
csum set sctp hw 0
csum set outer-ip hw 0
csum parse_tunnel on 0
tso set 800 0
set fwd csum
start

We will not get what we want, the ipv6 packets sent out from IXIA can be
received by i40e, but cannot forward to another port.
The root cause is when HW doing the TSO offload for packets, it does not only
depends on the context descriptor to define the MSS and TSO payload size, it
also need to know whether this packets is ipv4 or ipv6, we use
i40e_txd_enable_checksum to generate the related fields for data descriptor.
But PMD will not call i40e_txd_enable_checksum if only the TSO offload flag is
set. The reason why ipv4 works fine for TSO in testpmd csum mode is csum engine
will set the ip csum flag when the packet is ipv4 and TSO is enabled but
will not set the flag for ipv6 and this flag will cause the
i40e_txd_enable_checksum to be invoked. For both the cases the TSO flag will be
set, so we need to use TSO flag to trigger the i40e_txd_enable_checksum.
The right logic here is we enable csum offload for both ipv4 and ipv6 when TSO
flag is set.

Fixes: e3f0151f ("i40e: enable Tx checksum only for offloaded packets")

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoi40evf: fix link info update
Jingjing Wu [Tue, 5 Apr 2016 02:01:34 +0000 (10:01 +0800)]
i40evf: fix link info update

The issue is the VF's link speed kept as 10G and status always was up.
It did not change even the physical link's status changed.
This patch fixes this issue to make VF's link info consistent with
physical link.

Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agoigb: fix i350 VF Rx
Wenzhuo Lu [Tue, 5 Apr 2016 01:10:00 +0000 (09:10 +0800)]
igb: fix i350 VF Rx

A problem is found on i350 VF. We found TX will happen once
per 4 packets. If only 1~3 packets are received, they will
not be forwarded. But the real problem is on RX side. The
reason is the default RX write-back threshold is changed to
4, so every first 3 packets may be hung there.

This patch checks the RX wthresh when setting up the RX
queue, and forces it to be 1, so every packet can be handled
immediately.

Fixes: 4a41c17dba18 ("igb: set default thresholds based on MAC type")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agovirtio: use zeroed memory for simple Tx header
Rich Lane [Tue, 5 Apr 2016 02:11:01 +0000 (19:11 -0700)]
virtio: use zeroed memory for simple Tx header

For simple TX the virtio-net header must be zeroed, but it was using memory
that had been initialized with indirect descriptor tables. This resulted in
"unsupported gso type" errors from librte_vhost.

We can use the same memory for every descriptor to save cachelines in the
vswitch.

Fixes: 6dc5de3a ("virtio: use indirect ring elements")

Signed-off-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
8 years agovhost: fix error handling in destroy
Yuanhan Liu [Tue, 5 Apr 2016 06:00:43 +0000 (14:00 +0800)]
vhost: fix error handling in destroy

Fix following coverity defect:

    291     void
    292     vhost_destroy_device(struct vhost_device_ctx ctx)
    293     {
    294             struct virtio_net *dev = get_device(ctx);
    295
    >>>     CID 124565:  Null pointer dereferences  (NULL_RETURNS)
    >>>     Dereferencing a null pointer "dev".

Fixes: 45ca9c6f7bc6 ("vhost: get rid of linked list for devices")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agoethdev: fix xstats retrieval with a null array
Olivier Matz [Mon, 4 Apr 2016 15:45:18 +0000 (17:45 +0200)]
ethdev: fix xstats retrieval with a null array

Coverity reports an issue in ethdev:

  *** CID 124562:  Null pointer dereferences  (FORWARD_NULL)
  /lib/librte_ether/rte_ethdev.c: 1518 in rte_eth_xstats_get()
  1512
  1513 /* global stats */
  1514      for (i = 0; i < RTE_NB_STATS; i++) {
  1515          stats_ptr = RTE_PTR_ADD(&eth_stats,
  1516
  rte_stats_strings[i].offset);
  1517 val = *stats_ptr;
  >>>     CID 124562:  Null pointer dereferences  (FORWARD_NULL)
  >>>     Dereferencing null pointer "xstats".
  1518                snprintf(xstats[count].name,
  sizeof(xstats[count].name),
  1519 "%s", rte_stats_strings[i].name);
  1520            xstats[count++].value = val;
  1521            }
  1522
  1523 /* per-rxq stats */

If a user calls rte_eth_xstats_get(portid, NULL, n) with n != 0,
it may result in a crash. Although the API documentation says that
n is the size of the table and xstats can be NULL if n == 0, we
can add an additional check here to make Coverity happy.

In that case, the return value is the same than when n == 0 is
passed, it returns the number of statistics.

Fixes: ce757f5c9a ("ethdev: new method to retrieve extended statistics")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
8 years agoapp/test: increase memory for group 2
Olivier Matz [Tue, 5 Apr 2016 07:36:41 +0000 (09:36 +0200)]
app/test: increase memory for group 2

The hash test (located in group_2) may require more than 64MB of memory,
especially if the memory is physically fragmented, making the test to
fail. So increase the memory to 128MB to avoid this issue.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoapp/test: fix EAL flags check
Olivier Matz [Mon, 4 Apr 2016 16:19:55 +0000 (18:19 +0200)]
app/test: fix EAL flags check

Since commit a88ba49e51, values larger than 4 are allowed,
the autotests need to be updated accordingly.

Fixes: a88ba49e51 ("config: fix CPU and memory parameters on IBM POWER8")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoexamples/l3fwd: fix crash with gcc 5
Tomasz Kulasek [Mon, 4 Apr 2016 14:45:23 +0000 (16:45 +0200)]
examples/l3fwd: fix crash with gcc 5

It seems that with gcc >5.x and -O2/-O3 optimization breaks packet
grouping algorithm.

When last packet pointer "lp" and "pnum->u64" buffer points the same
memory buffer, high optimization can cause unpredictable results.
It seems that assignment of precalculated group sizes may interfere
with initialization of new group size when lp points value inside
current group and didn't should be changed.

With gcc >5.x and optimization we cannot be sure which assignment will
be done first, so the group size can be counted incorrectly.

This patch eliminates intersection of assignment of initial group size
(lp[0] = 1) and precalculated group sizes when gptbl[v].idx < 4.

Fixes: 94c54b4158d5 ("examples/l3fwd: rework exact-match")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agodoc: fill nics features matrix for virtio
Jianfeng Tan [Tue, 5 Apr 2016 03:31:38 +0000 (11:31 +0800)]
doc: fill nics features matrix for virtio

Note: virtio is a para-virtualization device, which indicates that its
features depend on not only front end but also back end. Here by X, we
just mean the feature is supported in front end.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
8 years agodoc: fill nics features matrix for enic
John Daley [Tue, 5 Apr 2016 18:46:11 +0000 (11:46 -0700)]
doc: fill nics features matrix for enic

Signed-off-by: John Daley <johndale@cisco.com>
8 years agodoc: fill nics features matrix for e1000/igb and ixgbe
Wenzhuo Lu [Tue, 5 Apr 2016 02:54:10 +0000 (10:54 +0800)]
doc: fill nics features matrix for e1000/igb and ixgbe

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agodoc: announce ABI change for PCI class
Ziye Yang [Wed, 17 Feb 2016 01:54:33 +0000 (09:54 +0800)]
doc: announce ABI change for PCI class

The purpose of this patch is used to add a new field
"class" in rte_pci_id structure. The new class field includes
class_id, subcalss_id, programming interface of a pci device.
With this field, we can identify pci device by its class info,
which can be more flexible instead of probing the device by
vendor_id OR device_id OR subvendor_id OR subdevice_id.
For example, we can probe all nvme devices by class field, which
can be quite convenient.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
8 years agodoc: announce ABI changes for mempool allocation
Olivier Matz [Thu, 17 Mar 2016 09:05:11 +0000 (10:05 +0100)]
doc: announce ABI changes for mempool allocation

Add a deprecation notice for coming changes in mempool for 16.07.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: David Hunt <david.hunt@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
8 years agodoc: announce ABI changes for external mempool manager
David Hunt [Thu, 10 Mar 2016 11:55:40 +0000 (11:55 +0000)]
doc: announce ABI changes for external mempool manager

Announce the ABI breakage due to addition of external mempool
manager functionality which requires changes to rte_mempool
structure.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agodoc: announce ABI change for mempool cache
Keith Wiles [Fri, 12 Feb 2016 18:38:25 +0000 (12:38 -0600)]
doc: announce ABI change for mempool cache

Deprecation notice for 16.04 for changes to occur in
release 16.07 for rte_mempool memory reduction.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: David Hunt <david.hunt@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoexamples: fix build with icc 15.0.1
Daniel Mrzyglod [Mon, 4 Apr 2016 10:56:54 +0000 (12:56 +0200)]
examples: fix build with icc 15.0.1

error: loops in this subroutine are not good vectorization candidates
 (try compiling with O3 and/or IPO).

this error occurs in icc 15.0.1

Solution to disable this diagnostic message
https://software.intel.com/en-us/forums/intel-c-compiler/topic/537688

Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application")
Fixes: 8cc72f2814dd ("examples/vmdq_dcb: support X710")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
8 years agoexamples/l2fwd-crypto: fix build with icc
Daniel Mrzyglod [Mon, 4 Apr 2016 08:46:50 +0000 (10:46 +0200)]
examples/l2fwd-crypto: fix build with icc

Fix for compilation errors for icc:
error #188: enumerated type mixed with another type

Fixes: 00c58901f1b3 ("examples/l2fwd-crypto: use key-value list of supported algorithms")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoversion: 16.04-rc3
Thomas Monjalon [Fri, 1 Apr 2016 21:52:02 +0000 (23:52 +0200)]
version: 16.04-rc3

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agodoc: fill nics features matrix for mlx
Adrien Mazarguil [Thu, 31 Mar 2016 10:22:37 +0000 (12:22 +0200)]
doc: fill nics features matrix for mlx

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomaintainers: claim responsibility for Intel i40e driver
Jingjing Wu [Tue, 29 Mar 2016 03:21:56 +0000 (11:21 +0800)]
maintainers: claim responsibility for Intel i40e driver

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoexamples/ip_pipeline: fix pcap file parsing
Fan Zhang [Fri, 1 Apr 2016 09:55:30 +0000 (10:55 +0100)]
examples/ip_pipeline: fix pcap file parsing

This patch fixes the pcap file parsing in ip_pipeline. Originally, the
parser recognizes the pcap related entries regardless of the RTE_PORT_PCAP
macro definition status.

Fixes: fe5d04621303 ("examples/ip_pipeline: add pcap file dump")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoport: clean up
Fan Zhang [Fri, 1 Apr 2016 13:41:57 +0000 (14:41 +0100)]
port: clean up

This patch clean-up the code in librte_port.
The clean-up includes the following:

* Clearer error message display.
* Remove unnecessary RTE_NEXT_ABI macro warping.
* Remove __rte_unused attribute

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoport: fix pcap sink parameter check
Fan Zhang [Fri, 1 Apr 2016 13:41:56 +0000 (14:41 +0100)]
port: fix pcap sink parameter check

This patch fixes sink port parameter checking logic.
Originally, if user set field "file_name" with meaning value
but leave PCAP support feature disabled, the program simply
ignores this field without notifying the user.

Fixes: eb5f4119b2bc ("port: add pcap file dump")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoport: fix pcap source parameter check
Fan Zhang [Fri, 1 Apr 2016 13:41:55 +0000 (14:41 +0100)]
port: fix pcap source parameter check

This patch fixes source port parameter checking logic.
Originally, if user set field "file_name" with meaning value
but leave PCAP support feature disabled, the program simply
ignores this field without notifying the user.

Fixes: d4b42133d85b ("port: add pcap file source")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoethdev: add 100G link speed
Thomas Monjalon [Thu, 31 Mar 2016 22:12:31 +0000 (00:12 +0200)]
ethdev: add 100G link speed

The link speed configuration is now done with bitmaps so 100G speed
requires only a new bit flag.
The actual link speed is a number so its size must be increased from
16-bit to 32-bit.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Tested-by: Matej Vido <vido@cesnet.cz>
8 years agoethdev: convert speed number to bitmap flag
Marc Sune [Thu, 31 Mar 2016 22:12:30 +0000 (00:12 +0200)]
ethdev: convert speed number to bitmap flag

It is a helper for the bitmap configuration.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoethdev: redesign link speed config
Marc Sune [Thu, 31 Mar 2016 22:12:29 +0000 (00:12 +0200)]
ethdev: redesign link speed config

This patch redesigns the API to set the link speed/s configuration
of an ethernet port. Specifically:

- it allows to define a set of advertised speeds for
  auto-negociation.
- it allows to disable link auto-negociation (single fixed speed).
- default: auto-negociate all supported speeds.

A flag autoneg in struct rte_eth_link indicates if link speed was a
result of auto-negociation or was fixed by configuration.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
Tested-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agoethdev: add speed capabilities
Marc Sune [Thu, 31 Mar 2016 22:12:28 +0000 (00:12 +0200)]
ethdev: add speed capabilities

The speed capabilities of a device can be retrieved with
rte_eth_dev_info_get().

The new field speed_capa is initialized in the drivers without
taking care of device characteristics in this patch.
When the capabilities of a driver are accurate, the table in
overview.rst must be filled.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
8 years agoethdev: rename link speed constants
Marc Sune [Thu, 31 Mar 2016 22:12:27 +0000 (00:12 +0200)]
ethdev: rename link speed constants

The speed numbers ETH_LINK_SPEED_ are renamed ETH_SPEED_NUM_.
The prefix ETH_LINK_SPEED_ is kept for AUTONEG and will be used
for bit flags in next patch.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
8 years agoapp/testpmd: move speed and duplex parsing in a function
Marc Sune [Thu, 31 Mar 2016 22:12:26 +0000 (00:12 +0200)]
app/testpmd: move speed and duplex parsing in a function

The code for checking and parsing speed/duplex was duplicated.
The new function is also checking the speed/duplex combination.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
8 years agoethdev: use constants for link duplex
Marc Sune [Thu, 31 Mar 2016 22:12:25 +0000 (00:12 +0200)]
ethdev: use constants for link duplex

Some duplex values are replaced from 0 to half-duplex when link is down.

Some drivers are still using their own constants for duplex modes.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
8 years agoethdev: use constants for link state
Thomas Monjalon [Thu, 31 Mar 2016 22:12:24 +0000 (00:12 +0200)]
ethdev: use constants for link state

Define and use ETH_LINK_UP and ETH_LINK_DOWN where appropriate.

Signed-off-by: Marc Sune <marcdevel@gmail.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agohash: fix multi-process support
Pablo de Lara [Fri, 1 Apr 2016 15:03:49 +0000 (16:03 +0100)]
hash: fix multi-process support

Hash library used a function pointer to choose a different
key compare function, depending on the key size.
As a result, multiple processes could not use the same hash table,
as the function addresses vary from one process to another.

Instead, a jump table is used, so each process has its own
function addresses, accessing this table with an index stored
in the hash table (note that using a custom key compare function
is not supported in multi-process mode).

Fixes: 48a399119619 ("hash: replace with cuckoo hash implementation")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agohash: use common x86 flag
Pablo de Lara [Fri, 1 Apr 2016 15:03:48 +0000 (16:03 +0100)]
hash: use common x86 flag

Instead of using RTE_ARCH_X86_64, RTE_ARCH_X86_32
and RTE_ARCH_I686, use directly RTTE_ARCH_X86

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoivshmem: fix race condition
Mauricio Vasquez B [Fri, 1 Apr 2016 11:22:12 +0000 (13:22 +0200)]
ivshmem: fix race condition

The memory zone could be freed just after adding it to the metadata
file and just before marking it as not freeable.
This patch changes the locking logic in order to prevent it.

Fixes: cd10c42eb5bc ("mem: fix ivshmem freeing")

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
8 years agobonding: fix loop boundary condition
Vladyslav Buslov [Fri, 1 Apr 2016 12:16:59 +0000 (15:16 +0300)]
bonding: fix loop boundary condition

Loop that calculates total number of tx descriptors in slave tx queues
should iterate up to nb_tx_queues, not nb_rx_queues.

Fixes: 3ef7955700e7 ("bonding: fix LACP mempool size")

Signed-off-by: Vladyslav Buslov <vladyslav.buslov@harmonicinc.com>
8 years agobonding: fix link detect in non-interrupt mode
Nelson Escobar [Sat, 26 Mar 2016 00:44:50 +0000 (17:44 -0700)]
bonding: fix link detect in non-interrupt mode

Stopping then re-starting a bond interface containing slaves that
used polling for link detection caused the bond to think all slave
links were down and inactive.

Move the start of the polling for link from slave_add() to
bond_ethdev_start() and in bond_ethdev_stop() make sure we clear
the last_link_status of the slaves.

Fixes: a45b288ef21a ("bond: support link status polling")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agohash: fix typo in comment
Pablo de Lara [Tue, 29 Mar 2016 17:38:57 +0000 (18:38 +0100)]
hash: fix typo in comment

rte_hash_set_cmp_func() had an incorrect Doxygen comment
for one of its parameters.

Fixes: 95da2f8e9c61 ("hash: customize compare function")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoeal/ppc: fix prefetch instruction
Chao Zhu [Wed, 30 Mar 2016 15:39:17 +0000 (23:39 +0800)]
eal/ppc: fix prefetch instruction

Current prefetch instruction (dcbt) implementation for IBM POWER8 has wrong
Touch Hint(TH) parameter. The current setting of TH=1 indicates to load data from
current cache line and an unlimited number of sequentially following cache lines.
TTH=0 means to load data from current cache line. rte_prefetch0 function is defined
to load one cache line, which means TH=0 is suited here.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
8 years agoconfig: fix CPU and memory parameters on IBM POWER8
Chao Zhu [Wed, 30 Mar 2016 15:39:16 +0000 (23:39 +0800)]
config: fix CPU and memory parameters on IBM POWER8

This patch fixes the max logic number and memory channel number settings
on IBM POWER8 platform.
1. The max number of logic cores of a POWER8 processor is 96. Normally,
   there are two sockets on a server. So the max number of logic cores
   are 192. So this parch set CONFIG_RTE_MAX_LCORE to 256.
2. The socket number on POWER8 little endian platform can be larger than 16.
   This patch set CONFIG_RTE_MAX_NUMA_NODES to 32 for POWER8.
3. Currently, the max number of memory channels are hardcoded to 4. However,
   on a POWER8 machine, the max number of memory channels are 8. This patch
   removes the constraint.

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
8 years agoexamples/ip_pipeline: fix flow classification
Fan Zhang [Thu, 31 Mar 2016 11:29:34 +0000 (12:29 +0100)]
examples/ip_pipeline: fix flow classification

This patch fixes the initialization error in flow classification
pipeline. Originally, when there is no key_mask specified in the
CFG file, all '0' mask is utilized.

Fixes: 1a33c5ea2f45 ("examples/ip_pipeline: clean config parser")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/ip_pipeline: fix SSE4.2 optimization branch
Thomas Monjalon [Wed, 30 Mar 2016 13:59:05 +0000 (15:59 +0200)]
examples/ip_pipeline: fix SSE4.2 optimization branch

The branch was disabled because of a typo in the SSE4.2 flag.
Change also the x86_64 flag to use a DPDK one.

Fixes: 28377375c6c0 ("examples/ip_pipeline: fix build for x86_64 without SSE4.2")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoexamples/l3fwd: fix size of destination port ids
Konstantin Ananyev [Thu, 31 Mar 2016 13:07:19 +0000 (14:07 +0100)]
examples/l3fwd: fix size of destination port ids

Originally l3fwd used 16-bit value to store dest_port value.
To accommodate 24-bit nexthop dest_port was increased to 32-bit,
though some further packet processing code remained unchanged and
still expects dest_port to be 16-bit.
That is not correct and can cause l3fwd invalid behaviour or even
process crash/hang on some input packet patterns.
For the fix, I choose the simplest approach and restored dest_port
as 16-bit value, plus necessary conversions from 32 to 16 bit values
after lpm_lookupx4.

Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoexamples/l3fwd: fix packets lost when stopping
Tomasz Kulasek [Thu, 31 Mar 2016 13:38:08 +0000 (15:38 +0200)]
examples/l3fwd: fix packets lost when stopping

Not all tx ports was included in tx_port_id array, used to periodically
drain only available ports. This caused that some packets remain in buffer
when application stops to receiving packets.

Fixes: 52c97adc1f0f ("examples/l3fwd: fix exact match performance")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoexamples/ipsec-secgw: fix build on FreeBSD
Daniel Mrzyglod [Thu, 31 Mar 2016 12:43:10 +0000 (14:43 +0200)]
examples/ipsec-secgw: fix build on FreeBSD

In FreeBSD, sys/types.h and netinet/in.h need to be included before
netinet/ip.h

There were missed typedef for u_char - <sys/types.h>
There were missed network definitions - <netinet/in.h>

Failure #13: http://dpdk.org/ml/archives/test-report/2016-March/001896.html

Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
8 years agoexamples/l2fwd-crypto: extend crypto information
Pablo de Lara [Thu, 31 Mar 2016 09:32:14 +0000 (10:32 +0100)]
examples/l2fwd-crypto: extend crypto information

Display extra crypto information (algorithms, keys/IV/AAD used, chain...),
so user can know exactly what operations are being carried out.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agoexamples/l2fwd-crypto: use key-value list of supported algorithms
Pablo de Lara [Thu, 31 Mar 2016 09:32:13 +0000 (10:32 +0100)]
examples/l2fwd-crypto: use key-value list of supported algorithms

In order to ease the parsing and display of supported algorithms
in the application, two new arrays are created, which contains
the strings of the different cipher and authentication algorithms,

These lists are used to parse the algorithms from the command line,
and will be used to display crypto information to the user.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agoexamples/l2fwd-crypto: clarify key parsing in help
Pablo de Lara [Thu, 31 Mar 2016 09:32:12 +0000 (10:32 +0100)]
examples/l2fwd-crypto: clarify key parsing in help

Cipher/Auth keys, AAD and IV must be passed from command line
with ":" between bytes, but help was not clarifying that.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agoexamples/l2fwd-crypto: fix ambiguous input key size
Pablo de Lara [Thu, 31 Mar 2016 09:32:11 +0000 (10:32 +0100)]
examples/l2fwd-crypto: fix ambiguous input key size

Some crypto algorithms support more than one key size
(including cipher key, authentication key, IV and AAD),
but the app was using always the minimum size.

These changes allows the user to use an specific size,
either from the string provided with cipher_key, auth_key, iv and ADD
parameters, or from the values provided with cipher_key_random_size,
auth_key_random_size, iv_random_size and aad_random_size.

This also allows the user to specify the digest size.

Fixes: 1df9c0109f4c ("examples/l2fwd-crypto: parse key parameters")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agoexamples/l2fwd-crypto: fix length of random IV/AAD
Pablo de Lara [Thu, 31 Mar 2016 09:32:10 +0000 (10:32 +0100)]
examples/l2fwd-crypto: fix length of random IV/AAD

App was generating a random IV/AAD of only 4 bytes,
instead of the actual length, since it was using sizeof(length).

Fixes: 27cf2d1b18e1 ("examples/l2fwd-crypto: discover capabilities")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agoexamples/l2fwd-crypto: add missing string initialization
Pablo de Lara [Thu, 31 Mar 2016 09:32:09 +0000 (10:32 +0100)]
examples/l2fwd-crypto: add missing string initialization

When passing the preferred crypto device type in the command line
parameters, the string (HW/SW/ANY) was not being saved, which is used
for error information to the user.

Fixes: 27cf2d1b18e1 ("examples/l2fwd-crypto: discover capabilities")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agoexamples/l2fwd-crypto: rename period parameter
Pablo de Lara [Thu, 31 Mar 2016 09:32:08 +0000 (10:32 +0100)]
examples/l2fwd-crypto: rename period parameter

L2fwd-crypto app is based on L2fwd app and it inherits
some of its parameters (such as portmask, queues per core...).

The parameter period (period of time between statistic updates)
is -T in L2fwd, but was -t in L2fwd-crypto, so for consistency,
it is changed back to -T

Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agoexamples/l2fwd-crypto: add missing new line in help
Pablo de Lara [Thu, 31 Mar 2016 09:32:07 +0000 (10:32 +0100)]
examples/l2fwd-crypto: add missing new line in help

Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agoexamples/dpdk_qat: fix build error message
Pablo de Lara [Tue, 29 Mar 2016 18:28:51 +0000 (19:28 +0100)]
examples/dpdk_qat: fix build error message

When compiling dpdk_qat app with an i686 target on a x86_64 OS,
an error message was shown, saying that it can only be built
on a 32-bit OS, which should be i686 OS, as other 32-bit OS
are not supported.

Fixes: 3460012bcce6 ("examples/qat: update")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoapp/test: add out-of-place symmetric crypto operations
Arek Kusztal [Tue, 29 Mar 2016 14:14:42 +0000 (15:14 +0100)]
app/test: add out-of-place symmetric crypto operations

Added AES and snow3g Authenticated encryption and decryption tests
for out-of-place operations.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: John Griffin <john.griffin@intel.com>
8 years agoqat: add out-of-place symmetric operations
Arek Kusztal [Tue, 29 Mar 2016 14:14:41 +0000 (15:14 +0100)]
qat: add out-of-place symmetric operations

This patch adds out-of-place operations to qat symmetric crypto PMD,
i.e. the result of the operation can be written to the destination buffer
instead of overwriting the source buffer as done in "in-place" operation.
Both buffers can be of different sizes.
Previously the qat PMD assumed that m_src and m_dst in rte_crypto_sym_op
were identical.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: John Griffin <john.griffin@intel.com>
8 years agoqat: fix crash when nothing to enqueue
Fiona Trahe [Tue, 29 Mar 2016 17:10:20 +0000 (18:10 +0100)]
qat: fix crash when nothing to enqueue

Crash seen in qat pmd when nb_ops=0 on rte_cryptodev_enqueue_burst() API

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
8 years agodrivers: fix build of crypto anonymous union initialization
Fiona Trahe [Wed, 30 Mar 2016 12:49:55 +0000 (13:49 +0100)]
drivers: fix build of crypto anonymous union initialization

In SUSE11-SP3 i686 platform, with gcc 4.5.1, there are compile issues, e.g:
  null_crypto_pmd_ops.c:44:3: error:
  unknown field 'sym' specified in initializer
  cc1: warnings being treated as errors

The member in anonymous union initialization should be inside '{}',
otherwise it will report an error.

Fixes: 26c2e4ad5ad4 ("cryptodev: add capabilities discovery")

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
8 years agolpm: fix build of anonymous union initialization
Michael Qiu [Wed, 30 Mar 2016 03:38:12 +0000 (11:38 +0800)]
lpm: fix build of anonymous union initialization

In SUSE11-SP3 i686 platform, with gcc 4.5.1, there is a
compile issue:
rte_lpm.c: In function ‘add_depth_small_v20’:
rte_lpm.c:778:7: error: unknown field ‘next_hop’
specified in initializer

The root cause is gcc only allow anonymous union initialized
according to the field it is defined. But next_hop is defined
in different field when in different platform(Endian).

One solution is add if define in the code to avoid this issue,
but there is a simple way, initialize it separately later.

Fixes: afc5c914a083 ("lpm: fix big endian support")

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
8 years agovmxnet3: remove asserts that confuse coverity
Stephen Hemminger [Wed, 30 Mar 2016 21:38:25 +0000 (14:38 -0700)]
vmxnet3: remove asserts that confuse coverity

These asserts are only for debugging and never fired during
any testing, but they confuse coverity's null tracking.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Yong Wang <yongwang@vmware.com>
8 years agoixgbe: fix uninitialized warning
Aaron Conole [Tue, 22 Mar 2016 21:37:18 +0000 (17:37 -0400)]
ixgbe: fix uninitialized warning

Silence a compiler warning that this variable may be used uninitialized.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe: fix VLAN filter missing brackets
Aaron Conole [Tue, 22 Mar 2016 21:37:15 +0000 (17:37 -0400)]
ixgbe: fix VLAN filter missing brackets

The ixgbe vlan filter code has an if check with an incorrect whitespace.

Fixes: fe3a45fd4104 ("ixgbe: add VMDq support")

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe: fix constant sign in left shift operator
Aaron Conole [Tue, 22 Mar 2016 21:37:17 +0000 (17:37 -0400)]
ixgbe: fix constant sign in left shift operator

Tell the compiler to use an unsigned constant for the config shifts.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoigb: fix constant sign in left shift operator
Aaron Conole [Tue, 22 Mar 2016 21:37:16 +0000 (17:37 -0400)]
igb: fix constant sign in left shift operator

Tell the compiler to use an unsigned constant for the config shifts.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoe1000: fix missing link interrupt check brackets
Aaron Conole [Tue, 22 Mar 2016 21:37:14 +0000 (17:37 -0400)]
e1000: fix missing link interrupt check brackets

The device lsc interrupt check has a misleading whitespace around it which
can be improved by adding appropriate braces to the check. Since the ret
variable was checked after previous assignment, this introduces no functional
change.

Fixes: 921a72008f76 ("e1000: add Rx interrupt handler")

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
8 years agoe1000: suppress misleading indentation warning
Aaron Conole [Wed, 30 Mar 2016 14:06:36 +0000 (10:06 -0400)]
e1000: suppress misleading indentation warning

The register read/write mphy functions have misleading whitespace around
the `locked` check. This cleanup merely preserves the existing functionality
and suppresses future gcc versions' "misleading indentation" warning.

Suggested-by: Panu Matilainen <pmatilai@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agoapp/test: fix missing brackets
Aaron Conole [Tue, 22 Mar 2016 21:37:12 +0000 (17:37 -0400)]
app/test: fix missing brackets

The test application calls printf(...) with the suite->suite_name argument.
The intent (based on whitespace) in the printf is to check suite->suite_name
first and then apply the printf. This doesn't happen due to missing brackets.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
8 years agovhost: use SMP barriers instead of compiler ones
Ilya Maximets [Fri, 18 Mar 2016 12:23:53 +0000 (15:23 +0300)]
vhost: use SMP barriers instead of compiler ones

Since commit 4c02e453cc62 ("eal: introduce SMP memory barriers") virtio
uses architecture dependent SMP barriers. vHost should use them too.

Fixes: 4c02e453cc62 ("eal: introduce SMP memory barriers")

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
8 years agofm10k: fix RSS reset during initialization
Michael Frasca [Tue, 22 Mar 2016 16:58:08 +0000 (12:58 -0400)]
fm10k: fix RSS reset during initialization

If the provided configuration does not call for RSS, then RSS is
explicitly disabled. Without this change, the device continues to
operate under the previous RSS configuration.

Fixes: 57033cdf8fdc ("fm10k: add PF RSS")

Signed-off-by: Michael Frasca <michael.frasca@oracle.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
8 years agovmxnet3: fix Tx flags check
Yong Wang [Mon, 28 Mar 2016 22:35:55 +0000 (15:35 -0700)]
vmxnet3: fix Tx flags check

Now that vmxnet3 supports TCP/UDP checksum offload, let's update
the default txq flags to allow such offloads.  Also fixed the tx
queue setup check to allow TCP/UDP checksum and only error out
if SCTP checksum is requested.

Fixes: f598fd063bb1 ("vmxnet3: add Tx L4 checksum offload")

Reported-by: Heng Ding <hengx.ding@intel.com>
Signed-off-by: Yong Wang <yongwang@vmware.com>
8 years agonfp: fix PCI device info retrieval
Stephen Hemminger [Wed, 23 Mar 2016 15:51:36 +0000 (08:51 -0700)]
nfp: fix PCI device info retrieval

The NFP driver (unlike other PCI devices) was not copying the pci info
from the pci_dev to the eth_dev.  This would make the driver_name be
null (and other unset fields) when application uses dev_info_get.

This was found by code review; do not have the hardware.

Fixes: d4a27a3b092a ("nfp: add basic features")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
8 years agomlx5: fix RETA table size
Yaacov Hazan [Thu, 31 Mar 2016 09:21:08 +0000 (12:21 +0300)]
mlx5: fix RETA table size

When the number of RX queues is not a power of two,
the RETA table is configured to its maximum size for
better balancing.

Testing showed that limiting its size to 256 improves performance
noticeably with little to no  impact on balancing results.

Fixes: ebb30ec64a68 ("mlx5: increase RETA table size")

Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx: fix double mbuf free in Tx queue clean up
Adrien Mazarguil [Thu, 31 Mar 2016 09:43:43 +0000 (11:43 +0200)]
mlx: fix double mbuf free in Tx queue clean up

Once freed, completed mbufs pointers are not set to NULL in the TX queue.
Clean up function must take this into account.

Fixes: 2e22920b85d9 ("mlx5: support non-scattered Tx and Rx")
Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agoi40e: fix crash on DCB query
Jingjing Wu [Mon, 28 Mar 2016 07:37:28 +0000 (15:37 +0800)]
i40e: fix crash on DCB query

Calling rte_eth_dev_get_dcb_info to get dcb info from i40e
driver if VMDQ is disabled, results in a segmentation fault.
This patch fixes it by treating VMDQ and No-VMDQ respectively
when querying dcb information.

Fixes: 5135f3ca49a7 ("i40e: enable DCB in VMDQ VSIs")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agoi40e: fix typo in flow director comment
Rami Rosen [Sun, 27 Mar 2016 10:58:47 +0000 (13:58 +0300)]
i40e: fix typo in flow director comment

Signed-off-by: Rami Rosen <rami.rosen@intel.com>
8 years agoixgbe: fail if too many queues for interrupt
Wang Xiao W [Mon, 28 Mar 2016 00:39:56 +0000 (08:39 +0800)]
ixgbe: fail if too many queues for interrupt

The lower 16 bits of EICR register are used for queue interrupts,
dpdk framework take over the first bit for other interrupts like
LSC, so there're only 15 bits left for queue interrupts mapping.
This patch adds a check for the num of interrupt queues at
dev_start.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agoixgbe/base: fix VF multi-queue
Wenzhuo Lu [Wed, 30 Mar 2016 02:46:11 +0000 (10:46 +0800)]
ixgbe/base: fix VF multi-queue

When starting testpmd with multiple queues on a ixgbe VF
port, it failed with this printing, "nb_rxq(4) is greater
than max_rx_queues(1)".

The root cause is the VF doesn't get the right max rx queue
number from PF and it uses the default value 1.
VF max rx queue number is set by PF through mailbox messages.
The message for this setting only supports version 1.1. As
message version is updated to 1.2, VF cannot parse the rx queue
number setting message correctly.

This patch raise a specific base code update for this issue.

Fixes: 72dec9e37a84 ("ixgbe: support multicast promiscuous mode on VF")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agoenic: expose Rx missed packets counter
John Daley [Wed, 30 Mar 2016 18:07:31 +0000 (11:07 -0700)]
enic: expose Rx missed packets counter

Update the 'imissed' counter with the number of packets dropped
by the NIC.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
8 years agoenic: fix link state change
John Daley [Sat, 26 Mar 2016 00:45:17 +0000 (17:45 -0700)]
enic: fix link state change

When the enic was disabled, link notification was correctly disabled
in the NIC but the software indicator that it was disabled was not
updated (vdev->notify_pa not set to 0). When the link came back up,
enic did not re-enable notification in the NIC.

This affected bonding when a enic slave device link bounced.

The fix is to unconditionally enable notification when the enic is
enabled.

Fixes: 9913fbb91df0 ("enic/base: common code")

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
8 years agoenic: fix Tx hang when number of packets > queue size
John Daley [Sat, 26 Mar 2016 00:43:27 +0000 (17:43 -0700)]
enic: fix Tx hang when number of packets > queue size

If the nb_pkts parameter to rte_eth_tx_burst() was greater than
the TX descriptor count, a completion was not being requested
from the NIC, so descriptors would not be released back to the
host causing a lock-up.

Introduce a limit of how many TX descriptors can be used in a single
call to the enic PMD burst TX function before requesting a completion.

Fixes: d739ba4c6abf ("enic: improve Tx packet rate")

Signed-off-by: John Daley <johndale@cisco.com>
8 years agoena: fix FreeBSD build
Daniel Mrzyglod [Tue, 29 Mar 2016 12:43:54 +0000 (14:43 +0200)]
ena: fix FreeBSD build

FreeBSD was not defined in ena_plat.h
ETIME is not defined in FreeBSD.

In file included from DPDK/drivers/net/ena/base/ena_com.h:37:0,
                 from DPDK/drivers/net/ena/ena_ethdev.h:39,
                 from DPDK/drivers/net/ena/ena_ethdev.c:41:
DPDK/drivers/net/ena/base/ena_plat.h:48:2: error: #error "Invalid platform"

Fixes: 99ecfbf845b3 ("ena: import communication layer")
Fixes: 9ba7981ec992 ("ena: add communication layer for DPDK")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoena: fix build with icc
Daniel Mrzyglod [Tue, 29 Mar 2016 12:43:53 +0000 (14:43 +0200)]
ena: fix build with icc

Fix for multiple compilation errors for ICC:
        error #188: enumerated type mixed with another type
        error #592: variable "flags" is used before its value is set

Fixes: 99ecfbf845b3 ("ena: import communication layer")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>