dpdk.git
5 years agodoc: announce API change for cryptodev sym session
Konstantin Ananyev [Thu, 11 Oct 2018 14:20:24 +0000 (15:20 +0100)]
doc: announce API change for cryptodev sym session

Below are details and reasoning for proposed changes.

1.rte_cryptodev_sym_session_init()/ rte_cryptodev_sym_session_clear()
  operate based on cytpodev device id, though inside
  rte_cryptodev_sym_session device specific data is addressed
  by driver id (not device id).
  That creates a problem with current implementation when we have
  two or more devices with the same driver used by the same session.
  Consider the following example:

  struct rte_cryptodev_sym_session *sess;
  rte_cryptodev_sym_session_init(dev_id=X, sess, ...);
  rte_cryptodev_sym_session_init(dev_id=Y, sess, ...);
  rte_cryptodev_sym_session_clear(dev_id=X, sess);

  After that point if X and Y uses the same driver,
  then sess can't be used by device Y any more.
  The reason for that - driver specific (not device specific)
  data per session, plus there is no information
  how many device instances use that data.
  Probably the simplest way to deal with that issue -
  add a reference counter per each driver data.

2.rte_cryptodev_sym_session_set_user_data() and
  rte_cryptodev_sym_session_get_user_data() -
  with current implementation there is no defined way for the user to
  determine what is the max allowed size of the private data.
  rte_cryptodev_sym_session_set_user_data() just blindly copies
  user provided data without checking memory boundaries violation.
  To overcome that issue propose to add 'uint16_t priv_size' into
  rte_cryptodev_sym_session structure.

3.rte_cryptodev_sym_session contains an array of variable size for
  driver specific data.
  Though number of elements in that array is determined by static
  variable nb_drivers, that could be modified by
  rte_cryptodev_allocate_driver().
  That construction seems to work ok so far, as right now users register
  all their PMDs at startup, though it doesn't mean that it would always
  remain like that.
  To make it less error prone propose to add 'uint16_t nb_drivers'
  into the rte_cryptodev_sym_session structure.
  At least that allows related functions to check that provided
  driver id wouldn't overrun variable array boundaries,
  again it allows to determine size of already allocated session
  without accessing global variable.

4.#2 and #3 above implies that now each struct rte_cryptodev_sym_session
  would have sort of readonly type data (init once at allocation time,
  keep unmodified through session life-time).
  That requires more changes in current cryptodev implementation:
  Right now inside cryptodev framework both rte_cryptodev_sym_session
  and driver specific session data are two completely different sctrucures
  (e.g. struct cryptodev_sym_session and struct null_crypto_session).
  Though current cryptodev implementation implicitly assumes that driver
  will allocate both of them from within the same mempool.
  Plus this is done in a manner that they override each other fields
  (reuse the same space - sort of implicit C union).
  That's probably not the best programming practice,
  plus make impossible to have readonly fields inside both of them.
  To overcome that situation propose to changed an API a bit, to allow
  to use two different mempools for these two distinct data structures.

 5. Add 'uint64_t userdata' inside struct rte_cryptodev_sym_session.
   I suppose that self-explanatory, and might be used in a lot of places
   (would be quite useful for ipsec library we develop).

The new proposed layout for rte_cryptodev_sym_session:
struct rte_cryptodev_sym_session {
        uint64_t userdata;
        /**< Can be used for external metadata */
        uint16_t nb_drivers;
        /**< number of elements in sess_data array */
        uint16_t priv_size;
        /**< session private data will be placed after sess_data */
        __extension__ struct {
                void *data;
                uint16_t refcnt;
        } sess_data[0];
        /**< Driver specific session material, variable size */
};

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
5 years agodoc: announce ABI change for security session
Konstantin Ananyev [Wed, 14 Nov 2018 11:23:31 +0000 (11:23 +0000)]
doc: announce ABI change for security session

Add 'uint64_t opaque_data' inside struct rte_security_session.
That allows upper layer to easily associate some user defined
data with the session.
Proposed new layout for:
struct rte_security_session {
void *sess_private_data;
/**< Private session material */
+ uint64_t opaque_data;
+ /**< Opaque user defined data */
};

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agodoc: announce ethdev ABI change for MTU limits info
Ian Stokes [Thu, 22 Nov 2018 12:09:09 +0000 (12:09 +0000)]
doc: announce ethdev ABI change for MTU limits info

Maximum and minimum MTU values vary between hardware devices. In
hardware agnostic DPDK applications access to such information would
allow a more accurate way of validating and setting supported MTU values on
a per device basis rather than using a defined default for all devices.

The following solution was proposed:

http://mails.dpdk.org/archives/dev/2018-September/110959.html

This patch adds a depreciation notice for ``rte_eth_dev_info`` as new
members will be added to represent min and max MTU values. These can be
added to fit a hole in the existing structure for amd64 but not for 32 bit,
as such ABI change will occur as size of the structure will be impacted.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agodoc: announce deprecation of dpaa2 exposed mem structure
Shreyansh Jain [Thu, 15 Nov 2018 13:29:27 +0000 (13:29 +0000)]
doc: announce deprecation of dpaa2 exposed mem structure

rte_dpaa2_memsegs is no more required once the dpaax (pa-va) translation
library has been introduced. This can be made internal (for fallback
operations) in subsequent release.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
5 years agodoc: announce kvargs API change
Thomas Monjalon [Thu, 22 Nov 2018 10:32:23 +0000 (11:32 +0100)]
doc: announce kvargs API change

After processing a kvlist in rte_kvargs_process(),
it may be needed to loop again over kvlist in order to know
whether the key is matched or not.
In order to simplify implementation of kvargs checks,
a new pointer parameter may be used to get the match count.

The change of the function prototype would be as below:

 int
 rte_kvargs_process(const struct rte_kvargs *kvlist,
  const char *key_match,
+ int *match_count,
  arg_handler_t handler,
  void *opaque_arg)

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
5 years agodoc: document all EAL parameters in one place
Anatoly Burakov [Mon, 19 Nov 2018 13:10:26 +0000 (13:10 +0000)]
doc: document all EAL parameters in one place

Currently, the most complete (but still incomplete) user guide for
EAL command-line parameters resides in user guide for testpmd.
This is wrong on multiple levels, and should not be the case.

