dpdk.git
7 years agovhost: fix use after free
Yuanhan Liu [Tue, 18 Oct 2016 14:38:06 +0000 (22:38 +0800)]
vhost: fix use after free

Fix the coverity USE_AFTER_FREE issue.

Coverity issue: 137884
Fixes: a277c7159876 ("vhost: refactor code structure")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agovhost: retrieve available head once
Yuanhan Liu [Fri, 14 Oct 2016 09:34:38 +0000 (17:34 +0800)]
vhost: retrieve available head once

There is no need to retrieve the latest avail head every time we enqueue
a packet in the mereable Rx path by

    avail_idx = *((volatile uint16_t *)&vq->avail->idx);

Instead, we could just retrieve it once at the beginning of the enqueue
path. This could diminish the cache penalty slightly, because the virtio
driver could be updating it while vhost is reading it (for each packet).

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
7 years agovhost: prefetch available ring
Yuanhan Liu [Fri, 14 Oct 2016 09:34:37 +0000 (17:34 +0800)]
vhost: prefetch available ring

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
7 years agovhost: shadow used ring update
Zhihong Wang [Fri, 14 Oct 2016 09:34:36 +0000 (17:34 +0800)]
vhost: shadow used ring update

The basic idea is to shadow the used ring update: update them into a
local buffer first, and then flush them all to the virtio used vring
at once in the end.

And since we do avail ring reservation before enqueuing data, we would
know which and how many descs will be used. Which means we could update
the shadow used ring at the reservation time. It also introduce another
slight advantage: we don't need access the desc->flag any more inside
copy_mbuf_to_desc_mergeable().

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
7 years agovhost: use last available index for ring reservation
Yuanhan Liu [Fri, 14 Oct 2016 09:34:35 +0000 (17:34 +0800)]
vhost: use last available index for ring reservation

shadow_used_ring will be introduced later. Since then last avail
idx will not be updated together with last used idx.

So, here we use last_avail_idx for avail ring reservation.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
7 years agovhost: simplify mergeable Rx vring reservation
Yuanhan Liu [Fri, 14 Oct 2016 09:34:34 +0000 (17:34 +0800)]
vhost: simplify mergeable Rx vring reservation

Let it return "num_buffers" we reserved, so that we could re-use it
with copy_mbuf_to_desc_mergeable() directly, instead of calculating
it again there.

Meanwhile, the return type of copy_mbuf_to_desc_mergeable is changed
to "int". -1 will be return on error.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
7 years agovhost: optimize cache access
Zhihong Wang [Fri, 14 Oct 2016 09:34:33 +0000 (17:34 +0800)]
vhost: optimize cache access

This patch reorders the code to delay virtio header write to improve
cache access efficiency for cases where the mrg_rxbuf feature is turned
on. CPU pipeline stall cycles can be significantly reduced.

Virtio header write and mbuf data copy are all remote store operations
which takes a long time to finish. It's a good idea to put them together
to remove bubbles in between, to let as many remote store instructions
as possible go into store buffer at the same time to hide latency, and
to let the H/W prefetcher goes to work as early as possible.

On a Haswell machine, about 100 cycles can be saved per packet by this
patch alone. Taking 64B packets traffic for example, this means about 60%
efficiency improvement for the enqueue operation.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
7 years agovhost: remove useless volatile
Zhihong Wang [Fri, 14 Oct 2016 09:34:32 +0000 (17:34 +0800)]
vhost: remove useless volatile

last_used_idx is a local var, there is no need to decorate it
by "volatile".

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Jianbo Liu <jianbo.liu@linaro.org>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
7 years agovhost: access header only if offloading is supported
Maxime Coquelin [Fri, 14 Oct 2016 08:07:07 +0000 (10:07 +0200)]
vhost: access header only if offloading is supported

If offloading features are not negotiated, parsing the virtio header
is not needed.

Micro-benchmark with testpmd shows that the gain is +4% with indirect
descriptors, +1% when using direct descriptors.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agoethdev: prevent duplicate event callback
E. Scott Daniels [Thu, 20 Oct 2016 13:34:41 +0000 (09:34 -0400)]
ethdev: prevent duplicate event callback

This change prevents the attempt to add a structure which is
already on the callback list. If a struct with matching
parameters is found on the list, then no action is taken.

Fixes: ac2f69c ("ethdev: fix crash if malloc of user callback fails")

Signed-off-by: E. Scott Daniels <daniels@research.att.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agomempool: fix search of maximum contiguous pages
Wei Dai [Tue, 25 Oct 2016 15:01:11 +0000 (17:01 +0200)]
mempool: fix search of maximum contiguous pages

paddr[i] + pg_sz always points to the start physical address of the
2nd page after pddr[i], so only up to 2 pages can be combinded to
be used. With this revision, more than 2 pages can be used.

Fixes: 84121f197187 ("mempool: store memory chunks in a list")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
7 years agoapp/testpmd: fix PF/VF check of flow director
Wenzhuo Lu [Wed, 19 Oct 2016 01:12:15 +0000 (09:12 +0800)]
app/testpmd: fix PF/VF check of flow director

Parameters pf & vf are added into most of flow director
filter CLIs.
But mac-vlan and tunnel filters don't have these parameters,
the parameters should not be checked for mac-vlan and tunnel
filters.

