dpdk.git
7 years agonet/mlx5: fix counting consumed Tx descriptors
Yongseok Koh [Tue, 25 Jul 2017 16:42:16 +0000 (09:42 -0700)]
net/mlx5: fix counting consumed Tx descriptors

When advancing Tx ring index (txq->wqe_ci) in txq_scatter_v(), the title
descriptor of multi-packet send isn't taken into account if it doesn't
cross 64B boundary.

Fixes: 6cb559d67b83 ("net/mlx5: add vectorized Rx/Tx burst for x86")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: poll completion queue once per a call
Yongseok Koh [Thu, 20 Jul 2017 15:48:35 +0000 (08:48 -0700)]
net/mlx5: poll completion queue once per a call

mlx5_tx_complete() polls completion queue multiple times until it
encounters an invalid entry. As Tx completions are suppressed by
MLX5_TX_COMP_THRESH, it is waste of cycles to expect multiple
completions in a poll. And freeing too many buffers in a call can
cause high jitter.
This patch improves throughput a little.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
7 years agodoc: add 802.3ad modes in testpmd guide
Daniel Mrzyglod [Thu, 27 Jul 2017 06:41:09 +0000 (08:41 +0200)]
doc: add 802.3ad modes in testpmd guide

Add testpmd commands for setting aggregators mode in mode 4 (IEEE802.3AD).

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agotest/bonding: fix device name
Tomasz Kulasek [Wed, 26 Jul 2017 15:48:29 +0000 (17:48 +0200)]
test/bonding: fix device name

Bonding devices name must start with "net_bonding" prefix.

Fixes: 9bf4901d1a11 ("bus/vdev: remove probe with driver name option")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agotest/bonding: fix namespace of the RSS tests
Daniel Mrzyglod [Wed, 26 Jul 2017 15:44:03 +0000 (17:44 +0200)]
test/bonding: fix namespace of the RSS tests

Drivers are looking by name of the device so change namespace to proper
one.

Fixes: 43b630244e7e ("app/test: add dynamic bonding RSS configuration")
Cc: stable@dpdk.org
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agotest/bonding: fix parameters of a balance Tx
Herbert Guan [Thu, 13 Jul 2017 08:00:36 +0000 (16:00 +0800)]
test/bonding: fix parameters of a balance Tx

When test case "test_balance_l23_tx_burst_ipv4_toggle_ip_addr" is
calling balance_l23_tx_burst(), the ip_addr instead of mac_addr
should be toggled according to the test name.

Fixes: 92073ef961ee ("bond: unit tests")
Cc: stable@dpdk.org
Signed-off-by: Herbert Guan <herbert.guan@arm.com>
Acked-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agotest/bonding: fix memory corruptions
Herbert Guan [Mon, 10 Jul 2017 11:13:46 +0000 (19:13 +0800)]
test/bonding: fix memory corruptions

There were double-free problems in some test cases, which will cause
a duplicated mbuf will be added into mempool.  After double-free,
some new allocated mbuf will hold a same address and thus cause the
memory corruption.

Another minor issue is that in some test cases, allocated mbuf will
not be released after test case exits.  Hopefully these leaked mbuf
will be released by the next test case in its setup phase when
stopping the virtual pmd ports, while this do is a memory leak of
the exited test case.

To fix above 2 issues, this patch will do:
1) Release virtual pmd ports' tx queue in the clean up function
   remove_slaves_and_stop_bonded_device() of each test cases.
2) Do not release allocated mbufs for test bursts.  These mbufs
   will be released in remove_slaves_and_stop_bonded_device() when
   test case exits.

Fixes: 92073ef961ee ("bond: unit tests")

Signed-off-by: Herbert Guan <herbert.guan@arm.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agotest: fix virtual device name not set
Tomasz Kulasek [Wed, 26 Jul 2017 15:46:07 +0000 (17:46 +0200)]
test: fix virtual device name not set

Device name in device structure in virtual device used in
link_bonding_autotest is not set what causes segmentation fault when
rte_eth_dev_allocated is called.

Fixes: a1e7c17555e8 ("ethdev: use device name from device structure")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agonet/bnxt: fix setting conflicting VLAN bits
Ajit Khaparde [Sat, 29 Jul 2017 20:54:09 +0000 (15:54 -0500)]
net/bnxt: fix setting conflicting VLAN bits

Only set the vlanonly bit if vlan_nonvlan is clear. Also, allow the
VLAN table to be cleared when vlanonly is set.

Clearing the VLAN table when vlanonly is set will stop all traffic
since it requires all frames to have a VLAN tag, and that tag to be
in the zero-length table. This is still a valid use case though,
and has been seen in the wild.

Fixes: 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof")

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/i40e: fix PF notify when VF is not up
Xiaoyun Li [Fri, 28 Jul 2017 15:48:11 +0000 (23:48 +0800)]
net/i40e: fix PF notify when VF is not up

This patch stops PF from sending messages to inactive VF
and modifies VF state to active when VF reset is completed.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/i40e: fix parsing QinQ pattern
Kuba Kozak [Thu, 27 Jul 2017 07:28:22 +0000 (09:28 +0200)]
net/i40e: fix parsing QinQ pattern

Add check if o_vlan_mask and i_vlan_mask are not a NULL pointer.

Coverity issue: 143448
Coverity issue: 143449
Fixes: d37705068ee8 ("net/i40e: parse QinQ pattern")
Cc: stable@dpdk.org
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/bonding: enable in ppc64le
Gowrishankar Muthukrishnan [Mon, 31 Jul 2017 12:54:27 +0000 (18:24 +0530)]
net/bonding: enable in ppc64le

