dpdk.git
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>
8 years agoethdev: fix comments for filters
Jingjing Wu [Tue, 29 Mar 2016 03:04:28 +0000 (11:04 +0800)]
ethdev: fix comments for filters

This patch fixes comments for tunnel filters and flow director flows.
e.g. states fields which are in big endian.

Fixes: 7b1312891b69 ("ethdev: add IP in GRE tunnel")
Fixes: d69be32d4d78 ("ethdev: structures to add or delete flow director")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agoversion: 16.04-rc2
Thomas Monjalon [Fri, 25 Mar 2016 18:54:29 +0000 (19:54 +0100)]
version: 16.04-rc2

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoconfig: enable i40e vector driver
Jianfeng Tan [Fri, 25 Mar 2016 00:47:47 +0000 (08:47 +0800)]
config: enable i40e vector driver

Previously, vector driver is not the first (default) choice for i40e,
as it cannot fill packet type info for l3fwd to work well. Now there
is an option for l3fwd to analysis packet type softly. So enable it
by default.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoexamples/l3fwd: fix using packet type blindly
Jianfeng Tan [Fri, 25 Mar 2016 00:47:46 +0000 (08:47 +0800)]
examples/l3fwd: fix using packet type blindly

As a example to use ptype info, l3fwd needs firstly to use
rte_eth_dev_get_supported_ptypes() API to check if device and/or
its PMD driver will parse and fill the needed packet type; if not,
use the newly added option, --parse-ptype, to analyze it in the
callback softly.

As the mode of EXACT_MATCH uses the 5 tuples to caculate hash, so
we narrow down its scope to:
  a. ip packets with no extensions, and
  b. L4 payload should be either tcp or udp.

Note: this patch does not completely solve the issue, "cannot run
l3fwd on virtio or other devices", because hw_ip_checksum may be
not supported by the devices. Currently we can:
  a. remove this requirements, or
  b. wait for virtio front end (pmd) to support it.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoexamples/l3fwd: fix validation for queue id of config tuple
Reshma Pattan [Fri, 25 Mar 2016 15:13:44 +0000 (15:13 +0000)]
examples/l3fwd: fix validation for queue id of config tuple

Added validation for queue id of config parameter tuple.

This validation enforces user to enter queue ids of a port
from 0 and in sequence.

This additional validation on queue ids avoids ixgbe crash caused
by null rxq pointer access inside ixgbe_dev_rx_init.

Reason for null rxq is, L3fwd application allocates memory only for
queues passed by user. But rte_eth_dev_start tries to initialize rx
queues in sequence from 0 to nb_rx_queues,
which is not true and coredump while accessing the unallocated queue .

Fixes: af75078fece3 ("first public release")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoexamples/vhost: fix VLAN tag
Yuanhan Liu [Fri, 25 Mar 2016 07:58:52 +0000 (15:58 +0800)]
examples/vhost: fix VLAN tag

While the last arg of virtio_tx_route() asks a vlan tag, we currently
feed it with device_fh, which is wrong. Fix it.

Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")

Reported-by: Qian Xu <qian.q.xu@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agoexamples/vhost: fix offload settings
Yuanhan Liu [Fri, 25 Mar 2016 07:58:51 +0000 (15:58 +0800)]
examples/vhost: fix offload settings

Comments for PKT_TX_TCP_SEG at rte_mbuf says that we should only set
PKT_TX_IP_CKSUM and reset ip hdr checksum for IPv4:

  - if it's IPv4, set the PKT_TX_IP_CKSUM flag and write the IP checksum
    to 0 in the packet

Fixes: 9fd72e3cbd29 ("examples/vhost: add virtio offload")

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agoexamples/vhost: remove unnecessary pseudo checksum calculation
Yuanhan Liu [Fri, 25 Mar 2016 07:58:50 +0000 (15:58 +0800)]
examples/vhost: remove unnecessary pseudo checksum calculation

For checksum offloading only case, the TCP/IP stack would
have calculated the pseudo checksum. Therefore, we don't
need to re-calculate it again here; remove it.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agovhost: remove unnecessary return
Yuanhan Liu [Fri, 25 Mar 2016 07:58:49 +0000 (15:58 +0800)]
vhost: remove unnecessary return

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
8 years agoapp/testpmd: fix build on FreeBSD
Marvin Liu [Tue, 22 Mar 2016 06:50:13 +0000 (14:50 +0800)]
app/testpmd: fix build on FreeBSD