Fixes: e6a68c013353 ("app/testpmd: extend commands for flow director in VF")

Reported-by: Frederico Cadete <frederico.cadete-ext@oneaccess-net.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agocrypto: register aliases for renamed vdev drivers
Jan Blunck [Mon, 24 Oct 2016 16:22:23 +0000 (12:22 -0400)]
crypto: register aliases for renamed vdev drivers

This registers the legacy names of the driver being renamed in
commit 2f45703c17ac ("drivers: make driver names consistent").

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agonet: register aliases for renamed vdev drivers
Jan Blunck [Mon, 24 Oct 2016 16:22:22 +0000 (12:22 -0400)]
net: register aliases for renamed vdev drivers

This registers the legacy names of the driver being renamed in
commit 2f45703c17ac ("drivers: make driver names consistent").

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agoeal: add driver name alias
Jan Blunck [Mon, 24 Oct 2016 16:22:21 +0000 (12:22 -0400)]
eal: add driver name alias

This adds infrastructure for drivers to allow being requested by an alias
so that a renamed driver can still get loaded by its legacy name.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agoexamples/l3fwd: use accelerated CRC on ARM
Hemant Agrawal [Fri, 14 Oct 2016 11:10:56 +0000 (16:40 +0530)]
examples/l3fwd: use accelerated CRC on ARM

if machine level CRC extension are available, offload the
hash to machine provide functions e.g. armv8-a CRC extensions
support it

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agoexamples/tep_term: fix packet length with multi-segments
Michael Qiu [Tue, 18 Oct 2016 05:49:07 +0000 (13:49 +0800)]
examples/tep_term: fix packet length with multi-segments

For multi-seg mbuf, ip->total_length should be pkt_len subtract
ether len.

Fixes: 4abe471ed6fc ("examples/tep_term: implement VXLAN processing")

Signed-off-by: Michael Qiu <qiudayu@chinac.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
7 years agoexamples/tep_term: fix L4 length
Michael Qiu [Tue, 18 Oct 2016 05:49:06 +0000 (13:49 +0800)]
examples/tep_term: fix L4 length

l4_len is not fixed, althrough mostly it is a fixed value,
but when guest using iperf to do some tests, the l4_len
will have another 12 bytes optional fields.

Fixes: 2bb43bd4350a ("examples/tep_term: add TSO offload configuration")

Signed-off-by: Michael Qiu <qiudayu@chinac.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
7 years agoexamples/ip_pipeline: fix build with gcc 6
Jasvinder Singh [Mon, 17 Oct 2016 10:51:16 +0000 (11:51 +0100)]
examples/ip_pipeline: fix build with gcc 6

This patch fixes the misleading indentation error on compiling
ip_pipeline app with gcc v6.2.1.

Fixes: 3f2c9f3bb6c6 ("examples/ip_pipeline: add TAP port")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agoexamples/ip_pipeline: fix build on BSD
Jasvinder Singh [Mon, 17 Oct 2016 15:48:57 +0000 (16:48 +0100)]
examples/ip_pipeline: fix build on BSD

Error log:
 CC init.o
 examples/ip_pipeline/init.c:38:22: fatal error: linux/if.h: No such file or directory
 #include <linux/if.h>

Fixes: 3f2c9f3bb6c6 ("examples/ip_pipeline: add TAP port")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agokni: fix build with kernel 4.9
Ferruh Yigit [Mon, 17 Oct 2016 10:23:14 +0000 (11:23 +0100)]
kni: fix build with kernel 4.9

compile error:
  CC [M]  .../lib/librte_eal/linuxapp/kni/igb_main.o
.../lib/librte_eal/linuxapp/kni/igb_main.c:2317:21:
error: initialization from incompatible pointer type
[-Werror=incompatible-pointer-types]
  .ndo_set_vf_vlan = igb_ndo_set_vf_vlan,
                     ^~~~~~~~~~~~~~~~~~~

Linux kernel 4.9 updates API for ndo_set_vf_vlan:
Linux: 79aab093a0b5 ("net: Update API for VF vlan protocol 802.1ad support")

Use new API for Linux kernels >= 4.9

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agokni: fix build with kernel < 3.1
Ferruh Yigit [Fri, 14 Oct 2016 16:41:54 +0000 (17:41 +0100)]
kni: fix build with kernel < 3.1

compile error:
  CC [M]  .../lib/librte_eal/linuxapp/kni/kni_misc.o
cc1: warnings being treated as errors
.../lib/librte_eal/linuxapp/kni/kni_misc.c: In function ‘kni_exit_net’:
.../lib/librte_eal/linuxapp/kni/kni_misc.c:113:18:
error: unused variable ‘knet’

For kernel versions < v3.1 mutex_destroy() is a macro and does nothing,
this cause an unused variable warning for knet which used in the
mutex_destroy()

mutex_destroy() converted into static inline function with commit:
Linux: 4582c0a4866e ("mutex: Make mutex_destroy() an inline function")

To fix the warning unused attribute added to the knet variable.

Fixes: 93a298b34e1b ("kni: support core id parameter in single threaded mode")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoversion: 16.11-rc1
Thomas Monjalon [Fri, 14 Oct 2016 00:34:11 +0000 (02:34 +0200)]
version: 16.11-rc1

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
7 years agodoc: fix libcrypto guide title
Pablo de Lara [Thu, 13 Oct 2016 19:25:29 +0000 (20:25 +0100)]
doc: fix libcrypto guide title