Earlier bonding pmd was disabled in default config for ppc64le.
Hence, removing it as it has been verified.

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
7 years agonet/bonding: fix link status interrupt when down
Tomasz Kulasek [Wed, 26 Jul 2017 15:53:30 +0000 (17:53 +0200)]
net/bonding: fix link status interrupt when down

RTE_ETH_EVENT_INTR_LSC callbacks are not called when all slaves goes down
in bond_ethdev_lsc_event_callback. It causes that link status change of
bonded device is not propagated up.

Fixes: deba8a2f8b0b ("net/bonding: fix link properties management")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agonet/bonding: fix crash when primary slave set
Tomasz Kulasek [Wed, 26 Jul 2017 15:50:48 +0000 (17:50 +0200)]
net/bonding: fix crash when primary slave set

rte_eth_bond_primary_set segfaults for invalid port. This patch moves
devices check before use of internal data.

Fixes: 4c42498d916d ("net/bonding: allow slaves to also be bonded devices")

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agonet/i40e: fix sync phy type by adding retry
David Hunt [Mon, 24 Jul 2017 08:48:44 +0000 (09:48 +0100)]
net/i40e: fix sync phy type by adding retry

Some phy's take longer than others to come up. Add a retry to give
more phy's a chance to come up before returning an error.

Fixes: 2209c3e2c275 ("net/i40e: avoid PCI probing failure when using bogus SFP")

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/mlx5: fix inconsistent link status query
Gowrishankar Muthukrishnan [Tue, 25 Jul 2017 13:38:07 +0000 (19:08 +0530)]
net/mlx5: fix inconsistent link status query

ETHTOOL_GLINKSETTINGS ioctl call in mlx5 pmd returns inconsistent
link status due to which any application relying on it would not
function correctly.

Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/igb: fix access bound in ethertype filter
Kuba Kozak [Tue, 25 Jul 2017 12:19:25 +0000 (14:19 +0200)]
net/igb: fix access bound in ethertype filter

Fix wrong structure type used as argument in memset() call.

Coverity issue: 147223
Coverity issue: 147227
Fixes: a8600af43738 ("net/igb: parse flow API ethertype filter")
Fixes: 22bb13410cb2 ("net/igb: create consistent filter")
Cc: stable@dpdk.org
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/bnxt: fix setting VLAN anti spoof with same value
Ajit Khaparde [Tue, 25 Jul 2017 03:32:23 +0000 (22:32 -0500)]
net/bnxt: fix setting VLAN anti spoof with same value

If the current VLAN anti spoof setting is same as the new value,
the firmware can return an error. Call the HWRM command to update
the new setting if it is different from the current value.

Fixes: 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/ixgbe: remove subdev ids from PCI device table
Leonid Myravjev [Fri, 21 Jul 2017 11:25:38 +0000 (11:25 +0000)]
net/ixgbe: remove subdev ids from PCI device table

The pci_id_ixgbe_map table has only PCI_ANY_ID for
.subvend and .subdev in all entries. Using of IXGBE_SUBDEV_ID_82599_SFP
for 'dev' is not correct. It generates the wrong PMD_INFO_STRING.
The output of the program "dpdk-pmdinfo.py" is confusing.

Signed-off-by: Leonid Myravjev <myravjev@amicon.ru>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/ixgbe: support IPv4-other type filter
Wei Zhao [Thu, 20 Jul 2017 07:25:21 +0000 (15:25 +0800)]
net/ixgbe: support IPv4-other type filter

Add support for ipv4-other type in ntuple filter.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
7 years agonet/ixgbe: fix mirror rule index overflow
Qi Zhang [Fri, 21 Jul 2017 08:56:37 +0000 (16:56 +0800)]
net/ixgbe: fix mirror rule index overflow

Mirror rule id should not exceed the boundary defined by
IXGBE_MAX_MIRROR_RULES.

Fixes: fe3a45fd4104 ("ixgbe: add VMDq support")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
7 years agonet/bnxt: free filter before reusing it
Ajit Khaparde [Fri, 21 Jul 2017 03:22:33 +0000 (22:22 -0500)]
net/bnxt: free filter before reusing it

This patch sends the HWRM command to free a filter in the hardware,
before using it again.

Fixes: f92735db1e4c ("net/bnxt: add L2 filter alloc/init/free")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnxt: check invalid L2 filter id
Ajit Khaparde [Fri, 21 Jul 2017 03:22:32 +0000 (22:22 -0500)]
net/bnxt: check invalid L2 filter id

Add code to check for invalid filter_id in bnxt_hwrm_clear_filter

Fixes: f92735db1e4c ("net/bnxt: add L2 filter alloc/init/free")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnxt: fix VLAN antispoof configuration code
Ajit Khaparde [Fri, 21 Jul 2017 03:22:31 +0000 (22:22 -0500)]
net/bnxt: fix VLAN antispoof configuration code

We are wrongly using a Rx side HWRM command set_rx_mask to configure
VLAN anti-spoof. This being a Tx side feature, this patch
tries to fix it.

Since the HWRM command to do it is available only in
the newer firmware versions, the patch verifies the firmware
version before attempting to send the HWRM command to
the firmware.

Fixes: 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof")

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnxt: reset VF stats during initialization
Ajit Khaparde [Fri, 21 Jul 2017 03:22:30 +0000 (22:22 -0500)]
net/bnxt: reset VF stats during initialization

This patch resets the VF stats during initialization

Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnxt: fix set link config
Ajit Khaparde [Fri, 21 Jul 2017 03:22:29 +0000 (22:22 -0500)]
net/bnxt: fix set link config

remove the unnecessary rte_delay in bnxt_set_hwrm_link_config

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnxt: fix vnic cleanup
Ajit Khaparde [Fri, 21 Jul 2017 03:22:28 +0000 (22:22 -0500)]
net/bnxt: fix vnic cleanup