Build log:
/root/dpdk/app/test-pmd/cmdline.c:6687:45: error: no member named
's6_addr32' in 'struct in6_addr'
    rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]);

This is caused by macro "s6_addr32" not defined on FreeBSD and testpmd
swap big endian parameter to host endian. Move the swap action to i40e
ethdev will fix this issue.

Fixes: 7b1312891b69 ("ethdev: add IP in GRE tunnel")

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agodoc: postpone flow director changes planned for cxgbe
Thomas Monjalon [Fri, 25 Mar 2016 16:24:27 +0000 (17:24 +0100)]
doc: postpone flow director changes planned for cxgbe

It will be tried to find a better solution.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoi40e: fix using memory after free
Jiangu Zhao [Fri, 25 Mar 2016 09:17:01 +0000 (09:17 +0000)]
i40e: fix using memory after free

The code uses "entry" in the next loop of LIST_FOREACH after calling free()
on it in i40e_res_pool_destroy().
Change to a safe way to free entry, which is similar with LIST_FOREACH_SAFE
in FreeBSD.

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

Signed-off-by: Jiangu Zhao <zhaojg@arraynetworks.com.cn>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agobonding: use existing enslaved device queues
Eric Kinzie [Thu, 24 Mar 2016 21:59:58 +0000 (14:59 -0700)]
bonding: use existing enslaved device queues

This solves issues when an active device is added to a bond.

If a device to be enslaved already has transmit and/or receive queues
allocated, use those and then create any additional queues that are
necessary.

Fixes: 2efb58cbab6e ("bond: new link bonding library")

Signed-off-by: Eric Kinzie <ehkinzie@gmail.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
8 years agoigb: fix crash with offload on 82575
Olivier Matz [Fri, 25 Mar 2016 10:32:00 +0000 (11:32 +0100)]
igb: fix crash with offload on 82575

On the 82575 chipset, there is a pool of global TX contexts instead of 2
per queues on 82576. See Table A-1 "Changes in Programming Interface
Relative to 82575" of Intel® 82576EB GbE Controller datasheet (*).

In the driver, the contexts are attributed to a TX queue: 0-1 for txq0,
2-3 for txq1, and so on.

In igbe_set_xmit_ctx(), the variable ctx_curr contains the index of the
per-queue context (0 or 1), and ctx_idx contains the index to be given
to the hardware (0 to 7). The size of txq->ctx_cache[] is 2, and must
be indexed with ctx_curr to avoid an out-of-bound access.

Also, the index returned by what_advctx_update() is the per-queue
index (0 or 1), so we need to add txq->ctx_start before sending it
to the hardware.

(*) The datasheets says 16 global contexts, however the IDX fields in TX
    descriptors are 3 bits, which gives a total of 8 contexts. The
    driver assumes there are 8 contexts on 82575: 2 per queues, 4 txqs.

Fixes: 4c8db5f09a24 ("igb: enable TSO support")
Fixes: af75078fece3 ("first public release")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agomlx4: use dummy Rx queues when non-pow2 number requested
Olivier Matz [Fri, 25 Mar 2016 10:24:41 +0000 (11:24 +0100)]
mlx4: use dummy Rx queues when non-pow2 number requested

When using RSS, the number of rxqs has to be a power of two.
This is a problem because there is no API in DPDK that makes
the application aware of that.

A good compromise is to allow the application to request a
number of rxqs that is not a power of 2, but having inactive
queues that will never receive packets. In this configuration,
a warning will be issued to users to let them know that
this is not an optimal configuration.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agoixgbe: fix tunnelling support for X550em_a
Wenzhuo Lu [Fri, 25 Mar 2016 06:11:02 +0000 (14:11 +0800)]
ixgbe: fix tunnelling support for X550em_a

l2 tunnel and e-tag are not supported on the new x550em_a NICs, due
to missing checks for that mac type in the code.
This patch adds in the necessary conditional checks to enable the features
for x550em_a.

Fixes: 22e77d4501b8 ("ixgbe: support L2 tunnel operations")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agoixgbe: fix timer support for X550em
Wenzhuo Lu [Fri, 25 Mar 2016 05:16:07 +0000 (13:16 +0800)]
ixgbe: fix timer support for X550em