Libcrypto documentation was missing the equal signs ("="),
in its title, so it was not present in the documentation
generated.

Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agodoc: how to build KASUMI as shared library
Pablo de Lara [Thu, 13 Oct 2016 19:21:53 +0000 (20:21 +0100)]
doc: how to build KASUMI as shared library

Libsso KASUMI library has to be built with specific
parameters to make the KASUMI PMD be built as
a shared library, so a note has been added in
its documentation.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agodoc: add ZUC shared library limitation
Pablo de Lara [Thu, 13 Oct 2016 18:48:15 +0000 (19:48 +0100)]
doc: add ZUC shared library limitation

ZUC PMD cannot be built as a shared library, due to
the fact that some assembly code in the underlying libsso
library is not relocatable.
This will be fixed in the future, but for the moment,
it is added as a limitationof the PMD.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agocrypto/libcrypto: fix init function names
Pablo de Lara [Tue, 11 Oct 2016 01:15:05 +0000 (02:15 +0100)]
crypto/libcrypto: fix init function names

All init/uninit function names in the virtual devices have been renamed,
so they finish with probe or remove, so to keep consistency,
same thing should be done in this PMD.

Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocrypto/zuc: fix init function names
Pablo de Lara [Tue, 11 Oct 2016 01:14:52 +0000 (02:14 +0100)]
crypto/zuc: fix init function names

All init/uninit function names in the virtual devices have been renamed,
so they finish with probe or remove, so to keep consistency,
same thing should be done in this PMD.

Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoapp/test: store digest/IV at a DMA able address
Akhil Goyal [Wed, 12 Oct 2016 11:16:29 +0000 (16:46 +0530)]
app/test: store digest/IV at a DMA able address

For physical crypto devices, IV and digest are processed by the crypto
device which needs the contents to be written on some DMA able address.

So in order to do that, IV and digest are accomodated in the packet.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoapp/test: fix crypto mbuf pool size
Piotr Azarewicz [Tue, 11 Oct 2016 10:06:53 +0000 (12:06 +0200)]
app/test: fix crypto mbuf pool size

The created pool for crypto mbufs may be too big in some
environments.
To avoid this issue, mbuf pool is reverted to its previous size.
Moreover, here is added additional small pool with one large mbuf,
that is needed in large data test scenarios.

Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
7 years agoexamples/l2fwd-crypto: fix verify with decrypt in chain
Piotr Azarewicz [Wed, 12 Oct 2016 08:58:44 +0000 (10:58 +0200)]
examples/l2fwd-crypto: fix verify with decrypt in chain

This patch fixes crypto operation data parameters setting
in l2fwd-crypto application, making decryption in chain
with auth verification work.

How to reproduce the issue:

1. Run l2fwd_crypto with command:
-c 0x3 -n 4 --vdev "crypto_aesni_mb" \
--vdev "crypto_aesni_mb" \
-- -p 0x3 --chain CIPHER_HASH \
--cipher_op ENCRYPT --cipher_algo AES_CBC \
--cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f \
--iv 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:ff \
--auth_op GENERATE --auth_algo SHA1_HMAC \
--auth_key
11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:
11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:
11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11

2. Send packet with payload and capture forwarded packet.
Payload in forwarded packet is encrypted, what is good.

3. Run l2fwd_crypto with command:
-c 0x3 -n 4 --vdev "crypto_aesni_mb" \
--vdev "crypto_aesni_mb" \
-- -p 0x3 --chain HASH_CIPHER \
--cipher_op DECRYPT --cipher_algo AES_CBC \
--cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f \
--iv 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:ff \
--auth_op VERIFY --auth_algo SHA1_HMAC \
--auth_key
11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:
11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:
11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11

4. Send earlier captured packet and capture forwarded packet.
Payload in newly captured packet is not decrypted, what is wrong.

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

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
7 years agoapp/test: reduce libcrypto operations number
Marcin Kerlin [Mon, 10 Oct 2016 08:07:50 +0000 (10:07 +0200)]
app/test: reduce libcrypto operations number

This patch reduce the number of total operations from 1M to 10K,
because test is taking too long time now.

Fixes: ffbe3be0d4b5 ("app/test: add libcrypto")

Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agonet/ixgbe: add application callback on VF to PF messsage
Bernard Iremonger [Mon, 10 Oct 2016 14:34:15 +0000 (15:34 +0100)]
net/ixgbe: add application callback on VF to PF messsage

call _rte_eth_dev_callback_process from ixgbe_rcv_msg_from_vf function.

The callback asks the user application if it is allowed to perform
the function.

If the cb_param.retval is RTE_PMD_IXGBE_MB_EVENT_PROCEED then continue,
if 0, do nothing and send ACK to VF
if > 1, do nothing and send NAK to VF.

Signed-off-by: Alex Zelezniak <alexz@att.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
7 years agoethdev: add an argument to internal callback function
Bernard Iremonger [Mon, 10 Oct 2016 14:34:14 +0000 (15:34 +0100)]
ethdev: add an argument to internal callback function

add cb_arg parameter to the _rte_eth_dev_callback_process function.