Check if the vnic_id and rss_rule is not invalid before passing it
to the firmware to cleanup the VNIC. Log a message if the vnic_id
is invalid.

Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnxt: fix crash
Ajit Khaparde [Fri, 21 Jul 2017 03:22:27 +0000 (22:22 -0500)]
net/bnxt: fix crash

Fix use of local variable to avoid segfault.
cnt was incorrectly tested and decremented in the loop that removes
a VLAN from the table.

Fixes: 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof")

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/bnxt: fix log levels for non error conditions
Ajit Khaparde [Fri, 21 Jul 2017 03:22:26 +0000 (22:22 -0500)]
net/bnxt: fix log levels for non error conditions

1) handle_async_event is a DEBUG level log message.
2) Log "Unable to get default VNIC for VF %d" at INFO level.

Fixes: 36735a932ca7 ("net/bnxt: support set VF QOS and MAC anti spoof")

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
7 years agonet/i40e: fix link down and negotiation
Jeff Guo [Fri, 21 Jul 2017 03:07:04 +0000 (11:07 +0800)]
net/i40e: fix link down and negotiation

Enable the functions set link down and set link up in i40e by check
phy_type, and fix the issue of auto negotiation failed in XXV710 when
bind kernel driver after unbind from DPDK driver by modify the speed
setting distinguish from set link up and down. With this fix, if unbind
DPDK to bind kernel driver, no need to set auto negotiation and ifconfig
up anymore, remove the part from doc.

Fixes: ca7e599d4506 ("net/i40e: fix link management")
Fixes: 2f1e22817420 ("i40e: skip link control as firmware workaround")
Fixes: 6e145fcc754b ("i40e: support autoneg or force link speed")
Cc: stable@dpdk.org
Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/ixgbe: fix 82599ES flow API port check
Wei Zhao [Thu, 20 Jul 2017 07:25:41 +0000 (15:25 +0800)]
net/ixgbe: fix 82599ES flow API port check

This NIC type port check should use port index
not mask for 82599ES.

Fixes: d9347d254008 ("net/ixgbe: support 82599ES SCTP packet drop action")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
7 years agonet/ixgbe: fix SCTP port support
Qi Zhang [Thu, 20 Jul 2017 08:19:50 +0000 (16:19 +0800)]
net/ixgbe: fix SCTP port support

Only x550 family support SCTP port in FDIR filter, so
add this limitation when parse consistent API.

Fixes: 11777435c727 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
7 years agonet/i40e: fix TM hierarchy commit check
Wenzhuo Lu [Wed, 26 Jul 2017 14:43:39 +0000 (22:43 +0800)]
net/i40e: fix TM hierarchy commit check

If there's no Traffic Management node added. Not
necessary to check if TM is committed.

Fixes: cac29c3c00a4 ("net/i40e: support committing TM hierarchy")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agonet/ixgbe: fix TM hierarchy commit check
Wenzhuo Lu [Wed, 26 Jul 2017 14:54:13 +0000 (22:54 +0800)]
net/ixgbe: fix TM hierarchy commit check

If there's no Traffic Management node added,
not necessary to check if TM is committed.

Fixes: 5713ade69776 ("net/ixgbe: support committing TM hierarchy")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agonet/virtio: fix Rx interrupt setup
Jiayu Hu [Mon, 31 Jul 2017 07:56:44 +0000 (15:56 +0800)]
net/virtio: fix Rx interrupt setup

When use rte_eth_dev_configure() to enable rx queue interrupt for virtio
devices, virtio_init_device() isn't called to set up the interrupt
environment, which causes rx queue interrupt setup failed. This patch is
to fix this issue.

Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
Cc: stable@dpdk.org
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
7 years agonet/virtio: fix MAC address read
Jianfeng Tan [Fri, 28 Jul 2017 23:01:14 +0000 (23:01 +0000)]
net/virtio: fix MAC address read

When virtio-net devices are bound to uio_pci_generic, we get
the wrong mac addr by virtio PMD. The wrong mac addr is a
addr that is 4-byte left shift of the correct addr.

It's a regression bug introduced by the cleanup patch below.
The condition of if we set use_msix should be if msix is
actually enabled. Only to check if there is a capability list
is not enough. For example, binding a transitional device
to uio_pci_device would trigger the wrong assignment of use_msix.

To correct that, we also check the flags of msix capability to
make sure it's enabled.

Fixes: ee1843bd8907 ("net/virtio: remove redundant MSI-X detection")
Cc: stable@dpdk.org
Reported-by: Vipin Varghese <vipin.varghese@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
7 years agombuf: fix doxygen comment of bulk alloc
Pablo de Lara [Wed, 26 Jul 2017 04:20:05 +0000 (05:20 +0100)]
mbuf: fix doxygen comment of bulk alloc

When calling rte_pktmbuf_alloc_bulk, if there are
not enough objects in the mempool, it returns
a negative value, which should be reflected
in the Doxygen comments.

Fixes: 9ec201f5d6e7 ("mbuf: provide bulk allocation")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agoethdev: remove duplicate interrupt handle copy
Zhiyong Yang [Fri, 28 Jul 2017 08:10:14 +0000 (16:10 +0800)]
ethdev: remove duplicate interrupt handle copy

The code eth_dev->intr_handle = &dev->intr_handle; has duplicate code
in the function rte_eth_copy_pci_info(), remove it here.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agoethdev: fix invalid length write on detach
Gaetan Rivet [Mon, 31 Jul 2017 13:40:07 +0000 (15:40 +0200)]
ethdev: fix invalid length write on detach

The name of a device is copied in a provided buffer within
rte_eth_dev_detach(). The current sizeof is done on a pointer instead of
the intended array usually pointed to.