An issue is found on x550em NICs: ieee1588 is not working, the time is
always reported as 0.
The root cause is that the timer is only supported by the driver for x550,
switch statement entries are missing for x550em_x and x550em_a. This patch
adds those missing entries.

Fixes: a7740dc1303a ("ixgbe: support new devices and MAC types")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agobonding: fix current primary port
Bernard Iremonger [Wed, 23 Mar 2016 17:30:05 +0000 (17:30 +0000)]
bonding: fix current primary port

The current_primary_port is initialised to an invalid value
during bonded device creation.
It must be set to a valid value later.
This fix sets it to a valid value when the first slave port
is added to the bonding device.

Fixes: 2efb58cbab6e ("bond: new link bonding library")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoixgbe: disable icc false positive warning
Ferruh Yigit [Thu, 24 Mar 2016 17:34:51 +0000 (17:34 +0000)]
ixgbe: disable icc false positive warning

icc (icc (ICC) 16.0.1 20151021) is generating following compile error:
  CC ixgbe_rxtx.o
  .../drivers/net/ixgbe/ixgbe_rxtx.c(153): error #3656: variable
  "free" may be used before its value is set
                      (nb_free > 0 && m->pool != free[0]->pool)) {
                         ^

Indeed this is a false positive and code is correct.
"nb_free" check prevents the free[] access before its value set.

Disabling this icc warning (#3656) for file ixgbe_rxtx.c.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoixgbe: fix dropping packets from unsupported Tx queues
Wenzhuo Lu [Thu, 24 Mar 2016 15:22:04 +0000 (15:22 +0000)]
ixgbe: fix dropping packets from unsupported Tx queues

Ixgbe HW supports 128 TX queues. However, the full 128 queues are only
available in VT and DCB mode.  In normal default "none" mode (VT/DCB off)
the maximum number of available queues is only 64.

The driver doesn't check the mode when reporting the available
number of queues, allowing more that 64 queues to be used in all cases.
If a queue no. >=64 is used in default mode, the TX packets will be dropped
silently.

This change adds a check to forbid using a queue number larger than 64
during device configuration (in default mode), so that the problem is
reported as early as possible.

Fixes: 27b609cbd1c6 ("ethdev: move the multi-queue mode check to specific drivers")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoethdev: fix possibly incorrect maximum queues
Pablo de Lara [Thu, 24 Mar 2016 15:22:03 +0000 (15:22 +0000)]
ethdev: fix possibly incorrect maximum queues

In rte_eth_dev_configure(), device configuration was copied to the dev
struct after get_dev_info() was called to get the max queue information.
In some drivers, though, the max queues can vary depending on the device
configuration - but that information is not available to the driver until
the copy is made.

This patch moves the memcpy of the device configuration into the dev->data
structure before the call to get_dev_info(), thereby making it accessible
to drivers to use when reporting their max queues.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoixgbe: fix Tx queue number
Wenzhuo Lu [Thu, 24 Mar 2016 15:22:02 +0000 (15:22 +0000)]
ixgbe: fix Tx queue number

Internal variable containing the number of TX queues for a device,
was being incorrectly assigned the number of RX queues, instead of TX.

Fixes: 27b609cbd1c6 ("ethdev: move the multi-queue mode check to specific drivers")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agoigb: fix address of device data pointer
Wenzhuo Lu [Thu, 24 Mar 2016 07:07:46 +0000 (15:07 +0800)]
igb: fix address of device data pointer

In the function set_rx_mode, the pointer of device data points
to the wrong address as found in ixgbe code, and fixed in commit:
"ixgbe: fix PF promiscuous mode after VF closed"

Fixes: be2d648a2dd3 ("igb: add PF support")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agoixgbe: fix PF promiscuous mode after VF closed
Wenzhuo Lu [Thu, 24 Mar 2016 07:07:45 +0000 (15:07 +0800)]
ixgbe: fix PF promiscuous mode after VF closed

There's an issue reported. In the scenario DPDK PF + DPDK VF,
if the VF port is closed, PF port cannot receive packets.
I found at that time the promicuous mode is disabled on the PF
port. But it should be enabled.
When VF port is closed, it will send a message to its PF port to
reset it. During this, PF port will also reset its own
promicuous mode. Which promiscuous mode should be set depends on
the parameter stored in the device data. In the function
set_rx_mode, the pointer of device data points to the wrong
address. So, the promiscuous mode is wrong.

Fixes: 00e30184daa0 ("ixgbe: add PF support")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Reported-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agoixgbe: fix packet type from vector Rx
Konstantin Ananyev [Tue, 22 Mar 2016 14:30:17 +0000 (14:30 +0000)]
ixgbe: fix packet type from vector Rx

Current vector RX can't always set the packet_type properly.
To be more specific:
a) it never sets RTE_PTYPE_L2_ETHER
b) it doesn't handle tunnel ipv4/ipv6 case correctly.
c) it doesn't check is IXGBE_RXDADV_PKTTYPE_ETQF set or not.
While a) is pretty easy to fix, b) and c) are not that straightforward
in terms of SIMD ops (specially b).
So far I wasn't able to make vRX support packet_type properly without
noticeable performance loss.
So for now, just remove that functionality from vector RX and
update dev_supported_ptypes_get().