Adding a parameter to this function allows passing information
to the application when an eth device event occurs such as
a VF to PF message.
This allows the application to decide if a particular function
is permitted.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Signed-off-by: Alex Zelezniak <alexz@att.com>
7 years agodrivers: rename register macro prefix
Shreyansh Jain [Mon, 10 Oct 2016 05:43:15 +0000 (11:13 +0530)]
drivers: rename register macro prefix

All macros related to driver registeration renamed from DRIVER_*
to RTE_PMD_*

This includes:

 DRIVER_REGISTER_PCI -> RTE_PMD_REGISTER_PCI
 DRIVER_REGISTER_PCI_TABLE -> RTE_PMD_REGISTER_PCI_TABLE
 DRIVER_REGISTER_VDEV -> RTE_PMD_REGISTER_VDEV
 DRIVER_REGISTER_PARAM_STRING -> RTE_PMD_REGISTER_PARAM_STRING
 DRIVER_EXPORT_* -> RTE_PMD_EXPORT_*

Fix PMDINFOGEN tool to look for matches of RTE_PMD_REGISTER_*.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
7 years agonet/i40e: implement new Rx checksum flag
Xiao Wang [Tue, 6 Sep 2016 01:27:32 +0000 (09:27 +0800)]
net/i40e: implement new Rx checksum flag

Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
7 years agonet/ixgbe: implement new Rx checksum flag
Xiao Wang [Tue, 6 Sep 2016 01:27:31 +0000 (09:27 +0800)]
net/ixgbe: implement new Rx checksum flag

Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
7 years agonet/e1000: implement new Rx checksum flag
Xiao Wang [Tue, 6 Sep 2016 01:27:30 +0000 (09:27 +0800)]
net/e1000: implement new Rx checksum flag

Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
7 years agonet/fm10k: implement new Rx checksum flag
Xiao Wang [Tue, 6 Sep 2016 01:27:29 +0000 (09:27 +0800)]
net/fm10k: implement new Rx checksum flag

Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one.
Since vector Rx supports checksum offload, this patch removes the
hw_ip_checksum check in fm10k_rx_vec_condition_check().

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
7 years agonet/fm10k: fix Rx checksum flags
Xiao Wang [Tue, 6 Sep 2016 01:27:28 +0000 (09:27 +0800)]
net/fm10k: fix Rx checksum flags

A previous patch removed some necessary lines about Rx checksum offload
by mistake, this patch adds them back.

Fixes: 6046898f5097 ("net/mbuf: remove unused Rx error flags")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
7 years agonet/ixgbe: support checksum flags in SSE vector Rx
Olivier Matz [Thu, 7 Jul 2016 12:19:02 +0000 (14:19 +0200)]
net/ixgbe: support checksum flags in SSE vector Rx

Update desc_to_olflags_v() to set PKT_RX_IP_CKSUM_BAD and
PKT_RX_L4_CKSUM_BAD in the ol_fags of the mbuf.

The Rx vector function can now be used with hw_ip_checksum
enabled.

Tested with:

  cd dpdk.org/
  make config T=x86_64-native-linuxapp-gcc
  make -j32
  mkdir -p /mnt/huge
  mount -t hugetlbfs nodev /mnt/huge
  echo 256 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
  modprobe uio_pci_generic
  python tools/dpdk_nic_bind.py -b uio_pci_generic 0000:04:00.0
  ./build/app/testpmd -l 2,4 -- --total-num-mbufs=65536 -i --port-topology=chained --enable-rx-cksum --disable-hw-vlan-filter --disable-hw-vlan-strip
    set fwd rxonly
    set verbose 1
    start

  # send packets to testpmd using scapy
  eh = Ether(src="00:01:02:03:04:05", dst="00:1B:21:AB:8F:10")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2")/UDP()/Raw("x"*50)
  sendp(p, iface="ixgbe2")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2", chksum=42)/UDP()/Raw("x"*50)
  sendp(p, iface="ixgbe2")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2")/UDP(chksum=42)/Raw("x"*50)
  sendp(p, iface="ixgbe2")
  p = Ether()/IP(src="1.1.1.1", dst="1.1.1.2", chksum=45)/UDP(chksum=42)/Raw("x"*50)
  sendp(p, iface="ixgbe2")

  # result
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
    PKT_RX_IP_CKSUM_BAD
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
    PKT_RX_L4_CKSUM_BAD
  port 0/queue 0: received 1 packets
    src=00:01:02:03:04:05 - dst=00:1B:21:AB:8F:10 - type=0x0800 - length=92 - nb_segs=1Unknown packet type
   - Receive queue=0x0
    PKT_RX_L4_CKSUM_BAD
    PKT_RX_IP_CKSUM_BAD

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
7 years agoapp/testpmd: add ixgbe VF management
Bernard Iremonger [Wed, 12 Oct 2016 17:54:12 +0000 (18:54 +0100)]
app/testpmd: add ixgbe VF management

add test for set vf vlan anti spoof
add test for set vf mac anti spoof
add test for set vf vlan stripq
add test for set vf vlan insert
add test for set tx loopback
add test for set all queues drop enable bit
add test for set vf split drop enable bit
add test for set vf mac address
add new APIs to testpmd help command.

add new APIs to the testpmd guide

Modify Makefile, add library rte_pmd_ixgbe to _LDLIBS-y.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
7 years agonet/ixgbe: add API for VF management
Bernard Iremonger [Wed, 12 Oct 2016 17:54:11 +0000 (18:54 +0100)]
net/ixgbe: add API for VF management