The name field of an rte_device is not assured however to point an
rte_devargs name field. The almost correct length to base this copy over
is thus RTE_DEV_NAME_MAX_LEN.

Almost correct, because unfortunately this function does not allow the
user to pass down a size parameter for the buffer it is meant to write.
This API should be fixed, it is broken by design.

Fixes: a1e7c17555e8 ("ethdev: use device name from device structure")
Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agodev: fix vdev attach after PCI mismatch
Gaetan Rivet [Mon, 31 Jul 2017 12:58:29 +0000 (14:58 +0200)]
dev: fix vdev attach after PCI mismatch

If the device is a vdev, the parsing for PCI will fail with -EFAULT,
and will not try to check for a vdev.

Checking against error values returned by rte_eal_hotplug_add is
inelegant and prone to mistakes. Additionally, the failed PCI probe
prints a useless error that would throw off unsuspecting users:

   ERROR: failed to parse device "pci:net_ring0"

This error is printed when attempting to probe a virtual device first
with the PCI bus (here, a net_ring0 device).

Use the relevant functions to infer the intended bus. The limitation to
PCI or vdev device is kept for strict API compatibility. Thus the PCI
probe attempt is avoided and the right function is directly called.

Fixes: 1c35f666df07 ("dev: fix attach proceeding with vdev on PCI success")

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agoethdev: fix flow rule copy functions
Matan Azrad [Mon, 24 Jul 2017 13:47:33 +0000 (16:47 +0300)]
ethdev: fix flow rule copy functions

The corrupted code checks only RAW flow item type special case for
returning its size but doesn't deal with any other flow item type
and returns 0 for all the others.

This bug leaves the flow descriptor empty for non RAW types.

The fix takes the correct size to any regular types from appropriate
array.

The same issue, with a similar fix, is in flow action size method
which deals only with RSS special type.

This bug was already present in the original code taken from testpmd.

Fixes: 18da437b5f63 ("ethdev: add flow rule copy function")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agoapp/testpmd: fix flow rule copy functions
Matan Azrad [Mon, 24 Jul 2017 13:47:32 +0000 (16:47 +0300)]
app/testpmd: fix flow rule copy functions

The corrupted code checks only RAW flow item type special case for
returning its size but doesn't deal with any other flow item type
and returns 0 for all the others.

This bug leaves the flow descriptor empty for non RAW types.

The fix takes the correct size to any regular types from appropriate
array.

The same issue, with a similar fix, is in flow action size method which
deals only with RSS special type.

Fixes: 938a184a1870 ("app/testpmd: implement basic support for flow API")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agoapp/testpmd: add log on device detach failures
Gaetan Rivet [Wed, 26 Jul 2017 13:35:56 +0000 (15:35 +0200)]
app/testpmd: add log on device detach failures

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx5: advertise the detach capability
Gaetan Rivet [Wed, 26 Jul 2017 13:35:55 +0000 (15:35 +0200)]
net/mlx5: advertise the detach capability

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: advertise the detach capability
Gaetan Rivet [Wed, 26 Jul 2017 13:35:54 +0000 (15:35 +0200)]
net/mlx4: advertise the detach capability

This PMD supports hotplug, it is able to be detached.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agoethdev: remove useless check in detach capability
Gaetan Rivet [Wed, 26 Jul 2017 13:35:53 +0000 (15:35 +0200)]
ethdev: remove useless check in detach capability

This capability is not bound to which driver is handling the device, but
whether the bus is able to unplug it.

This check is already performed in rte_eal_dev_detach, there is no need
to do it in the ethdev layer.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agoethdev: fix device state on detach
Gaetan Rivet [Wed, 26 Jul 2017 13:35:52 +0000 (15:35 +0200)]
ethdev: fix device state on detach

The device state should be handled by the ethdev layer when possible.
Applications should not have to do it.

Not setting the state to UNUSED will make the port_id of the device
valid for all ethdev API functions, usually resulting in segfault.

Fixes: 284c908cc588 ("app/testpmd: request device removal interrupt")
Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Tested-by: Shachar Beiser <shacharbe@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agodev: fix attach proceeding with vdev on PCI success
Gaetan Rivet [Wed, 26 Jul 2017 11:52:22 +0000 (13:52 +0200)]
dev: fix attach proceeding with vdev on PCI success

When rte_eal_hotplug_add() successfully probes a PCI device,
the return value is zero.
The check afterward only returns on error different from -EINVAL.
It should return also on success, as there is no need to
attempt probing the device with vdev.

Fixes: 0bba9e605048 ("eal: use new hotplug API in attach")
Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agolog: get level for dynamic types
Chas Williams [Sat, 22 Jul 2017 20:07:33 +0000 (16:07 -0400)]
log: get level for dynamic types

This function wasn't provided in the original commit.

Fixes: 4f0981e6ec6c ("eal: deprecate log functions")
Cc: stable@dpdk.org
Signed-off-by: Chas Williams <ciwillia@brocade.com>
7 years agoeal/arm64: fix poly64/128 compilation with GCC < 4.9
Herbert Guan [Thu, 13 Jul 2017 02:16:42 +0000 (10:16 +0800)]
eal/arm64: fix poly64/128 compilation with GCC < 4.9

Use built-in data types for unsupported poly64/128 types
for GCC version lower than 4.9.0

Fixes: 3c4b4024c225 ("arch/arm: add vcopyq_laneq_u32 for old gcc")
Cc: stable@dpdk.org
Signed-off-by: Herbert Guan <herbert.guan@arm.com>
7 years agogro: fix bitwise overflow
Jiayu Hu [Mon, 31 Jul 2017 01:43:24 +0000 (09:43 +0800)]
gro: fix bitwise overflow

When try to get GRO types, expression "1 << i" with type "int" may
overflow. This patch is to fix this issue.