Fixes: 396254175854 ("mbuf: redefine packet type")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
8 years agomlx4: check if port is configured for ethernet
Adrien Mazarguil [Tue, 22 Mar 2016 10:34:26 +0000 (11:34 +0100)]
mlx4: check if port is configured for ethernet

Notify user otherwise. A similar check has already been added to mlx5 in
commit "mlx5: check port is configured as ethernet device".

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agovhost: fix maximum of queues
Tetsuya Mukawa [Tue, 22 Mar 2016 08:09:45 +0000 (17:09 +0900)]
vhost: fix maximum of queues

Currently, the maximum value of rx/tx queues are kept by EAL. But,
the value is used like below with different meanings in vhost PMD.
 - The maximum value of current enabled queues.
 - The maximum value of current supported queues.

This wrong double meaning will cause an issue like below steps.

* Invoke application with below option.
  --vdev 'eth_vhost0,iface=<socket path>,queues=4'
* Configure queues like below.
  rte_eth_dev_configure(portid, 2, 2, ...);
* Configure queues again like below.
  rte_eth_dev_configure(portid, 4, 4, ...);

The second rte_eth_dev_configure() will fail because both
the maximum value of current enabled queues and supported queues
will be '2' after calling first rte_eth_dev_configure().

To fix the issue, the patch adds another variable to keep the maximum
number of supported queues in vhost PMD.

Fixes: 23981fb0d78b ("vhost: Add vhost PMD")

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
8 years agoi40e: fix build without Rx bulk alloc
Zhe Tao [Wed, 16 Mar 2016 10:19:10 +0000 (18:19 +0800)]
i40e: fix build without Rx bulk alloc

Issue:
When CONFIG_RTE_LIBTRE_I40E_RX_ALLOW_BULK_ALLOC=n in config file, there
will be a build error:
'i40e_recv_pkts_bulk_alloc' undeclared

Now DPDK i40e PMD uses the preprocessor to choose whether or not to define
the bulk recv functions, but for selection of the RX function, PMD only
depends on a C variable. This causes the inconsistency and leads to the
build error due to the bulk recv function not being defined.

Fixes: 8e109464c022 ("i40e: allow vector Rx and Tx usage")

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoapp/testpmd: add VLAN in flow director input set
Jingjing Wu [Wed, 23 Mar 2016 13:07:12 +0000 (21:07 +0800)]
app/testpmd: add VLAN in flow director input set

This patch extends the commands for changing flow director filter's input
set. It adds vlan as a possible filter input field.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: extend flow director for VLAN
Jingjing Wu [Wed, 23 Mar 2016 13:07:11 +0000 (21:07 +0800)]
i40e: extend flow director for VLAN

This patch extends flow director to select vlan id as part of
filter's input set and program the filter rule with vlan id.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: fix VLAN bitmasks for input set
Andrey Chilikin [Wed, 23 Mar 2016 13:07:10 +0000 (21:07 +0800)]
i40e: fix VLAN bitmasks for input set

This patch adds missing VLAN bitmask for inner frame in case of
tunneling and fixes VLAN tags bitmasks for single or outer frame
in case of tunneling.

Fixes: 98f055707685 ("i40e: configure input fields for RSS or flow director")

Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoapp/testpmd: extend flow director input set commands
Jingjing Wu [Wed, 23 Mar 2016 13:07:09 +0000 (21:07 +0800)]
app/testpmd: extend flow director input set commands