Add APIs to configure and manage VFs on an Intel 82559 NIC.

add rte_pmd_ixgbe_set_vf_vlan_anti_spoof function.
add rte_pmd_ixgbe_set_vf_mac_anti_spoof function.
add rte_pmd_ixgbe_set_vf_stripq function.

Signed-off-by: Alex Zelezniak <alexz@att.com>
add rte_pmd_ixgbe_set_vf_vlan_insert function.
add rte_pmd_ixgbe_set_tx_loopback function.
add rte_pmd_ixgbe_set_all_queues_drop function.
add rte_pmd_ixgbe_set_vf_split_drop_en function.
add rte_pmd_ixgbe_set_vf_mac_addr function.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
7 years agonet/ring: fix parameter string info
Ferruh Yigit [Wed, 31 Aug 2016 16:53:51 +0000 (17:53 +0100)]
net/ring: fix parameter string info

Fixes: 65eca099f405 ("drivers: split parameters infos in multiple lines")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agonet/ring: fix ring device creation via devargs
Ferruh Yigit [Wed, 31 Aug 2016 16:51:11 +0000 (17:51 +0100)]
net/ring: fix ring device creation via devargs

Using nodeaction devarg lets creating multiple ring eth devices:
"eth_ring0,nodeaction=R0:0:CREATE,nodeaction=R1:0:CREATE"

Trying to create all devices with same name fails. Since first part of
the nodeaction devarg is name (in above sample R0,R1), this name field
can be used as eth dev name.

Fixes: 61934c0956d4 ("ring: convert to use of PMD_REGISTER_DRIVER and fix linking")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agonet/bnxt: support async link notification
Ajit Khaparde [Tue, 11 Oct 2016 21:47:50 +0000 (16:47 -0500)]
net/bnxt: support async link notification

This patch adds support to get Link notification asynchronously.
The HW sends async notifications on default completion ring. The
PMD processes these notifications and logs a message appropriately.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agodoc: update bnxt guide
Ajit Khaparde [Thu, 29 Sep 2016 17:04:08 +0000 (12:04 -0500)]
doc: update bnxt guide

This patch reformats the Broadcom PMD driver documentation.

Also since the PMD now loads on a VF interface, update the
documentation accordingly.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agonet/bnxt: fix crash when closing
Ajit Khaparde [Thu, 29 Sep 2016 17:03:44 +0000 (12:03 -0500)]
net/bnxt: fix crash when closing

This patch fixes segfault encountered during dev_uninit/close routine.
KNI sample app can be used to reproduce the issue.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnx2x: merge debug register operations into headers
Chas Williams [Tue, 11 Oct 2016 23:05:01 +0000 (19:05 -0400)]
net/bnx2x: merge debug register operations into headers

The register read/writes should just be static inline instead of
alternately defined as routines or macros depending on the status of
debugging.

Fix bnx2x_reg_read32() returning 0 during debug unaligned reads.

Fixes: b5bf7719221d ("bnx2x: driver support routines")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
7 years agonet/bnx2x: do not return structs
Chas Williams [Tue, 11 Oct 2016 23:05:00 +0000 (19:05 -0400)]
net/bnx2x: do not return structs

bnx2x_loop_obtain_resources() returns a struct.  This routine either
succeeds or fails -- We don't need a struct for that.

Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
7 years agonet/bnx2x: check return codes during VF mailbox operation
Chas Williams [Tue, 11 Oct 2016 23:04:59 +0000 (19:04 -0400)]
net/bnx2x: check return codes during VF mailbox operation

Refactor bnx2x_do_req4pf() to be easier to read and return errors when
the transaction fails -- Previously, it could succeed when the control
channel was down.

Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
7 years agonet/bnx2x: serialize access to VF mailbox
Chas Williams [Tue, 11 Oct 2016 23:04:58 +0000 (19:04 -0400)]
net/bnx2x: serialize access to VF mailbox

The pf2vf mailbox can only be used by one thread at a time.

Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
7 years agonet/bnx2x: replace macro with static function
Chas Williams [Tue, 11 Oct 2016 23:04:57 +0000 (19:04 -0400)]
net/bnx2x: replace macro with static function

Replace BNX2X_TLV_APPEND() with the clearer and safer bnx2x_add_tlv().
bnx2x_add_tlv() was previously prototyped at some point but can be static.

Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
7 years agonet/bnx2x: restrict Rx mask flags sent to the PF
Chas Williams [Tue, 11 Oct 2016 23:04:56 +0000 (19:04 -0400)]
net/bnx2x: restrict Rx mask flags sent to the PF

Don't use bnx2x_fill_accept_flags() to fill the RX mask in the VF
since the PF only handles a subset of the existing flags.  now,
bnx2x_fill_accept_flags() can be static.

Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
7 years agonet/bnx2x: remove unused Rx queue code
Chas Williams [Tue, 11 Oct 2016 23:04:55 +0000 (19:04 -0400)]
net/bnx2x: remove unused Rx queue code

Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
7 years agonet/bnx2x: remove delay during device startup
Chas Williams [Tue, 11 Oct 2016 23:04:54 +0000 (19:04 -0400)]
net/bnx2x: remove delay during device startup