Coverity issue: 158664
Fixes: e996506a1c07 ("lib/gro: add Generic Receive Offload API framework")

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
7 years agoeal: disable NUMA related warnings on non-NUMA systems
Hemant Agrawal [Mon, 24 Jul 2017 09:20:27 +0000 (14:50 +0530)]
eal: disable NUMA related warnings on non-NUMA systems

Disable multiple NUMA warnings on non-NUMA systems.

"EAL: eal_parse_sysfs_value(): cannot open sysfs value
/sys/bus/pci/devices/0000:00:00.0/numa_node
EAL: numa_node is invalid or not present. Set it 0 as default
EAL: cannot open /proc/self/numa_maps, consider that all memory is
in socket_id 0"

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agodoc: update DPAA2 net PMD guide
Hemant Agrawal [Mon, 24 Jul 2017 07:23:49 +0000 (12:53 +0530)]
doc: update DPAA2 net PMD guide

added features, limitations and copyright.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agodoc: add DPAA2 net PMD enhancements to release notes
Hemant Agrawal [Mon, 24 Jul 2017 07:23:48 +0000 (12:53 +0530)]
doc: add DPAA2 net PMD enhancements to release notes

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agodoc: update DPAA2 eventdev extra path
Hemant Agrawal [Mon, 24 Jul 2017 07:23:47 +0000 (12:53 +0530)]
doc: update DPAA2 eventdev extra path

The DPDK helper for NXP devices is not dpdk-extras

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agodoc: add DPAA2 eventdev to release notes
Hemant Agrawal [Mon, 24 Jul 2017 07:23:46 +0000 (12:53 +0530)]
doc: add DPAA2 eventdev to release notes

announcing the addition of DPAA2 eventdev

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agonet/dpaa2: enable Tx congestion state check
Hemant Agrawal [Mon, 24 Jul 2017 07:31:46 +0000 (13:01 +0530)]
net/dpaa2: enable Tx congestion state check

For larger packet size congestion is observed on Tx Queues.
This patch enables Tx Queue congestion state check support.
If congested, try to resend the packet few times.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agomaintainers: update for ARMv8 crypto PMD
Jerin Jacob [Sun, 30 Jul 2017 11:58:57 +0000 (17:28 +0530)]
maintainers: update for ARMv8 crypto PMD

Update the maintainers as Zbigniew no longer working for Cavium.
Thanks to Zbigniew for his support and development of
armv8 crypto driver.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agocrypto/armv8: fix HMAC supported key sizes
Srisivasubramanian S [Sun, 30 Jul 2017 11:23:01 +0000 (16:53 +0530)]
crypto/armv8: fix HMAC supported key sizes

For HMAC algorithms (SHAx-HMAC), the supported
key sizes are not a fixed value, but a range between
1 and the block size.

Fixes: 169ca3db550c ("crypto/armv8: add PMD optimized for ARMv8 processors")
Cc: stable@dpdk.org
Signed-off-by: Srisivasubramanian S <ssrinivasan@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agocrypto/armv8: fix authentication session configuration
Srisivasubramanian S [Sun, 30 Jul 2017 11:23:00 +0000 (16:53 +0530)]
crypto/armv8: fix authentication session configuration

For key sizes greater than digest length, pad with zero rather than
computing hash of the key itself.

Fixes: 169ca3db550c ("crypto/armv8: add PMD optimized for ARMv8 processors")
Cc: stable@dpdk.org
Signed-off-by: Srisivasubramanian S <ssrinivasan@caviumnetworks.com>
7 years agodoc: add cryptodev sample code
Pablo de Lara [Fri, 28 Jul 2017 06:02:45 +0000 (07:02 +0100)]
doc: add cryptodev sample code

In order to illustrate in a simple way how to use
the cryptodev API to perform a basic crypto operation,
sample code has been added in the Programmer's Guide.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agoapp/crypto-perf: fix CSV output
Pablo de Lara [Thu, 27 Jul 2017 23:33:13 +0000 (00:33 +0100)]
app/crypto-perf: fix CSV output

When using CSV, the output of the throughput performance numbers
was not correct, representing decimal numbers incorrectly.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agoapp/crypto-perf: add pool size error message
Pablo de Lara [Fri, 28 Jul 2017 02:15:21 +0000 (03:15 +0100)]
app/crypto-perf: add pool size error message

If the crypto operation pool size is too small,
the pool might run out of operations, if all the crypto operations
are still being used and have not been freed.
To inform the user about this, the application should display
an error message, asking the user to increase the pool size
through the app parameters.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agodoc: complete crypto sample command line
Pablo de Lara [Wed, 26 Jul 2017 00:59:59 +0000 (01:59 +0100)]
doc: complete crypto sample command line

Documentation of some virtual crypto PMDs have a sample command line
to show how to initialize the device on a specific application,
L2fwd-crypto.

This was meant to be used as a reference, but these lines themselves
do not work, as the sample application used required more parameters,
which are added in this commit to have a fully functional example.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agocryptodev: deprecate vdev create function
Jan Blunck [Wed, 12 Jul 2017 20:15:37 +0000 (16:15 -0400)]
cryptodev: deprecate vdev create function

The function rte_cryptodev_create_vdev is an alias
for rte_vdev_init() which is scheduled to move out of the
rte_eal library. Lets deprecate this function to be able to
remove it from the cryptodev library in 17.11.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
7 years agocryptodev: fix doxygen comment of bulk alloc
Pablo de Lara [Wed, 26 Jul 2017 04:27:12 +0000 (05:27 +0100)]
cryptodev: fix doxygen comment of bulk alloc