This patch extends commands for changing a flow director filter's input
set. It adds tos, protocol and ttl as filter's input fields, and removes
the words selection from flex payloads.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: allow filtering on more IP header fields
Jingjing Wu [Wed, 23 Mar 2016 13:07:08 +0000 (21:07 +0800)]
i40e: allow filtering on more IP header fields

This patch extends flow director to select more IP Header fields
as filter input set.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: use default filter input set on init
Jingjing Wu [Wed, 23 Mar 2016 13:07:07 +0000 (21:07 +0800)]
i40e: use default filter input set on init

This patch adds a new function to set the fdir input set to default
when initialization.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: remove flex payload from input selection
Jingjing Wu [Wed, 23 Mar 2016 13:07:06 +0000 (21:07 +0800)]
i40e: remove flex payload from input selection

In this patch, flex payload is removed from valid fdir input set
values. This is because all flex payload configuration can be set
in struct rte_fdir_conf during device configure phase, which is
a more flexible way of setting this up.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: split function for hash and flow director input
Jingjing Wu [Wed, 23 Mar 2016 13:07:05 +0000 (21:07 +0800)]
i40e: split function for hash and flow director input

For the input set selection, Hash filter and Flow director shared
the same function, i.e. i40e_filter_inset_select.
For code readability, this patch replaces i40e_filter_inset_select
with two new functions: i40e_hash_filter_inset_select and
i40e_fdir_filter_inset_select for Hash filter and Flow director
respectively.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoethdev: add fields to flow director input
Jingjing Wu [Wed, 23 Mar 2016 13:07:04 +0000 (21:07 +0800)]
ethdev: add fields to flow director input

This patch adds RTE_ETH_INPUT_SET_L3_IP4_TTL,
RTE_ETH_INPUT_SET_L3_IP6_HOP_LIMITS input field types and extends
struct rte_eth_ipv4_flow and rte_eth_ipv6_flow to support filtering
by tos, protocol and ttl.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agovirtio: fix Rx ring descriptor starvation
Kyle Larose [Thu, 10 Mar 2016 14:44:11 +0000 (09:44 -0500)]
virtio: fix Rx ring descriptor starvation

Virtio has an mbuf descriptor ring containing mbufs to be used for
receiving traffic. When the host queues traffic to be sent to the guest, it
consumes these descriptors. If none exist, it discards the packet.

The virtio pmd allocates mbufs to the descriptor ring every time it
successfully receives a packet. However, it never does it if it does not
receive a valid packet. If the descriptor ring is exhausted, and the mbuf
mempool does not have any mbufs free (which can happen for various reasons,
such as queueing along the processing pipeline), then the receive call will
not allocate any mbufs to the descriptor ring, and when it finishes, the
descriptor ring will be empty. The ring being empty means that we will
never receive a packet again, which means we will never allocate mbufs to
the ring: we are stuck.

Ultimately, the problem arises because there is a dependency between
receiving packets and making the descriptor ring not be empty, and a
dependency between the descriptor ring not being empty, and receiving
packets.

To fix the problem, this pakes makes virtio always try to allocate mbufs
to the descriptor ring, if necessary, when polling for packets. Do this by
removing the early exit if no packets were received. Since the packet loop
later will do nothing if there are no packets, this is fine.

I reproduced the problem by pushing packets through a pipelined systems
(such as the client_server sample application) after artificially
decreasing the size of the mbuf pool and introducing a delay in a secondary
stage.

Without the fix, the process stops receiving packets fairly quicky. With
the fix, it continues to receive packets.

Fixes: c1f86306a026 ("virtio: add new driver")

Signed-off-by: Kyle Larose <klarose@sandvine.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
8 years agodrivers: make struct of networking operations const
Stephen Hemminger [Mon, 21 Mar 2016 17:53:24 +0000 (10:53 -0700)]
drivers: make struct of networking operations const

This structure has immutable function pointers.
Also fix indentation.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoenic: fix Rx descriptor limit
Nelson Escobar [Fri, 18 Mar 2016 18:33:34 +0000 (11:33 -0700)]
enic: fix Rx descriptor limit