This 2.5s delay doesn't seem to serve any purpose other than a being a
pause after logging the device configuration.

Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
7 years agonet/bnx2x: remove unused preprocessor code
Chas Williams [Tue, 11 Oct 2016 23:04:53 +0000 (19:04 -0400)]
net/bnx2x: remove unused preprocessor code

ELINK_INCLUDE_EMUL and ELINK_INCLUDE_FPGA are never defined.  Remove them
along with enumeration constants dependent on their inclusion.

Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
7 years agonet/bnx2x: get cache line size from build configuration
Chas Williams [Tue, 11 Oct 2016 23:04:52 +0000 (19:04 -0400)]
net/bnx2x: get cache line size from build configuration

Correctly hint the cache line size.  Remove unused macros associated
with the cache line size.

Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Chas Williams <3chas3@gmail.com>
Acked-by: Harish Patil <harish.patil@qlogic.com>
7 years agonet/mlx5: fix Rx function selection
Nélio Laranjeiro [Tue, 11 Oct 2016 14:44:50 +0000 (16:44 +0200)]
net/mlx5: fix Rx function selection

mlx5_rx_queue_setup() was setting the Rx function by itself instead of
using priv_select_rx_function() written for that purpose.

Fixes: cdab90cb5c8d ("net/mlx5: add Tx/Rx burst function selection wrapper")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/enic: add ethernet VLAN packet type
John Daley [Wed, 24 Aug 2016 19:07:02 +0000 (12:07 -0700)]
net/enic: add ethernet VLAN packet type

Enic is capable of recognizing packets to be delivered to the
app with single VLAN tags. Advertise this with the ptype
RTE_PTYPE_L2_ETHER_VLAN and set the ptype for VLAN packets.

Signed-off-by: John Daley <johndale@cisco.com>
7 years agodoc: add ixgbe supported chipsets and NICs
Wei Dai [Mon, 26 Sep 2016 01:23:36 +0000 (09:23 +0800)]
doc: add ixgbe supported chipsets and NICs

get the list of all chipsets and NICs supported
by ixgbe driver from
https://downloadcenter.intel.com/download/14687

Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agonet/bnxt: fix bit shift size
John W. Linville [Thu, 29 Sep 2016 17:39:36 +0000 (13:39 -0400)]
net/bnxt: fix bit shift size

Some(?) compilers will treat the unmarked constant 1 as a 32-bit
integer, but the shift operation is in a loop that could run up to
63 times -- undefined behavior!

Coverity issue: 127546
Fixes: 778b759ba10e ("net/bnxt: add MAC address")

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/i40e: do not use VSI before NULL check
John W. Linville [Thu, 29 Sep 2016 17:39:35 +0000 (13:39 -0400)]
net/i40e: do not use VSI before NULL check

Coverity issue: 127556
Fixes: 440499cf5376 ("net/i40e: support floating VEB")

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/bnxt: ensure entry length is unsigned
John W. Linville [Thu, 29 Sep 2016 17:39:34 +0000 (13:39 -0400)]
net/bnxt: ensure entry length is unsigned

Otherwise, the inherent cast when multiplying entry_length by max_vnics
in the call to rte_memzone_reserve could promote max_vnics to a signed
value, causing hilarity to ensue...

Coverity issue: 127557
Fixes: 9738793f28ec ("net/bnxt: add VNIC functions and structs")

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/ena: improve safety of string handling
John W. Linville [Thu, 29 Sep 2016 17:39:33 +0000 (13:39 -0400)]
net/ena: improve safety of string handling

Use sizeof dest rather than sizeof src for limiting copy length,
and replace strncpy with snprintf to ensure NULL termination.

Coverity issue: 127795
Fixes: 372c1af5ed8f ("net/ena: add dedicated memory area for extra device info")

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/bnx2x: fix socket id for slowpath memory
Rasesh Mody [Thu, 6 Oct 2016 05:36:37 +0000 (22:36 -0700)]
net/bnx2x: fix socket id for slowpath memory

When the DMA allocation routine is invoked in the context of a non-EAL
thread, the API rte_lcore_id() returns -1 and indexing on that in
rte_lcore_to_socket_id() leads to segfault. The fix is to use
SOCKET_ID_ANY as the socket_id for all slowpath memory allocation.

Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
7 years agonet/bnx2x: fix maximum PF queues
Rasesh Mody [Thu, 6 Oct 2016 05:36:36 +0000 (22:36 -0700)]
net/bnx2x: fix maximum PF queues

Fix the max number of PF rx/tx queues. Set the value based
on BNX2X_MAX_RSS_COUNT() rather than hard coding it to 128.

Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Acked-by: Chas Williams <3chas3@gmail.com>
7 years agonet/enic: extend flow director support for 1300 series
John Daley [Thu, 29 Sep 2016 20:56:39 +0000 (13:56 -0700)]
net/enic: extend flow director support for 1300 series

1300 series Cisco adapter firmware version 2.0(13) for UCS
C-series servers and 3.1(2) for blade servers supports more
filtering capabilities. The feature can be enabled via Cisco
CIMC or USCM with the 'advanced filters' radio button. When
enabled, the these additional flow director modes are available:
RTE_ETH_FLOW_NONFRAG_IPV4_OTHER
RTE_ETH_FLOW_NONFRAG_IPV4_SCTP
RTE_ETH_FLOW_NONFRAG_IPV6_UDP
RTE_ETH_FLOW_NONFRAG_IPV6_TCP
RTE_ETH_FLOW_NONFRAG_IPV6_SCTP
RTE_ETH_FLOW_NONFRAG_IPV6_OTHER