When calling rte_crypto_op_bulk_alloc, the function may
return either a 0, if not enough objects are available
in the mempool or the number of operations requested,
it there are enough available. However, the Doxygen comments
were not matching these two cases.

Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agodoc: fix missing section underline in crypto guide
Pablo de Lara [Thu, 27 Jul 2017 01:25:08 +0000 (02:25 +0100)]
doc: fix missing section underline in crypto guide

Fixes: b59502a5e3d0 ("cryptodev: add AEAD parameters in crypto operation")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agodoc: fix l2fwd-crypto sample code
Pablo de Lara [Tue, 25 Jul 2017 23:33:29 +0000 (00:33 +0100)]
doc: fix l2fwd-crypto sample code

L2fwd-crypto app was modified with various changes
in its code. The application user guide contains
some code snippets that needed to be updated.

Fixes: 2661f4fbe93d ("examples/l2fwd-crypto: add AEAD parameters")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agocryptodev: fix session init return value
Pablo de Lara [Tue, 25 Jul 2017 06:16:50 +0000 (07:16 +0100)]
cryptodev: fix session init return value

When calling rte_cryptodev_sym_session_init(),
if there was an error, it returned -1, instead
of returning the specific error code, which can
be valuable for the application for error handling.

Fixes: b3bbd9e5f265 ("cryptodev: support device independent sessions")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocrypto/qat: fix SHA384-HMAC block size
Pablo de Lara [Tue, 25 Jul 2017 06:33:32 +0000 (07:33 +0100)]
crypto/qat: fix SHA384-HMAC block size

Block size of SHA384-HMAC algorithm is 128 bytes,
and not 64 bytes.

Fixes: d905ee32d0dc ("crypto/qat: add aes-sha384-hmac capability")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocrypto/qat: fix HMAC supported key sizes
Pablo de Lara [Tue, 25 Jul 2017 05:24:57 +0000 (06:24 +0100)]
crypto/qat: fix HMAC supported key sizes

For HMAC algorithms (MD5-HMAC, SHAx-HMAC), the supported
key sizes are not a fixed value, but a range between
1 and the block size.

Fixes: 26c2e4ad5ad4 ("cryptodev: add capabilities discovery")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocrypto/openssl: fix HMAC supported key sizes
Pablo de Lara [Tue, 25 Jul 2017 05:24:56 +0000 (06:24 +0100)]
crypto/openssl: fix HMAC supported key sizes

For HMAC algorithms (MD5-HMAC, SHAx-HMAC), the supported
key sizes are not a fixed value, but a range between
1 and the block size.

Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agocrypto/aesni_mb: fix HMAC supported key sizes
Pablo de Lara [Tue, 25 Jul 2017 05:24:55 +0000 (06:24 +0100)]
crypto/aesni_mb: fix HMAC supported key sizes

For HMAC algorithms (MD5-HMAC, SHAx-HMAC), the supported
key sizes are not a fixed value, but a range between
1 and the block size.

Fixes: 26c2e4ad5ad4 ("cryptodev: add capabilities discovery")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agocrypto/dpaa2_sec: add check for gcc toolchain
Akhil Goyal [Wed, 26 Jul 2017 11:27:37 +0000 (16:57 +0530)]
crypto/dpaa2_sec: add check for gcc toolchain

Fixes: 6a95466d78de ("crypto/dpaa2_sec: fix build with gcc 7.1")

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocrypto/dpaa2_sec: fix HMAC supported key sizes
Akhil Goyal [Thu, 27 Jul 2017 11:54:08 +0000 (17:24 +0530)]
crypto/dpaa2_sec: fix HMAC supported key sizes

For HMAC algorithms (MD5-HMAC, SHAx-HMAC), the supported
key sizes are not a fixed value, but a range between
1 and the block size.