On initialization, the rq descriptor count was set to the limit
of the vic.  When the requested number of rx descriptors was
less than this count, enic_alloc_rq() was incorrectly setting
the count to the lower value.  This results in later calls to
enic_alloc_rq() incorrectly using the lower value as the adapter
limit.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
8 years agoenic: update maintainers
John Daley [Fri, 18 Mar 2016 18:27:07 +0000 (11:27 -0700)]
enic: update maintainers

Change maintainers for ENIC PMD and fix pointer to enic
documentation in MAINTAINERS.

Signed-off-by: John Daley <johndale@cisco.com>
8 years agomlx5: fix null RSS key handling
Nélio Laranjeiro [Fri, 18 Mar 2016 12:54:43 +0000 (13:54 +0100)]
mlx5: fix null RSS key handling

Update function can be called with no key to enable or disable a RSS
protocol, or with a key to be applied to the desired protocols.

Fixes: 2f97422e7759 ("mlx5: support RSS hash update and get")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx5: fix overwritten RSS configuration
Nélio Laranjeiro [Fri, 18 Mar 2016 12:54:42 +0000 (13:54 +0100)]
mlx5: fix overwritten RSS configuration

RSS configuration provided by the application should not be used as storage
by the PMD.

Fixes: 2f97422e7759 ("mlx5: support RSS hash update and get")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agoixgbe: fix RETA query and update on X550
Xiao Wang [Fri, 18 Mar 2016 02:27:35 +0000 (10:27 +0800)]
ixgbe: fix RETA query and update on X550

For x550 device, the reta table has 512 entries, but in function
ixgbe_dev_rss_reta_query and ixgbe_dev_rss_reta_update we use an
"uint8_t i" to traverse the entries, this will lead the function
to an endless loop.

This patch changes the data type from uint8_t to uint16_t to fix
the issue.

Fixes: 4bee94a6c22f ("ixgbe: support 512 RSS entries on x550")

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agoenic: remove packet error conditional
John Daley [Thu, 17 Mar 2016 22:57:07 +0000 (15:57 -0700)]
enic: remove packet error conditional

small cleanup to remove conditional.

Signed-off-by: John Daley <johndale@cisco.com>
8 years agoenic: fix error packets handling
John Daley [Thu, 17 Mar 2016 22:57:06 +0000 (15:57 -0700)]
enic: fix error packets handling

If the packet_error bit in the completion descriptor is set, the
remainder of the descriptor and data are invalid. PKT_RX_MAC_ERR
was set in the mbuf->ol_flags if packet_error was set and used
later to indicate an error packet. But since PKT_RX_MAC_ERR is
defined as 0, mbuf flags and packet types and length were being
misinterpreted.

Make the function enic_cq_rx_to_pkt_err_flags() return true for error
packets and use the return value instead of mbuf->ol_flags to indicate
error packets. Also remove warning for error packets and rely on
rx_error stats.

Fixes: 947d860c821f ("enic: improve Rx performance")

Signed-off-by: John Daley <johndale@cisco.com>
8 years agoenic: fix mbuf flags on Rx
John Daley [Thu, 17 Mar 2016 22:57:05 +0000 (15:57 -0700)]
enic: fix mbuf flags on Rx

In the receive path, the function to set mbuf ol_flags used the
mbuf packet_type before it was set.

Fixes: 947d860c821f ("enic: improve Rx performance")

Signed-off-by: John Daley <johndale@cisco.com>
8 years agoenic: fix crash when allocating too many queues
Nelson Escobar [Thu, 17 Mar 2016 22:49:58 +0000 (15:49 -0700)]
enic: fix crash when allocating too many queues

Add checks to make sure we don't try to allocate more tx or rx queues
than we support.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
8 years agoenic: add missing newline to print statements
Nelson Escobar [Thu, 17 Mar 2016 22:48:13 +0000 (15:48 -0700)]
enic: add missing newline to print statements

Add the missing '\n' character to the end of a few print statements.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Acked-by: John Daley <johndale@cisco.com>
8 years agomlx5: add VLAN insertion offload
Yaacov Hazan [Thu, 17 Mar 2016 15:38:58 +0000 (16:38 +0100)]
mlx5: add VLAN insertion offload

VLAN insertion can be done in hardware when supported in Verbs. A software
fallback is provided otherwise. The software implementation is also used
when multi-packet send is enabled on a queue, as both features are mutually
exclusive.

Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx5: support HW packet padding
Olga Shern [Thu, 17 Mar 2016 15:38:57 +0000 (16:38 +0100)]
mlx5: support HW packet padding