Changes:
- Detect and set an 'advanced filters' flag dependent on the adapter
  capability.
- Implement RTE_ETH_FILTER_INFO filter op to return the flow types
  available dependent on whether advanced filters are enabled.
- Use a function pointer to select how filters are added to the adapter:
  copy_fltr_v1() for older firmware/adapters or copy_fltr_v2() for
  adapters which support advanced filters.
- Apply fdir global masks to filters when in advanced filter mode.
- Update documentation.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
7 years agonet/enic/base: update VIC adapter
John Daley [Thu, 29 Sep 2016 20:56:38 +0000 (13:56 -0700)]
net/enic/base: update VIC adapter

Update the VIC adapter file which is common with the firmware and
other VIC drivers. This is needed to support new capabilities
for 1300 adapters, including advanced filtering, which is available
in VIC firmware version 2.0(13) for UCS rack and 3.1(2).

Signed-off-by: John Daley <johndale@cisco.com>
7 years agonet/enic: fix crash with removed flow director filters
John Daley [Thu, 29 Sep 2016 20:56:37 +0000 (13:56 -0700)]
net/enic: fix crash with removed flow director filters

When flow director filters where removed when an enic device is
stopped, the filters were freed but the pointer was not set to
NULL so the next stop would try to free them again.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: John Daley <johndale@cisco.com>
7 years agonet/enic: fix flow director
John Daley [Thu, 29 Sep 2016 20:56:36 +0000 (13:56 -0700)]
net/enic: fix flow director

The wrong queue id was being used in the enic
flow director code after the scattered Rx feature
was added.

Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx")

Signed-off-by: John Daley <johndale@cisco.com>
7 years agonet/enic: document how to configure vNIC parameters
Nelson Escobar [Thu, 29 Sep 2016 20:55:05 +0000 (13:55 -0700)]
net/enic: document how to configure vNIC parameters

Update the enic guide to better explain how to setup vNIC parameters
on the Cisco VIC since the introduction of rx scatter, and print an
error message for the case of having 1 RQ configured in the vNIC,
referring to the documentation for more information.

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agonet/mlx: align drivers to latest naming convention
David Marchand [Fri, 7 Oct 2016 13:04:13 +0000 (15:04 +0200)]
net/mlx: align drivers to latest naming convention

Fixes: 2f45703c17ac ("drivers: make driver names consistent")

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/thunderx: increase driver version to 2.0
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:54 +0000 (14:05 +0200)]
net/thunderx: increase driver version to 2.0

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/thunderx: document secondary queue set support
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:52 +0000 (14:05 +0200)]
net/thunderx: document secondary queue set support

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agonet/thunderx: add final bits for secondary queue support
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:51 +0000 (14:05 +0200)]
net/thunderx: add final bits for secondary queue support

Summary:
 - add secondary qset support in device stats
 - add support for releasing mbufs from RBDR for >8 queues
 - add support for releasing mbufs from RX queues for >8 queues
 - support >8 queues in tx_queue_setup
 - support >8 queues in rx_queue_setup
 - support up to 96 queues per device (dev_info->max_rx_queues)
 - add secondary qset support in rbdr_rte_mempool_get
 - support >8 queues in multiprocess mode (do not reconfigure VFs)
 - setup periodic alarm accordingly for type of VFs:
   * primary VF   - handle events on queues and link status
   * secondary VF - handle events on queues
 - initialize hardware capabilities in secondary qsets

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/thunderx: add secondary queue set support in configure
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:50 +0000 (14:05 +0200)]
net/thunderx: add secondary queue set support in configure

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/thunderx: add secondary queue set support in start
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:49 +0000 (14:05 +0200)]
net/thunderx: add secondary queue set support in start

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/thunderx: add secondary queue set support in stop/close
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:48 +0000 (14:05 +0200)]
net/thunderx: add secondary queue set support in stop/close

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/thunderx: add helpers for secondary queue set
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:47 +0000 (14:05 +0200)]
net/thunderx: add helpers for secondary queue set

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/thunderx: remove private data to ethdev link
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:46 +0000 (14:05 +0200)]
net/thunderx: remove private data to ethdev link

In case of the multiprocess mode a shared nicvf struct between processes
cannot point with the eth_dev pointer to master device, therefore remove it
along with references to it refactoring the code where needed.

This change fixes multiprocess issues detected in stats.

Fixes: 7413feee662d ("net/thunderx: add device start/stop and close")

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/thunderx: add secondary queue set in interrupt functions
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:45 +0000 (14:05 +0200)]
net/thunderx: add secondary queue set in interrupt functions

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/thunderx: add functions to store qsets
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:44 +0000 (14:05 +0200)]
net/thunderx: add functions to store qsets

These functions (nicvf_svf) are DPDK specialization of base/nicvf_bsvf.[ch]
ones.

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/thunderx/base: add secondary queue set support
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:43 +0000 (14:05 +0200)]
net/thunderx/base: add secondary queue set support

Changes:
 - add new message sqs_alloc in mailbox
 - add a queue container to hold secondary qsets.
 - add nicvf_mbox_request_sqs
 - handle new mailbox messages for secondary queue set support
 - register secondary queue sets for further reuse
 - register the number secondary queue sets in MSG_QS_CFG

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/thunderx/base: add functions to store qsets
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:42 +0000 (14:05 +0200)]
net/thunderx/base: add functions to store qsets