Fixes: 623326dded3a ("crypto/dpaa2_sec: introduce poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agodoc: support new ZUC library version
Pablo de Lara [Tue, 25 Jul 2017 07:16:45 +0000 (08:16 +0100)]
doc: support new ZUC library version

A new version of the LibSSO ZUC library has been released.
This version includes shared library support and bug fixes.

This commit extends the instructions to install and initialize
the PMD with the new library, enabling also the PMD to be
compiled as a shared library.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agocrypto/openssl: fix typo
Pablo de Lara [Tue, 25 Jul 2017 09:06:32 +0000 (10:06 +0100)]
crypto/openssl: fix typo

Fixes: b79e4c00af0e ("cryptodev: use AES-GCM/CCM as AEAD algorithms")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agocrypto/dpaa2_sec: reduce init log prints
Shreyansh Jain [Mon, 24 Jul 2017 07:31:47 +0000 (13:01 +0530)]
crypto/dpaa2_sec: reduce init log prints

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
7 years agoversion: 17.08-rc2
Thomas Monjalon [Fri, 21 Jul 2017 16:33:46 +0000 (19:33 +0300)]
version: 17.08-rc2

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agodoc: remove driver interface header from API index
Thomas Monjalon [Fri, 14 Jul 2017 14:45:25 +0000 (16:45 +0200)]
doc: remove driver interface header from API index

The file rte_flow_driver.h is a driver interface,
thus it should not be listed in the API index.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
7 years agopci: move NUMA node check from scan to probe
Sergio Gonzalez Monroy [Fri, 21 Jul 2017 09:11:19 +0000 (10:11 +0100)]
pci: move NUMA node check from scan to probe

Commit 8a04cb612589 ("pci: set default numa node for broken systems")
added logic to default to NUMA node 0 when sysfs numa_node information
was wrong or not available.

Unfortunately there are many devices with wrong NUMA node information
that DPDK does not care about but still show warnings for them.

Instead, only check for invalid NUMA node information for devices
managed by the DPDK.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
7 years agodoc: notify ethdev callback process API change
Bernard Iremonger [Wed, 12 Jul 2017 09:25:01 +0000 (10:25 +0100)]
doc: notify ethdev callback process API change

The _rte_eth_dev_callback_process function has been modified.
The return value has been changed form void to int and an
extra parameter "void *ret_param" has been added.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
7 years agogro: fix doxygen
Jiayu Hu [Tue, 11 Jul 2017 06:18:43 +0000 (14:18 +0800)]
gro: fix doxygen

This patch updates GRO API comments to generate correct
API documentation by doxygen.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
7 years agoexamples/qos_sched: fix build for less lcores
Hemant Agrawal [Wed, 19 Jul 2017 08:13:10 +0000 (13:43 +0530)]
examples/qos_sched: fix build for less lcores

APP_MAX_LCORES is hardcoded as 64.
This will cause build err when RTE_MAX_LCORE is less then 64.

"args.c:127:22: error: iteration 8 invokes undefined behavior
[-Werror=aggressive-loop-optimizations]
   if (cfg->lcore_role[i] == ROLE_RTE)
       ~~~~~~~~~~~~~~~^~~
args.c:126:2: note: within this loop
  for (i = 0; i < APP_MAX_LCORE; i++) {"

Fixes: d52b5e735aa3 ("examples/qos_sched: fix lcore limit")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agoexamples/load_balancer: fix build for less lcores
Hemant Agrawal [Wed, 19 Jul 2017 08:19:35 +0000 (13:49 +0530)]
examples/load_balancer: fix build for less lcores

load_balancer app can also work for lower number of cores.
Limit the cores Worker and IO cores to 16 as defined in original
App. Otherwise use the actual number of lcores as MAX.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agoapp/testpmd: fix bonding initialization
Michal Jastrzebski [Thu, 13 Jul 2017 09:48:32 +0000 (11:48 +0200)]
app/testpmd: fix bonding initialization

when creating a bond device in testpmd, a name for a device must meet
the correct convention described in the documentation:
The device name must start with the net_bonding prefix
followed by numbers or letters.
Change for ALB mempool allocation - mem_name was too long.

Fixes: 9bf4901d1a11 ("bus/vdev: remove probe with driver name option")
Cc: stable@dpdk.org
Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agomempool/dpaa2: fix freeing bp list
Hemant Agrawal [Thu, 22 Jun 2017 12:48:08 +0000 (18:18 +0530)]
mempool/dpaa2: fix freeing bp list

The dpaa2_bp_list is being allocated using "rte_malloc",
but the free is done using "free". Fixing it to use
"rte_free".

Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
7 years agomempool/dpaa2: fix error code for allocation failure
Hemant Agrawal [Thu, 22 Jun 2017 12:48:07 +0000 (18:18 +0530)]
mempool/dpaa2: fix error code for allocation failure

In case the alloc api is not able to allocate the required
number of buffer, it can return '0', which will not indicate
the failure to the calling function.
This patch fix the return value to indicate the failure.

Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
7 years agomempool/dpaa2: allocate pool data dynamically
Hemant Agrawal [Thu, 13 Jul 2017 14:18:48 +0000 (19:48 +0530)]
mempool/dpaa2: allocate pool data dynamically

In order to support multiprocess applications, pool data is to be
allocated on dynamic memory instead of existing usages of global
variable.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
7 years agodoc: fix literal block in testpmd guide
Daniel Mrzyglod [Thu, 20 Jul 2017 12:17:17 +0000 (14:17 +0200)]
doc: fix literal block in testpmd guide

There were mising :: so file was parsed in wrong way

Fixes: c735b831b0c1 ("app/testpmd: add cmd for dedicated LACP Rx/Tx queues")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
7 years agoigb_uio: issue FLR during open and release of device file
Shijith Thotton [Fri, 7 Jul 2017 11:13:51 +0000 (16:43 +0530)]
igb_uio: issue FLR during open and release of device file

Set UIO info device file operations open and release. Call pci reset
function inside open and release to clear device state at start and end.
Copied this behaviour from vfio_pci kernel module code. With this patch,
it is not mandatory to issue FLR by PMD's during init and close.

Bus master enable and disable are added in open and release respectively
to take care of device DMA.

Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Gregory Etelson <gregory@weka.io>
7 years agoapp/testpmd: fix token matching in flow command
Adrien Mazarguil [Mon, 10 Jul 2017 12:09:36 +0000 (14:09 +0200)]
app/testpmd: fix token matching in flow command

While matching user input against a token name or any other fixed string,
comparison stops at the end of user input if shorter (e.g. "foo" matches
token name "foobar").

Although the unintended consequence of this behavior allows users to
abbreviate command names and various parameters yet generate valid
commands, the parser was not designed to support this and does not prevent
ambiguous tokens.

For instance, entering "i" for a pattern item matches "ipv4", "ipv6" and
"icmp" then defaults to one of them in an unspecified manner.

Prevent this behavior by taking the length of fixed strings into account.

Fixes: 19c90af6285c ("app/testpmd: add flow command")
Fixes: 5ac3502ed1be ("app/testpmd: add flow query command")
Fixes: abc3d81aca1b ("app/testpmd: add item raw to flow command")
Fixes: 05d34c6e9d2c ("app/testpmd: add queue actions to flow command")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agocmdline: fix dynamic tokens interface
Adrien Mazarguil [Mon, 10 Jul 2017 12:09:35 +0000 (14:09 +0200)]
cmdline: fix dynamic tokens interface

Support for dynamic tokens was added in order to implement the flow command
in testpmd, for which static tokens were not versatile enough due to the
large number of possible parameter combinations.

However, due to its reliance on a temporary array to store dynamic tokens,
this interface suffers from various limitations that need to be addressed
in order to implement more commands in the future:

- The maximum number of dynamic tokens is determined at compilation time
  (CMDLINE_PARSE_DYNAMIC_TOKENS). The larger this value, the more stack
  space is wasted (one pointer per potential token, i.e. 1kB of stack space
  on 64-bit architectures with the default value).

- This temporary array is actually a cache in which entries already present
  are not regenerated. This behavior is not documented, which makes dynamic
  tokens practically unusable by applications as they do not know which
  token is current.

- The cache does not really reduce the number of function calls needed to
  retrieve tokens, it was mainly deemed useful to provide context about
  other tokens to the generator callback.

- Like testpmd, most users will likely use repeated pointers to a fixed
  token header structure (cmdline_token_hdr_t), with internal context-aware
  callbacks that do not need to look at other entries; knowing the index of
  the current token is enough.

Getting rid of the temporary array and properly documenting usage of the
token generator callback greatly simplifies this interface.

Fixes: 4fffc05a2b2c ("cmdline: support dynamic tokens")
Fixes: 19c90af6285c ("app/testpmd: add flow command")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agocmdline: fix dynamic tokens initialization
Adrien Mazarguil [Mon, 10 Jul 2017 12:09:34 +0000 (14:09 +0200)]
cmdline: fix dynamic tokens initialization

To avoid redundant calls to the token-generating function and provide it
with helpful context, a temporary fixed-size array allocated on the stack
of cmdline_parse() and cmdline_complete() keeps the address of preceding
tokens for the command instance being processed (cmdline_parse_inst_t).

Like the static tokens array in cmdline_parse_inst_t, it must be
NULL-terminated, however this is not properly enforced as it is initialized
once at the beginning of each function and a NULL terminator is never
appended once replaced with generated tokens.

When several commands rely on dynamic tokens, subsequent ones inherit an
already initialized array whose tokens are not regenerated, which causes
various issues such as mixed and repeated tokens from the first command.

Enforcing NULL termination of the dynamic tokens array and reinitializing
its first entry at each iteration solves these issues. Doing so is also
less expensive than a full memset() at each iteration.

Fixes: 4fffc05a2b2c ("cmdline: support dynamic tokens")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agonet/failsafe: fix build on FreeBSD 10 with GCC 4.8
Gaetan Rivet [Thu, 20 Jul 2017 12:27:53 +0000 (14:27 +0200)]
net/failsafe: fix build on FreeBSD 10 with GCC 4.8

ctype.h is not compilable in BSD 10 on GCC 4.8 in C11 mode.

  CC failsafe.o
In file included from /usr/include/_ctype.h:94:0,
                 from /usr/include/ctype.h:46,
                 from /root/dpdk.org/build/include/rte_common.h:50,
                 from /root/dpdk.org/build/include/rte_memory.h:57,
                 from /root/dpdk.org/build/include/rte_malloc.h:45,
                 from /root/dpdk.org/drivers/net/failsafe/failsafe.c:35:
/usr/include/runetype.h:92:22: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'const'
 extern _Thread_local const _RuneLocale *_ThreadRuneLocale;
                      ^
/usr/include/runetype.h: In function '__getCurrentRuneLocale':
/usr/include/runetype.h:96:6: error: '_ThreadRuneLocale' undeclareds
(first use in this function)
  if (_ThreadRuneLocale)
      ^

The fix is to put GCC in gnu99 mode instead.

Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD")

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
7 years agoexamples/l2fwd-crypto: add option to update MAC address
Kuba Kozak [Wed, 19 Jul 2017 12:19:42 +0000 (14:19 +0200)]
examples/l2fwd-crypto: add option to update MAC address

This patch adds a new option to enable/disable the
MAC addresses updating done at forwarding time: --[no-]mac-updating

By default, MAC address updating remains enabled, to keep consistency
with previous usage.

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agocrypto/scheduler: fix multicore reordering
Kirill Rybalchenko [Tue, 18 Jul 2017 10:35:38 +0000 (11:35 +0100)]
crypto/scheduler: fix multicore reordering

Operations can be dequeued from the reordering ring only after they
were dequeued from the crypto pmd with rte_cryptodev_dequeue_burst()
function. It is not correct to dequeue them when status just changed
from RTE_CRYPTO_OP_STATUS_NOT_PROCESSED to any other value, as the
operations still can be processed by crypto pmd internally.
Now multicore scheduler workers mark status of all dequeued from
crypto pmd operations with CRYPTO_OP_STATUS_BIT_COMPLETE bit set.
Scheduler will dequeue crypto operations from reordering ring only
when this status bit is set. Prior to put this operation to output
buffer, scheduler clears this bit, so the application gets
unmodified status from crypto pmd.

Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode")

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agocryptodev: remove crypto operation status value
Kirill Rybalchenko [Mon, 17 Jul 2017 15:25:00 +0000 (16:25 +0100)]
cryptodev: remove crypto operation status value

Crypto operation status RTE_CRYPTO_OP_STATUS_ENQUEUED is removed
from rte_crypto.h as it is not needed for crypto operation processing.
This status value is redundant to RTE_CRYPTO_OP_STATUS_NOT_PROCESSED value
and it was not intended to be part of public API.

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agocrypto/qat: fix session initialization
Pablo de Lara [Wed, 19 Jul 2017 04:59:02 +0000 (05:59 +0100)]
crypto/qat: fix session initialization

When creating a session, if there is a failure when
setting some of the parameters, QAT was not propagating
the error to the session initialization function.
Therefore, it was reporting a success, when it should
be report a failure.

Fixes: b3bbd9e5f265 ("cryptodev: support device independent sessions")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoapp/crypto-perf: stop crypto devices after test
Kirill Rybalchenko [Wed, 14 Jun 2017 08:44:04 +0000 (09:44 +0100)]
app/crypto-perf: stop crypto devices after test

Call of rte_cryptodev_stop() function from test destructors
is added.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org
Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>