Environment variable MLX5_PMD_ENABLE_PADDING enables HW packet padding
in PCI bus transactions.

When packet size is cache aligned and CRC stripping is enabled, 4 fewer
bytes are written to the PCI bus. Enabling padding makes such packets
aligned again.

In cases where PCI bandwidth is the bottleneck, padding can improve
performance by 10%.

This is disabled by default since this can also decrease performance for
unaligned packet sizes.

Signed-off-by: Olga Shern <olgas@mellanox.com>
fix packet padding macro check

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomlx5: add Rx CRC stripping configuration
Olga Shern [Thu, 17 Mar 2016 15:38:56 +0000 (16:38 +0100)]
mlx5: add Rx CRC stripping configuration

Until now, CRC was always stripped by hardware. This feature can be
configured since MLNX_OFED >= 3.2.

Signed-off-by: Olga Shern <olgas@mellanox.com>
8 years agomlx5: allow operation in secondary processes
Or Ami [Thu, 17 Mar 2016 15:38:55 +0000 (16:38 +0100)]
mlx5: allow operation in secondary processes

Secondary processes are expected to use queues and other resources
allocated by the primary, however Verbs resources can only be shared
between processes when inherited through fork().

This limitation can be worked around for TX by configuring separate queues
from secondary processes.

Signed-off-by: Or Ami <ora@mellanox.com>
8 years agomlx5: support setting link up or down
Or Ami [Thu, 17 Mar 2016 15:38:54 +0000 (16:38 +0100)]
mlx5: support setting link up or down

Add driver functions to set link state up or down.
Burst functions are updated to make sure applications cannot attempt to
send/receive after link is brought down.

Signed-off-by: Or Ami <ora@mellanox.com>
8 years agoi40evf: support reporting PF reset
Jingjing Wu [Tue, 15 Mar 2016 01:59:40 +0000 (09:59 +0800)]
i40evf: support reporting PF reset

When Linux PF and DPDK VF are used for i40e PMD, when a PF reset occurs,
an interrupt will go via adminq event to inform the VF of the reset.
A callback mechanism is introduced for the VF to allow it to invoke a
registered callback when PF  reset happens.

Users can register a callback for this interrupt event using:
  rte_eth_dev_callback_register(portid,
RTE_ETH_EVENT_INTR_RESET,
reset_event_callback,
arg);

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40evf: allocate virtchnl commands buffer per VF
Jingjing Wu [Tue, 15 Mar 2016 01:59:39 +0000 (09:59 +0800)]
i40evf: allocate virtchnl commands buffer per VF

Currently, i40evf PMD uses a global static buffer to send virtchnl
commands to host driver. It is shared by multiple VFs.
This patch changed to allocate a virtchnl cmd buffer for each VF.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agovhost: add driver on top of the library
Tetsuya Mukawa [Mon, 21 Mar 2016 05:45:08 +0000 (14:45 +0900)]
vhost: add driver on top of the library

The patch introduces a new PMD. This PMD is implemented as thin wrapper
of librte_vhost. It means librte_vhost is also needed to compile the PMD.
The vhost messages will be handled only when a port is started. So start
a port first, then invoke QEMU.

The PMD has 2 parameters.
 - iface:  The parameter is used to specify a path to connect to a
           virtio-net device.
 - queues: The parameter is used to specify the number of the queues
           virtio-net device has.
           (Default: 1)

Here is an example.
$ ./testpmd -c f -n 4 --vdev 'eth_vhost0,iface=/tmp/sock0,queues=1' -- -i

To connect above testpmd, here is qemu command example.

$ qemu-system-x86_64 \
        <snip>
        -chardev socket,id=chr0,path=/tmp/sock0 \
        -netdev vhost-user,id=net0,chardev=chr0,vhostforce,queues=1 \
        -device virtio-net-pci,netdev=net0,mq=on

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Update for queue state event name:
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoethdev: add queue state change event type
Tetsuya Mukawa [Mon, 21 Mar 2016 05:45:07 +0000 (14:45 +0900)]
ethdev: add queue state change event type

This patch adds a below event type.
 - RTE_ETH_EVENT_QUEUE_STATE