This interface (nicvf_bsvf) will be used for secondary queue set support.

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/thunderx: fix Tx checksum handling
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:41 +0000 (14:05 +0200)]
net/thunderx: fix Tx checksum handling

The symbols PKT_TX_TCP_CKSUM and PKT_TX_UDP_CKSUM are not bits on a
bitmask. Set l3_offset always for TX offloads, not just for PKT_TX_IP_CKSUM
being true.

Fixes: 1c421f18e095 ("net/thunderx: add single and multi-segment Tx")

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/thunderx: cleanup
Kamil Rytarowski [Fri, 30 Sep 2016 12:05:40 +0000 (14:05 +0200)]
net/thunderx: cleanup

Refactored features:
 - enable nicvf_qset_rbdr_precharge to handle secondary queue sets
 - rte_free already handles NULL pointer
 - check mempool flags to predict being contiguous in memory
 - prohibit to use mempool with multiple memory chunks
 - simplify local construct of accessing nb_rx_queues
 - enable NICVF_CAP_CQE_RX2 on CN88XX PASS2.0 hardware.
 - remove redundant check for RSS size in nicvf_eth_dev_init

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agonet/i40e: enable bad checksum flags in vector Rx
Damjan Marion [Thu, 6 Oct 2016 06:38:10 +0000 (02:38 -0400)]
net/i40e: enable bad checksum flags in vector Rx

Decode the checksum flags from the Rx descriptor, setting
the appropriate bit in the mbuf ol_flags field when the flag
indicates a bad checksum.

Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
7 years agonet/i40e: add packet type metadata in vector Rx
Damjan Marion [Thu, 6 Oct 2016 06:38:09 +0000 (02:38 -0400)]
net/i40e: add packet type metadata in vector Rx

The ptype is decoded from the Rx descriptor and stored
in the packet type field in the mbuf using the same function
in the non-vector driver.

Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
7 years agonet/bonding: enable slave VLAN filter
Eric Kinzie [Thu, 4 Aug 2016 18:24:43 +0000 (11:24 -0700)]
net/bonding: enable slave VLAN filter

SR-IOV virtual functions cannot rely on promiscuous mode for the reception
of VLAN tagged frames. Program the VLAN filter for each slave when a
VLAN is configured for the bonding master.

Signed-off-by: Eric Kinzie <ehkinzie@gmail.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
7 years agonet/bonding: validate speed after link up
Eric Kinzie [Thu, 4 Aug 2016 18:24:42 +0000 (11:24 -0700)]
net/bonding: validate speed after link up

It's possible for the bonding driver to mistakenly reject an interface
based in it's, as yet, unnegotiated link speed and duplex. Always allow
the interface to be added to the bonding interface but require link
properties validation to succeed before slave is activated.

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

Signed-off-by: Eric Kinzie <ehkinzie@gmail.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
7 years agodoc: add limitations for i40e PMD
Jingjing Wu [Fri, 30 Sep 2016 06:46:23 +0000 (14:46 +0800)]
doc: add limitations for i40e PMD

This patch adds "Limitations or Known issues" section for
i40e PMD, including two items:
1. MPLS packet classification on X710/XL710
2. 16 Byte Descriptor cannot be used on DPDK VF
3. Link down with i40e kernel driver after DPDK application exist

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agonet/mlx5: return RSS hash result in mbuf
Nélio Laranjeiro [Wed, 28 Sep 2016 12:11:18 +0000 (14:11 +0200)]
net/mlx5: return RSS hash result in mbuf

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agokni: move kernel version ifdefs to compat header
Ferruh Yigit [Mon, 26 Sep 2016 15:39:38 +0000 (16:39 +0100)]
kni: move kernel version ifdefs to compat header

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agokni: prefer uint32_t to unsigned int
Ferruh Yigit [Mon, 26 Sep 2016 15:39:37 +0000 (16:39 +0100)]
kni: prefer uint32_t to unsigned int

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agokni: update log messages
Ferruh Yigit [Mon, 26 Sep 2016 15:39:36 +0000 (16:39 +0100)]
kni: update log messages

Remove some function entrance logs and changed log level of some logs.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agokni: remove compile time debug configuration
Ferruh Yigit [Mon, 26 Sep 2016 15:39:35 +0000 (16:39 +0100)]
kni: remove compile time debug configuration

Since switched to kernel dynamic debugging it is possible to remove
compile time debug log configuration.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agokni: move functions to eliminate declarations
Ferruh Yigit [Mon, 26 Sep 2016 15:39:34 +0000 (16:39 +0100)]
kni: move functions to eliminate declarations

Function implementations kept same.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agokni: remove unnecessary messages for out of memory
Ferruh Yigit [Mon, 26 Sep 2016 15:39:33 +0000 (16:39 +0100)]
kni: remove unnecessary messages for out of memory

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agokni: update kernel logging
Ferruh Yigit [Mon, 26 Sep 2016 15:39:32 +0000 (16:39 +0100)]
kni: update kernel logging

Switch to dynamic logging functions. Depending kernel configuration this
may cause previously visible logs disappear.

How to enable dynamic logging:
https://www.kernel.org/doc/Documentation/dynamic-debug-howto.txt

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>