To fix it, we have to create a document that lists all supported
EAL command-line arguments. However, because different platforms
support different subsets of available EAL parameters, instead of
creating a single file, we will create a common file in
doc/guides/common containing documentation for EAL parameters
that are supported on all of our supported platforms (Linux and
FreeBSD at the time of this writing).

We will then include this document in the Getting Started guides
for all supported platforms, so that any changes made to
documentation for commonly supported EAL parameters will be
reflected in Getting Started guides for all platforms.

This patch also removes EAL parameters documentation from the
testpmd user guide, and instead adds references to the newly
created documents in both testpmd user guides and in sample
applications guide.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Rami Rosen <roszenrami@gmail.com>
5 years agodoc: add tested NXP NICs
Shreyansh Jain [Wed, 21 Nov 2018 09:28:46 +0000 (09:28 +0000)]
doc: add tested NXP NICs

18.11-rc4 verification done on NXP SoCs with integrated NICs.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agodoc: add tested platforms with Mellanox NICs
Raslan Darawsheh [Mon, 19 Nov 2018 14:04:38 +0000 (14:04 +0000)]
doc: add tested platforms with Mellanox NICs

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
5 years agodoc: add tested Intel platforms with Intel NICs
Lijuan Tu [Mon, 19 Nov 2018 15:46:18 +0000 (23:46 +0800)]
doc: add tested Intel platforms with Intel NICs

Add tested Intel platforms with Intel NICs to the release note.

Signed-off-by: Lijuan Tu <lijuan.tu@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agodoc: add known issue when hot-unplug igb_uio device
Jeff Guo [Tue, 20 Nov 2018 15:09:31 +0000 (23:09 +0800)]
doc: add known issue when hot-unplug igb_uio device

When device has been bound to igb_uio driver and application is running,
hot-unplugging the device may cause kernel crash.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agodoc: add vdev ethdev ops restriction in secondary process
Marvin Liu [Wed, 31 Oct 2018 14:49:07 +0000 (22:49 +0800)]
doc: add vdev ethdev ops restriction in secondary process

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agodoc: announce disabling GCC AVX512F as known issue
Ferruh Yigit [Tue, 20 Nov 2018 12:50:31 +0000 (12:50 +0000)]
doc: announce disabling GCC AVX512F as known issue

Document that AVX512F has been disabled for GCC builds [1] and document
its potential implications on release notes, known issue section.

[1]
Commit 8d07c82b239f ("mk: disable gcc AVX512F support")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agodoc: remove PCI-specific details from EAL guide
Thomas Monjalon [Thu, 22 Nov 2018 14:18:35 +0000 (15:18 +0100)]
doc: remove PCI-specific details from EAL guide

The PCI bus is an independent driver and not part of EAL
as it was in the early days.
EAL must be understood as a generic layer.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agodoc: remove lists of figure and table references
Thomas Monjalon [Thu, 22 Nov 2018 14:18:34 +0000 (15:18 +0100)]
doc: remove lists of figure and table references

The references to the figures and tables in the index
are not maintained.

It is probably better to have no list than an incomplete list.
Anyway the usage of such figures list is not obvious.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agovhost: fix packed ring constants declaration
Maxime Coquelin [Thu, 22 Nov 2018 17:09:22 +0000 (18:09 +0100)]
vhost: fix packed ring constants declaration

The packed ring defines were declared only if kernel
header does not declare them.
The problem is that they are not applied in upstream kernel,
and some changes in the names have been required.

This patch declares the defines unconditionally, which
fixes potential build issues.

Fixes: 297b1e7350f6 ("vhost: add virtio packed virtqueue defines")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agodoc: add mlx5 E-Switch VXLAN tunnels limitations
Viacheslav Ovsiienko [Thu, 22 Nov 2018 13:49:16 +0000 (13:49 +0000)]
doc: add mlx5 E-Switch VXLAN tunnels limitations

This patch adds limitation notice for MLX5 PMD regarding
VXLAN tunnels support on E-Switch Flows.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
5 years agonet/mlx5: fix TPID check for VLAN push action on E-Switch
Viacheslav Ovsiienko [Wed, 21 Nov 2018 11:27:49 +0000 (11:27 +0000)]
net/mlx5: fix TPID check for VLAN push action on E-Switch

The VLAN push action on E-Switch supports only 802.1Q (0x8100)
and 802.1AD (0x88A8) Tag Protocol ID (TPID) insertions. The
parameter check for RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN action
is added.

Fixes: 57123c00c1b8 ("net/mlx5: add Linux TC flower driver for E-Switch flow")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix VLAN inner ethernet type on E-Switch
Viacheslav Ovsiienko [Wed, 21 Nov 2018 17:44:38 +0000 (17:44 +0000)]
net/mlx5: fix VLAN inner ethernet type on E-Switch

The TCA_FLOWER_KEY_VLAN_ETH_TYPE should be specified for the E-Switch
Flows with VLAN and L3 pattern items in the Netlink messages. The patch
adds missing flower key to the messages. This patch partially reverts to
the code smashed by http://patches.dpdk.org/patch/47781

Fixes: 251e8d02cf37 ("net/mlx5: add VXLAN to flow translate routine")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/ixgbe: fix TDH register write
Yanglong Wu [Tue, 20 Nov 2018 05:59:21 +0000 (13:59 +0800)]
net/ixgbe: fix TDH register write

The only time that software should write to the TDH register
is after a reset (hardware reset or CTRL.RST) and
before enabling the transmit function (TXDCTL.ENABLE).
If software were to write to this register while the transmit
function was enabled, the on-chip descriptor buffers might
be invalidated and the hardware could become confused.