This event will occur when some queues are enabled or disabled.
So far, only vhost PMD supports the event, and it indicates some queues
are enabled or disabled by virtio-net device. Such an event is needed
because virtio-net device may not enable all queues vhost PMD prepare.

Because only vhost PMD uses the event so far, it isn't an actual hardware
interrupt but a simple software event.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Minor modification to event name and comment:
Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoena: add polling-mode driver
Jan Medala [Thu, 17 Mar 2016 14:31:18 +0000 (15:31 +0100)]
ena: add polling-mode driver

This is a PMD for the Amazon ethernet ENA (Elastic Network Adapters)
family.
The driver operates variety of ENA adapters through feature negotiation
with the adapter and upgradable commands set.
ENA driver handles PCI Physical and Virtual ENA functions.

Signed-off-by: Evgeny Schemeilin <evgenys@amazon.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Release Note addition:
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoena: add communication layer for DPDK
Jan Medala [Thu, 17 Mar 2016 14:31:17 +0000 (15:31 +0100)]
ena: add communication layer for DPDK

Implementation of platform specific code for ENA communication layer.

Signed-off-by: Evgeny Schemeilin <evgenys@amazon.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
8 years agoena: import communication layer
Jan Medala [Thu, 17 Mar 2016 14:31:16 +0000 (15:31 +0100)]
ena: import communication layer

Low level common abstraction for ENA device communication.

Signed-off-by: Netanel Belgazal <netanel@amazon.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
8 years agoena: introduce documentation
Jan Medala [Thu, 17 Mar 2016 14:31:15 +0000 (15:31 +0100)]
ena: introduce documentation

Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
8 years agoethdev: query supported packet types
Jianfeng Tan [Mon, 14 Mar 2016 20:50:50 +0000 (04:50 +0800)]
ethdev: query supported packet types

Add a new API rte_eth_dev_get_supported_ptypes to query what packet types
can be filled by a given device. The device should be already started or
its PMD RX burst function already decided, since the packet types supported
may vary depending on RX function.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agoscripts: improve quiet checkpatch
Thomas Monjalon [Sun, 13 Dec 2015 02:32:58 +0000 (03:32 +0100)]
scripts: improve quiet checkpatch

The option --no-summary will remove this line in quiet mode:
total: 1 errors, 0 warnings, 7 lines checked

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoscripts: fix checkpatch help
Olivier Matz [Tue, 16 Feb 2016 14:36:54 +0000 (15:36 +0100)]
scripts: fix checkpatch help

When started without defining DPDK_CHECKPATCH_PATH, the usage was not
displayed.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agotools: fix setup with built-in kernel modules
Jerin Jacob [Mon, 14 Mar 2016 12:15:32 +0000 (17:45 +0530)]
tools: fix setup with built-in kernel modules

probe the kernel module existence through /sys/module/ to make it work
with both module and inbuilt kernel module

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
8 years agotools: fix setup with huge page size other than 2MB
Jerin Jacob [Mon, 14 Mar 2016 12:15:31 +0000 (17:45 +0530)]
tools: fix setup with huge page size other than 2MB

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
8 years agotools: fix flake8 warnings in bind script
Mauricio Vasquez B [Fri, 19 Feb 2016 17:03:18 +0000 (18:03 +0100)]
tools: fix flake8 warnings in bind script

flake8 checks were run for both python 2.7 and 3.4

There were some style issues as:
- Line width > 79
- No double blank line before function definition
- No double blank space before inline comment
- Some other minor issues

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Acked-by: John McNamara <john.mcnamara@intel.com>
8 years agotools: remove extra blank lines in CPU layout
Keith Wiles [Tue, 8 Dec 2015 18:52:17 +0000 (12:52 -0600)]
tools: remove extra blank lines in CPU layout

The output for the core list included an extra linefeed making
the number of lines displayed much larger then required.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
8 years agoapp/test: fix check for virtual ring device
Olivier Matz [Tue, 15 Mar 2016 12:25:29 +0000 (13:25 +0100)]
app/test: fix check for virtual ring device

This test expects that a vdev is instanciated on the command
line. If it's not the case, just skip this part.

Fixes: 4ea3801b3222 ("app/test: fix ring unit test")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoapp/test: display command line when starting
Olivier Matz [Tue, 15 Mar 2016 12:25:22 +0000 (13:25 +0100)]
app/test: display command line when starting

It's useful for debug purposes to see the command line used by
autotest.py.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>