Fixes: 029fd06d40fa ("ixgbe: queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agodoc: update qede firmware version
Rasesh Mody [Wed, 21 Nov 2018 21:20:51 +0000 (21:20 +0000)]
doc: update qede firmware version

Update QEDE PMD firmware version to 8.37.7.0

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agonet/qede: fix Tx offload mask
Shahed Shaikh [Wed, 21 Nov 2018 21:20:49 +0000 (21:20 +0000)]
net/qede: fix Tx offload mask

Following commit updated the Tx offload mask
commit 1037ed842c37 ("mbuf: fix Tx offload mask").

So, not having PKT_TX_IPV6 and PKT_TX_IPV4 in qede PMDs supported
Tx offload mask breaks TSO support since application will fail in transmit
prepare function.

Fixes: 1037ed842c37 ("mbuf: fix Tx offload mask")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
5 years agonet/ena: fix out of order completion
Rafal Kozik [Wed, 21 Nov 2018 08:21:14 +0000 (09:21 +0100)]
net/ena: fix out of order completion

rx_buffer_info should be refill not linearly, but out of order.
IDs should be taken from empty_rx_reqs array.

rx_refill_buffer is introduced to temporary storage
bulk of mbufs taken from pool.

In case of error unused mbufs are put back to pool.

Fixes: c2034976673d ("net/ena: add Rx out of order completion")
Cc: stable@dpdk.org
Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
5 years agonet/softnic: fix undefined device info fields
Jasvinder Singh [Tue, 20 Nov 2018 13:00:15 +0000 (13:00 +0000)]
net/softnic: fix undefined device info fields

The memcpy operation overwrites the device info fields set
by ethdev API and leaves the device field undefined.
Thus, replaces memcpy by only updating the required fields
at the driver layer.

error log: testpmd> show port info 1

**** Infos for port 1  ****
MAC address: 00:00:00:00:00:00
Device name: net_softnic0

Segmentation fault.
port_infos_display (port_id=1) at /dpdk/app/test-pmd/config.c:418
if (dev_info.device->devargs && dev_info.device->devargs->args)

Fixes: cc6d421574fe ("net/softnic: add softnic PMD")
Cc: stable@dpdk.org
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoethdev: remove unused deferred device state
Ferruh Yigit [Tue, 20 Nov 2018 12:02:36 +0000 (12:02 +0000)]
ethdev: remove unused deferred device state

DEFERRED state replaced by ownership concept and it is no more used as
code comment states.

ethdev ABI broken on this release use this opportunity to remove
DEFERRED state.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agodoc: update Mellanox supported OFED version
Shahaf Shuler [Mon, 19 Nov 2018 12:46:45 +0000 (14:46 +0200)]
doc: update Mellanox supported OFED version

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agodoc: add mlx5 release notes
Shahaf Shuler [Mon, 19 Nov 2018 12:46:44 +0000 (14:46 +0200)]
doc: add mlx5 release notes

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agodoc: fix typo in vhost-crypto app guide
Fan Zhang [Mon, 19 Nov 2018 09:38:31 +0000 (09:38 +0000)]
doc: fix typo in vhost-crypto app guide

This patch fixes the mismatch keyword in vhost_crypto sample
application guide.

Fixes: 709521f4c2cd ("examples/vhost_crypto: support multi-core")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agonet/i40e/base: fix comment referencing internal data
Ferruh Yigit [Fri, 16 Nov 2018 16:29:57 +0000 (16:29 +0000)]
net/i40e/base: fix comment referencing internal data

DCR is Intel internal information, no need to be in public code.

Fixes: de2cd512b176 ("net/i40e/base: new AQ commands for cloud filter")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/bnx2x: bump version to 1.0.7.1
Rasesh Mody [Sat, 17 Nov 2018 09:37:41 +0000 (09:37 +0000)]
net/bnx2x: bump version to 1.0.7.1

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agodoc: add known issue for i40e PHY link up
Jeff Guo [Fri, 16 Nov 2018 02:38:18 +0000 (10:38 +0800)]
doc: add known issue for i40e PHY link up

Some kernel drivers are not able to handle the link status correctly
after DPDK application sets the PHY to link down.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agosecurity: restore experimental tag for unimplemented APIs
Akhil Goyal [Thu, 22 Nov 2018 10:07:47 +0000 (10:07 +0000)]
security: restore experimental tag for unimplemented APIs

Following APIs are not currently implemented by any of the
drivers, so marking them as rte_experimental again.

Fixes: 1a81dce780a0 ("security: remove experimental tag")

rte_security_get_userdata;
rte_security_session_stats_get;
rte_security_session_update;

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoconfig: enable more than 128 cores for arm64
Joyce Kong [Thu, 22 Nov 2018 07:37:07 +0000 (15:37 +0800)]
config: enable more than 128 cores for arm64

When running dpdk applications on cores whose ids are bigger
than original max_core setting, eal error as below:
EAL: Detected 104 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: invalid core list
-l CORELIST core indexes between 0 and 128

The fix is to increase max_core to 256 on arm64 platform.

Fixes: b3ce00e5 ("mk: introduce ARMv8 architecture")
Cc: stable@dpdk.org
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
5 years agoeventdev: fix unlock in Rx adapter
Nikhil Rao [Tue, 20 Nov 2018 22:09:15 +0000 (03:39 +0530)]
eventdev: fix unlock in Rx adapter

In the eth Rx adapter SW service function,
move the return to after the spinlock unlock.

Coverity issue: 302857
Fixes: a66a83744667 ("eventdev: fix Rx SW adapter stop")
Cc: stable@dpdk.org
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
5 years agoapp/eventdev: fix possible uninitialized variable
Thomas Monjalon [Fri, 16 Nov 2018 16:58:54 +0000 (17:58 +0100)]
app/eventdev: fix possible uninitialized variable

When compiling with -O1, this error can appear:
app/test-eventdev/test_pipeline_common.c:332:6: error:
‘ret’ may be used uninitialized in this function

If there is no device, then ret is returned without being initialized.
It is fixed by setting 0 as initial value.

Fixes: 032a965a8f1d ("app/eventdev: support Tx adapter")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoeventdev: fix possible uninitialized variable
Thomas Monjalon [Fri, 16 Nov 2018 16:58:53 +0000 (17:58 +0100)]
eventdev: fix possible uninitialized variable

When compiling with -O1, this error can appear:
lib/librte_eventdev/rte_event_eth_tx_adapter.c:705:6: error:
‘ret’ may be used uninitialized in this function

If tx_queue_id is -1 and nb_queues is 0, then ret is returned
without being initialized.
It is fixed by setting 0 as initial value.

Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agonet/mlx4: fix possible uninitialized variable
Thomas Monjalon [Fri, 16 Nov 2018 16:58:52 +0000 (17:58 +0100)]
net/mlx4: fix possible uninitialized variable

When compiling with gcc -O1, this error appears:
drivers/net/mlx4/mlx4_ethdev.c: In function ‘mlx4_rxmode_toggle’:
rte_log.h:321:3: error:
‘mode’ may be used uninitialized in this function

The function mlx4_rxmode_toggle is never called with a value which
is not in the switch block, but GCC complains about it with -O1.
So the default case is "fixed" by setting string "undefined".

Fixes: eacaac7bae36 ("net/mlx4: restore promisc and allmulti support")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agokni: fix possible uninitialized variable
Thomas Monjalon [Fri, 16 Nov 2018 16:58:51 +0000 (17:58 +0100)]
kni: fix possible uninitialized variable

This error can be raised:
lib/librte_kni/rte_kni.c:531:15: error:
'req' may be used uninitialized in this function

It should not happen because kni_fifo_get() would return 0 if
req is not initialized, so the function would return before using req.
But GCC complains about it in -O1 optimization,
and a NULL initialization is harmless here.

Fixes: 3fc5ca2f6352 ("kni: initial import")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoeal: fix build with -O1
Thomas Monjalon [Fri, 16 Nov 2018 16:58:50 +0000 (17:58 +0100)]
eal: fix build with -O1

In case of optimized compilation, RTE_BUILD_BUG_ON use an external
variable which is neither defined, nor used.
It seems not optimized out in case of OPDL compiled with clang -O1:
opdl_ring.c: undefined reference to `RTE_BUILD_BUG_ON_detected_error'
clang-6.0: fatal error: linker command failed with exit code 1

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoeal: deprecate and rename bsf64 function
Anatoly Burakov [Wed, 21 Nov 2018 12:05:03 +0000 (12:05 +0000)]
eal: deprecate and rename bsf64 function

Rename rte_bsf64 to rte_bsf64_safe (this is a "safe" version in
that it prevents undefined behavior by checking if incoming
parameter is zero) and move it to common header.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoeal: remove useless code in bsf64 function
Anatoly Burakov [Wed, 21 Nov 2018 12:05:02 +0000 (12:05 +0000)]
eal: remove useless code in bsf64 function

RTE_BITMAP_OPTIMIZATIONS was never set to 0 and makes no sense
anyway, so remove all code related to it. Also, drop the "likely"
for bsf64 code, because it's a generic function and we cannot
make any assumptions about likely values of incoming arguments.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
5 years agoipc: fix access after async request failure
Anatoly Burakov [Tue, 20 Nov 2018 16:18:46 +0000 (16:18 +0000)]
ipc: fix access after async request failure

Previous fix for rte_panic has moved setting of alarm before
sending the message. This means that whether we send a message,
the alarm would still trigger. The comment noted that cleanup
would happen in the alarm handler, but that's not what actually
happened - instead, in the event of failed send we freed the
memory in-place, before putting the request on the queue.

This works OK when the message is sent, but when sending the
message fails, the alarm would still trigger with a pointer
argument that points to non-existent memory, and cause
memory corruption.

There probably is a "proper" fix for this issue, with correct
handling of sent vs. unsent requests, however it would be
simpler just to sacrifice the sent request in the (extremely
unlikely) event of alarm set failing. The other process would
still send a response, but it will be ignored by the sender.

Fixes: 45e5f49e87fb ("ipc: remove panic in async request")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agousertools: skip empty categories in devices status
Anatoly Burakov [Mon, 19 Nov 2018 10:33:12 +0000 (10:33 +0000)]
usertools: skip empty categories in devices status

If there aren't any devices of a particular category on user's
system, we still display them, which is bad for usability. Fix
devbind to not print out a category unless there are devices in
it.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Hunt <david.hunt@intel.com>
5 years agoversion: 18.11-rc4
Thomas Monjalon [Mon, 19 Nov 2018 00:40:54 +0000 (01:40 +0100)]
version: 18.11-rc4

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agodoc: update timestamp validity for latency measurement
Reshma Pattan [Thu, 4 Oct 2018 12:23:59 +0000 (13:23 +0100)]
doc: update timestamp validity for latency measurement

Updated the doc on how packets are marked to identify
their timestamp as valid and considered for latency
measurement.

Suggested-by: Bao-Long Tran <longtb5@viettel.com.vn>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
5 years agodoc: fix function name in flow filtering app guide
Rami Rosen [Thu, 8 Nov 2018 19:46:48 +0000 (21:46 +0200)]
doc: fix function name in flow filtering app guide

This patch fixes a typo in flow_filtering.rst. There is no
method named generate_ipv4_rule in DPDK, it should be generate_ipv4_flow.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
5 years agodoc: fix formatting in IP reassembly app guide
Marko Kovacevic [Thu, 16 Aug 2018 16:35:38 +0000 (17:35 +0100)]
doc: fix formatting in IP reassembly app guide

Fixed formatting an extra header was added making it an extra
section when it was not intended.

Fixes: d0dff9ba445e ("doc: sample application user guide")
Cc: stable@dpdk.org
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: add jansson link instructions for power app
David Hunt [Fri, 16 Nov 2018 15:47:21 +0000 (15:47 +0000)]
doc: add jansson link instructions for power app

Add more info to the docs on how to set environmental variable to
correctly build the vm_power_manager sample app in a cross compile
or multilib environment by setting PKG_CONFIG_LIBDIR.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agodoc: add cross-compilation in sample apps guide
Gavin Hu [Mon, 17 Sep 2018 02:13:23 +0000 (10:13 +0800)]
doc: add cross-compilation in sample apps guide

Fixes: 7cacb05655 ("doc: add generic build instructions for sample apps")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
5 years agodoc: create NXP DPAA2 platform guide
Hemant Agrawal [Wed, 26 Sep 2018 07:42:30 +0000 (13:12 +0530)]
doc: create NXP DPAA2 platform guide

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agodoc: create NXP DPAA platform guide
Hemant Agrawal [Wed, 26 Sep 2018 07:42:29 +0000 (13:12 +0530)]
doc: create NXP DPAA platform guide

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agodoc: update build steps for OCTEON TX
Anoob Joseph [Wed, 14 Nov 2018 09:42:45 +0000 (09:42 +0000)]
doc: update build steps for OCTEON TX

Updating platform doc with steps to build when using Cavium OCTEON TX
SDK. SDK would be required for using crypto offload block.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
5 years agodoc: fix NUMA library name in Linux guide
Yong Wang [Wed, 7 Nov 2018 02:40:52 +0000 (21:40 -0500)]
doc: fix NUMA library name in Linux guide

The library for handling NUMA is not libnuma-devel, but numactl-devel
in Red Hat/Fedora and libnuma-dev in Debian/Ubuntu.

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agodoc: clarify IOMMU disabling for uio_pci_generic
Tone Zhang [Wed, 26 Sep 2018 05:08:47 +0000 (13:08 +0800)]
doc: clarify IOMMU disabling for uio_pci_generic

If the devices used for DPDK are bound to the "uio_pci_generic" kernel
module, the IOMMU should be disabled in order not to break the IO
transmission because of the virtual / physical address mapping.

The patch clarifies the IOMMU configurations on both x86_64 and arm64
systems.

Signed-off-by: Tone Zhang <tone.zhang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Rami Rosen <roszenrami@gmail.com>
Acked-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agodoc: note minimun Linux version increase for 19.02
Kevin Traynor [Wed, 10 Oct 2018 14:14:16 +0000 (15:14 +0100)]
doc: note minimun Linux version increase for 19.02

Updating docs to reflect decision made at the techboard
that the min kernel version should be bumped from 3.2 to
the latest longterm stable release (3.16), but that
compatibility for commonly used distribution kernels should
be kept also.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agodoc: fix DESTDIR variable name in meson guide
Ilya Maximets [Wed, 14 Nov 2018 12:04:38 +0000 (15:04 +0300)]
doc: fix DESTDIR variable name in meson guide

ninja does not recognize 'DEST_DIR'.

Fixes: 9c3adc289c5e ("doc: add instructions on build using meson")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: document Meson < 0.46 miss private dependencies
Luca Boccassi [Fri, 16 Nov 2018 10:57:33 +0000 (10:57 +0000)]
build: document Meson < 0.46 miss private dependencies

Meson can generate the list of private dependencies of libraries
automatically for the pkgconfig file only since version 0.46.0.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agodoc: add KNI limitation in release notes
Ferruh Yigit [Mon, 5 Nov 2018 17:09:40 +0000 (17:09 +0000)]
doc: add KNI limitation in release notes

Commit a9460a0b2efb ("kni: fix build on Linux 4.19") disables some
ethtool commands because they are removed in newer (4.19) kernels.

This patch documents removed functionality.

Fixes: a9460a0b2efb ("kni: fix build on Linux 4.19")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: add KNI behaviour change in release notes
Ferruh Yigit [Mon, 5 Nov 2018 17:28:44 +0000 (17:28 +0000)]
doc: add KNI behaviour change in release notes

Commit 89397a01ce4a ("kni: set default carrier state of interface")
changes the KNI interface default carrier status. Which prevents traffic
flow by default and may break some existing usage / testing.

Document this behavior change in release notes.

Fixes: c6fd54f28c24 ("kni: add function to set link state on kernel interface")
Fixes: 89397a01ce4a ("kni: set default carrier state of interface")
Fixes: 724beb913b44 ("examples/kni: monitor and update link state continually")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: add new KNI features to release notes
Dan Gora [Mon, 5 Nov 2018 19:54:13 +0000 (17:54 -0200)]
doc: add new KNI features to release notes

Add the new module parameter for the KNI kernel module, the new command
line flag for the KNI sample application, and the new API function
'rte_kni_update_link()' to the release note.

Fixes: c6fd54f28c24 ("kni: add function to set link state on kernel interface")
Fixes: 89397a01ce4a ("kni: set default carrier state of interface")
Fixes: 724beb913b44 ("examples/kni: monitor and update link state continually")

Signed-off-by: Dan Gora <dg@adax.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agousertools: check for lspci dependency
Anatoly Burakov [Tue, 13 Nov 2018 16:06:26 +0000 (16:06 +0000)]
usertools: check for lspci dependency

On some distributions (such as CentOS 7) lspci may not be installed
by default, causing exceptions which are difficult to interpret.

Fix devbind script to check if lspci is installed at script startup.

Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Rami Rosen <roszenrami@gmail.com>
5 years agodevtools: fix regex in symbol addition check
Neil Horman [Thu, 1 Nov 2018 13:54:10 +0000 (09:54 -0400)]
devtools: fix regex in symbol addition check

The regex to determine the end of the map file chunk in a patch seems to
be wrong,  It was using perl regex syntax, which awk doesn't appear to
support (I'm still not sure how it was working previously).  Regardless,
it wasn't triggering and as a result symbols were getting added to the
mapdb that shouldn't be there.

Fix it by converting the regex to use traditional posix syntax, matching
only on the negation of the character class [^map]

Tested and shown to be working on the ip_frag patch set provided by
doucette@bu.edu

Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition")
Cc: stable@dpdk.org
Reported-by: Cody Doucette <doucette@bu.edu>
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
5 years agotest: release ring resources after PMD perf test
Phil Yang [Fri, 19 Oct 2018 11:00:38 +0000 (19:00 +0800)]
test: release ring resources after PMD perf test

Need to release the port and the ring resources after test. Otherwise,
it will cause failure to allocate memory when reentry the test.

Fixes: ea764af ("app/test: add performance test for ring driver")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
5 years agotest/power: skip KVM autotest if cannot run
Pallantla Poornima [Thu, 15 Nov 2018 06:34:57 +0000 (06:34 +0000)]
test/power: skip KVM autotest if cannot run

power_kvm_vm_autotest should run on kvm vm and
virtio-ports should exist, if not test should skip.
Hence changed return as TEST_SKIPPED.

Fixes: 0ea2dd4409 ("test: skip when required lib not available")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
5 years agotest: fix interrupt check
Qiming Yang [Fri, 16 Nov 2018 17:04:00 +0000 (01:04 +0800)]
test: fix interrupt check

Fixed the interrupt type using error.
Check valid alarm should use TEST_INTERRUPT_HANDLE_VALID_ALARM.

Fixes: 493b8e173fe6 ("eal: add device event handle in interrupt thread")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
5 years agotest: fix hugepage file handling in EAL flags autotest
Anatoly Burakov [Thu, 15 Nov 2018 12:18:05 +0000 (12:18 +0000)]
test: fix hugepage file handling in EAL flags autotest

Before 18.05, DPDK could not release memory back to the system
neither at runtime nor before shutting down. Over the course of
18.05 up to 18.11, code was introduced to release memory at
runtime, as well as an rte_eal_cleanup() function that is supposed
to release all EAL-allocated memory before shutting down DPDK.

When 3f9e31d71d63 ("test: clean up on exit") was introduced, the
test application started to use rte_eal_cleanup() to release all
used memory after execution. However, the EAL flags autotest
still relies on the old behavior of leaving stuff behind in the
hugetlbfs.

The fix is twofold. First, the test to check for leftover files
in hugetlbfs is no longer valid as it is, because test application
now removes all files from hugetlbfs after exit. However, if we
use the --legacy-mem option, then old behavior of leaving files
in hugetlbfs after execution is restored. So the first fix is to
add --legacy-mem to all the tests that expect files in hugetlbfs
to be leftover.

However, we also need to test if default memory mode *doesn't*
leave any files behind, so we also extend the test to check for
these scenarios as well. So, both memtest1 and memtest2 are run
in legacy and default mem modes, and are checked for any leftover
files that are or are not supposed to be there.

Fixes: 3f9e31d71d63 ("test: clean up on exit")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoexamples/ipv4_multicast: fix leak of cloned packets
Herakliusz Lipiec [Tue, 13 Nov 2018 11:49:29 +0000 (11:49 +0000)]
examples/ipv4_multicast: fix leak of cloned packets

The ipv4_multicast sample application was dropping packets
when using mbuf clone. When creating an L2 header and copying
metadata from the source packet, the ol_flags were also copied
along with all the other metadata. Because the cloned packet
had IND_ATTACHED_MBUF flag set in its ol_flags,
this caused the packets to never be freed when using rte_pktmbuf_free.
Since copying ol_flags from the cloned packet is
not necessary in the first place, just don't do it.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Reported-by: Dong Wang <dong1.wang@intel.com>
Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Dong Wang <dong1.wang@intel.com>
5 years agoapp/pdump: fix port id storage size
Marko Kovacevic [Wed, 14 Nov 2018 08:56:45 +0000 (08:56 +0000)]
app/pdump: fix port id storage size

port_id size should be uint16_t,
fix where it is defined as uint8_t

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Cc: stable@dpdk.org
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
5 years agoapp/testpmd: fix memory leak for DSCP table
Jasvinder Singh [Wed, 14 Nov 2018 11:58:59 +0000 (11:58 +0000)]
app/testpmd: fix memory leak for DSCP table

Fix memory leak for dscp table reported by coverity

Coverity issue: 326961
Fixes: 281eeb8afc55 ("app/testpmd: add commands for metering and policing")
Cc: stable@dpdk.org
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
5 years agonet/bonding: fix possible silent failure in configuration
Lee Daly [Fri, 16 Nov 2018 16:48:02 +0000 (16:48 +0000)]
net/bonding: fix possible silent failure in configuration

This patch checks the return value of function
rte_eth_bond_8023ad_agg_selection_set() in bond_ethdev_configure
for error return value.

Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes")
Cc: stable@dpdk.org
Signed-off-by: Lee Daly <lee.daly@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/pcap: enable data path for secondary process
Qi Zhang [Thu, 15 Nov 2018 01:37:42 +0000 (09:37 +0800)]
net/pcap: enable data path for secondary process

Private vdev was the way previously, when pdump developed, now with
shared device mode on virtual devices, pcap data path in secondary
is not working.

When secondary adds a virtual device, related data transferred to
primary and primary creates the device and shares device back with
secondary.  When pcap device created in primary, pcap handlers
(pointers) are process local and they are not valid for secondary
process. This breaks secondary.

So we can't directly share the pcap handlers, but need to create a new
set of handlers for secondary, that's what we done in this patch.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/pcap: move handler to process private
Qi Zhang [Thu, 15 Nov 2018 01:37:41 +0000 (09:37 +0800)]
net/pcap: move handler to process private

This is prework for data path enabling for secondary process.
To prevent pcap handler opened by one process be overwritten by
another process, each process should have their private copy,
`rte_eth_dev->process_private` is exactly what we needed.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/avf: fix Tx offload mask
Zhirun Yan [Fri, 16 Nov 2018 15:25:00 +0000 (15:25 +0000)]
net/avf: fix Tx offload mask

Tx offload mask is updated in following commit 1037ed842c37
("mbuf: fix Tx offload mask"). Currently, the new added offload
flags are not supported in PMD and application will fail to call
PMD transmit prepare function.

This patch updates AVF_TX_OFFFLOAD_MASK.

Fixes: 1037ed842c37 ("mbuf: fix Tx offload mask")
Cc: stable@dpdk.org
Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoexamples/vhost_crypto: fix zero copy
Fan Zhang [Wed, 14 Nov 2018 11:16:42 +0000 (11:16 +0000)]
examples/vhost_crypto: fix zero copy

This patch fixes the zero copy enable problem for vhost crypto
sample application.

For some Crypto PMDs such as AESNI-MB and AESNI-GCM the data to
be processed will be made a copy in the same buffer but next to the
data. For example, to encrypt 64 bytes data the PMD will copy this
data from offset 64 to offset 123. This requires the application
provides the buffer with at least double of the data size.

However there is no way for VMs to know this limitation. When
zero-copy is enabled in Vhost the PMD may overwrite the buffer
next to the VM data to be processed, and further cause problems
such as Segmentation Fault or even worse, crashes the VM.

To fix the problem the user should avoid enabling the zero copy
for these Crypto PMDs. This patch adds the checking of the PMD
names to see if zero copy can be applied.

Fixes: 709521f4c2cd ("examples/vhost_crypto: support multi-core")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/octeontx: fix failures when available ports > queues
Anoob Joseph [Wed, 14 Nov 2018 09:22:03 +0000 (09:22 +0000)]
net/octeontx: fix failures when available ports > queues

When eth_octeontx is initialized before event_octeontx, eth_octeontx
would initiate setting up of the event device with the max ports and
queues available. If number of ports is more than the number of queues,
some ports would be left unused when the ports and queues are mapped
1:1. But even in that case the ports need to be setup, or otherwise it
would lead to a segmentation fault when event device is started.

Fixes: f7be70e5130e ("net/octeontx: add net device probe and remove")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
5 years agonet/ena: fix cleaning HW IO rings configuration
Rafal Kozik [Wed, 14 Nov 2018 09:59:45 +0000 (10:59 +0100)]
net/ena: fix cleaning HW IO rings configuration

When queues are stopped release Tx buffers.
During start initialize array of empty Tx/Rx reqs with default values.

Fixes: df238f84c0a2 ("net/ena: recreate HW IO rings on start and stop")
Cc: stable@dpdk.org
Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
5 years agonet/mvpp2: fix possible uninitialized variable access
Ferruh Yigit [Mon, 5 Nov 2018 15:25:22 +0000 (15:25 +0000)]
net/mvpp2: fix possible uninitialized variable access

Fixes: cdb53f8da628 ("net/mvpp2: support metering")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Tomasz Duszynski <tdu@semihalf.com>
5 years agonet/mlx5: fix packet type for MPLS in UDP
Dekel Peled [Thu, 15 Nov 2018 15:17:14 +0000 (17:17 +0200)]
net/mlx5: fix packet type for MPLS in UDP

Change the relevant value in tunnels_info[] to match tunnel type.

Fixes: a4a5cd21d20a ("net/mlx5: add flow MPLS item")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix MPLS item validation
Dekel Peled [Thu, 15 Nov 2018 15:17:13 +0000 (17:17 +0200)]
net/mlx5: fix MPLS item validation

Update the mlx5_flow_validate_item_mpls() function to allow
MPLS over IP, UDP, and GRE.
Modify the flow_dv_validate() function with the new logic introduced
in previous patch of this series: set new variable last_item
after each validation, update item_flags after each item iteration.
The new variable last_item is sent to mlx5_flow_validate_item_mpls()
and used to validate the MPLS item.
Same change implemented in flow_verbs_validate().

Update the mlx5_flow_validate_item_mpls() function to verify that
device configuration has mpls_en set to 1.
This code was added earlier this year, but unintentionaly removed
in recent versions.

Fixes: 84c406e74524 ("net/mlx5: add flow translate function")

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add MPLS to Direct Verbs flow engine
Dekel Peled [Thu, 15 Nov 2018 15:17:12 +0000 (17:17 +0200)]
net/mlx5: add MPLS to Direct Verbs flow engine

The support in MPLS on this flow engine was overlooked. It's absence is
critical because there are required actions for MPLS which can be done
only with the DV engine.

To set correctly the MPLS filter, we need to reason about the flow item
before the MPLS (UDP, GRE or other).
To do that, a new variable last_item was added and updated after each
translation. the full item flags are updated after each item iteration.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: optimize Rx buffer replenishment threshold
Yongseok Koh [Thu, 15 Nov 2018 10:29:20 +0000 (10:29 +0000)]
net/mlx5: optimize Rx buffer replenishment threshold

Due to redundant calculation per every burst, performance drops a little.

Fixes: e10245a13b2e ("net/mlx5: fix Rx buffer replenishment threshold")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: optimize Tx doorbell write
Yongseok Koh [Thu, 15 Nov 2018 10:29:19 +0000 (10:29 +0000)]
net/mlx5: optimize Tx doorbell write

Unnecessary volatile attribute keeps compiler from further optimizing the
code and this results in a little performance drop (~2%). Because of memory
barriers, it is safe to remove.

Fixes: 6bf10ab69be0 ("net/mlx5: support 32-bit systems")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: optimize Tx external memory registration
Yongseok Koh [Thu, 15 Nov 2018 10:29:17 +0000 (10:29 +0000)]
net/mlx5: optimize Tx external memory registration

There's some performance drop due to extra condition checks on the
datapath. Checking for external memory registration should be consolidated
to the existing bottom-half.

Fixes: 7e43a32ee060 ("net/mlx5: support externally allocated static memory")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: optimize Tx external memory registration
Yongseok Koh [Thu, 15 Nov 2018 10:29:16 +0000 (10:29 +0000)]
net/mlx4: optimize Tx external memory registration

There's some performance drop due to extra condition checks on the
datapath. Checking for external memory registration should be consolidated
to the existing bottom-half.

Fixes: 31912d992403 ("net/mlx4: support externally allocated static memory")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix flow destruction
Yongseok Koh [Thu, 15 Nov 2018 05:24:13 +0000 (05:24 +0000)]
net/mlx5: fix flow destruction

As flow_drv_destroy() frees dev_flow, flow_rxq_flags_trim() must be called
ahead.

Fixes: 84c406e74524 ("net/mlx5: add flow translate function")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix flow query routine in Direct Verbs
Viacheslav Ovsiienko [Wed, 14 Nov 2018 13:47:19 +0000 (13:47 +0000)]
net/mlx5: fix flow query routine in Direct Verbs

The flow_dv_query() just returns -ENOTSUP value and does not
set provided error parameter structure, that crashes the
port_flow_query(). The patch fixes flow_db_query(), now it
sets an error parameter structure.

Fixes: 684dafe795d0 ("net/mlx5: add flow query abstraction interface")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix initialization of struct members
Ali Alnubani [Tue, 13 Nov 2018 19:11:07 +0000 (19:11 +0000)]
net/mlx5: fix initialization of struct members

This patch fixes compilation errors with meson and the clang
compiler caused by some of the struct members not being
initialized.

```
../drivers/net/mlx5/mlx5_mr.c:345:37: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                struct mlx5_mr_cache entry = { 0, };
                                                  ^
../drivers/net/mlx5/mlx5_mr.c:389:36: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                        struct mlx5_mr_cache ret = { 0, };
                                                        ^
../drivers/net/mlx5/mlx5_mr.c:691:35: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                struct mlx5_mr_cache ret = { 0, };
                                                ^
```

The compilation errors reproduce with
clang version 3.4.2 (tags/RELEASE_34/dot2-final) on RHEL.

Fixes: e1114ff6a5ab ("net/mlx5: support e-switch flow count action")
Fixes: db48f9db5d9f ("net/mlx5: support new flow counter API")
Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support")
Fixes: 65c9d24170c9 ("net/mlx5: enable loopback by configured mode")
Fixes: 87011737b715 ("mlx5: add software counters")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: fix initialization of struct members
Ali Alnubani [Tue, 13 Nov 2018 19:11:06 +0000 (19:11 +0000)]
net/mlx4: fix initialization of struct members

This patch fixes compilation errors with meson and the clang
compiler caused by some of the struct members not being
initialized.

```
../drivers/net/mlx4/mlx4_mr.c:357:37: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                struct mlx4_mr_cache entry = { 0, };
                                                  ^
../drivers/net/mlx4/mlx4_mr.c:401:36: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                        struct mlx4_mr_cache ret = { 0, };
                                                        ^
../drivers/net/mlx4/mlx4_mr.c:691:35: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                struct mlx4_mr_cache ret = { 0, };
                                                ^
```

The compilation errors reproduce with
clang version 3.4.2 (tags/RELEASE_34/dot2-final) on RHEL.

Fixes: 9797bfcce1c9 ("net/mlx4: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix minor typos
Ali Alnubani [Wed, 14 Nov 2018 07:48:31 +0000 (07:48 +0000)]
net/mlx5: fix minor typos

Fixes: e1114ff6a5ab ("net/mlx5: support e-switch flow count action")
Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: fix minor typo
Ali Alnubani [Wed, 14 Nov 2018 07:48:09 +0000 (07:48 +0000)]
net/mlx4: fix minor typo

Fixes: 9797bfcce1c9 ("net/mlx4: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add E-switch rule hardware offload flag check
Viacheslav Ovsiienko [Mon, 12 Nov 2018 20:01:42 +0000 (20:01 +0000)]
net/mlx5: add E-switch rule hardware offload flag check

This patch adds the in_hw flag check for tc flower filter rules.
If rule is applied without skip_sw flag set driver should check
whether the in_hw flag is set after rule applying. If no in_hw
flag set found it means the rule is not hardware offloaded and
error should be returned to application.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: prepare to add E-switch rule flags check
Viacheslav Ovsiienko [Mon, 12 Nov 2018 20:01:41 +0000 (20:01 +0000)]
net/mlx5: prepare to add E-switch rule flags check

The tc flower filter rules are used to control E-switch from
the application side. In order to gain garanteed rule hardware
offload the skip_sw flag should be specified while applying the
rule. But some tc rules is rejected by kernel if skip_sw flag
is set by design. Currently this regards VXLAN tunneling rules,
which are applied to special VXLAN virtual devices. Albeit these
rules are applied with skip_sw flag reset kernel tries to
perform hardware offload. If kernel succeeded the in_hw flag
is set in rule properties and application should check this
flag to get know whether the applied rule is actually hardware
offloaded.

This patch prepares for the rule flags query and check in_hw flag.
The driver checks only the rules with skip_sw flag reset, so we
need to test the actual flags of rule is being applied. The pointer
to flags field into translated rule is introduced and flags are
tested directly in the rule body. It is more reliable than save and
check flags copy.

Also patch swaps the flow_tcf_apply() and flow_tcf_remove(),
we are going to call flow_tcf_remove() from flow_tcf_appy() if
no in_hw flag set found in applied rule.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix Netlink communication routine
Viacheslav Ovsiienko [Mon, 12 Nov 2018 20:01:40 +0000 (20:01 +0000)]
net/mlx5: fix Netlink communication routine

While receiving the Netlink reply messages we should stop at DONE
or ACK message. The existing implementation stops at DONE message
or if no multiple message flag set ( NLM_F_MULTI). It prevents
the single query requests from working, these requests send the
single reply message without multi-message flag followed by
ACK message. This patch fixes receiving part of Netlink
communication routine.

Fixes: 6e74990b3463 ("net/mlx5: update E-Switch VXLAN netlink routines")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: remove unused TC message length parameter
Viacheslav Ovsiienko [Mon, 12 Nov 2018 20:01:39 +0000 (20:01 +0000)]
net/mlx5: remove unused TC message length parameter

This patch removes the unused message length parameter, we
do not send multiple commands in the single message anymore,
message length can be taken from the prepared message header,
so length parameter can be removed.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/i40e: fix RSS key initialization
Wei Zhao [Thu, 15 Nov 2018 08:57:20 +0000 (16:57 +0800)]
net/i40e: fix RSS key initialization

The assignment should be done after initialization, or it will be zero.

Fixes: 264b23e3d2c1 ("net/i40e: add parameter check for RSS flow init")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbe: fix maximum wait time in comment
Xiaolong Ye [Thu, 15 Nov 2018 07:20:05 +0000 (15:20 +0800)]
net/ixgbe: fix maximum wait time in comment

As the code has changed the max wait time to 1000ms, the comment should
be changed accordingly.

Fixes: 64f1c8539c8c ("net/ixgbe: wait longer for link after fiber MAC setup")
Cc: stable@dpdk.org
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: fix X710 Rx after reading some registers
Beilei Xing [Thu, 15 Nov 2018 03:17:02 +0000 (11:17 +0800)]
net/i40e: fix X710 Rx after reading some registers

There's an issue that X710 can't receive any packet after
reading some special registers. That's because these
registers are only valid for X722, read access for non-X722
will cause ECC error.

Fixes: d9efd0136ac1 ("i40e: add EEPROM and registers dumping")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agosecurity: remove experimental tag
Akhil Goyal [Tue, 13 Nov 2018 11:28:21 +0000 (11:28 +0000)]
security: remove experimental tag

rte_security has been experimental since DPDK 17.11 release.
Now the library has matured and expermental tag is removed in
this patch.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Boris Pismenny <borisp@mellanox.com>
5 years agocommon/cpt: fix bit shift operation for KASUMI
Ankur Dwivedi [Thu, 15 Nov 2018 05:10:27 +0000 (05:10 +0000)]
common/cpt: fix bit shift operation for KASUMI

Using the rte_bsf32 function to find last set bit. This avoids
the for loop and hence the bad bit shift operation.

Coverity issue: 323477
Fixes: 351fbee21986 ("common/cpt: support hash")

Signed-off-by: Ankur Dwivedi <ankur.dwivedi@caviumnetworks.com>
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
5 years agovfio: fix build with Linux < 4.0
Thomas Monjalon [Sun, 18 Nov 2018 21:14:26 +0000 (22:14 +0100)]
vfio: fix build with Linux < 4.0

drivers/bus/pci/linux/pci_vfio.c:45:23: error:
‘failure_handle_lock’ defined but not used

Fixes: 8ffe73865124 ("vfio: add lock for hot-unplug failure handler")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoapp/testpmd: workaround deadlock in hot-unplug callback
Jeff Guo [Thu, 15 Nov 2018 09:18:24 +0000 (17:18 +0800)]
app/testpmd: workaround deadlock in hot-unplug callback

Because the user's callback is invoked in eal interrupt callback, the
interrupt callback need to be finished before it can be unregistered
when detaching device. So finish callback soon and use a deferred
removal to detach device is need.

It is a workaround, once the device detaching be moved into the eal in
the future, the deferred removal could be deleted. This patch aim to
add this workaround and refine the function name and the description to
be more explicit and comment the limitation.

Fixes: 2049c5113fe8 ("app/testpmd: use hotplug failure handler")

Signed-off-by: Jeff Guo <jia.guo@intel.com>