dpdk.git
5 years agonet/mlx5: fix memory region cleanup
Viacheslav Ovsiienko [Fri, 12 Apr 2019 15:45:27 +0000 (15:45 +0000)]
net/mlx5: fix memory region cleanup

mlx5 driver has a global list of Memory Regions created by
device, and there is a ml5_mr_release() routine which makes
a memory cleanup at device closing. The head of device MR list
was fetched outside the rwlock protected section. Also some
noticed typos are fixed.

Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/failsafe: fix source port id in Rx packets
Adrien Mazarguil [Thu, 18 Apr 2019 17:20:55 +0000 (19:20 +0200)]
net/failsafe: fix source port id in Rx packets

When passed to the application, Rx packets retain the port ID value
originally set by slave devices. Unfortunately these IDs have no
meaning to applications, which are typically unaware of their existence.

This confuses those caring about the source port field in mbufs
(m->port) which experience issues ranging from traffic drop to crashes.

Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoethdev: promote function for port count as stable
Thomas Monjalon [Wed, 17 Apr 2019 22:59:28 +0000 (00:59 +0200)]
ethdev: promote function for port count as stable

The function rte_eth_dev_count_total() was introduced one year ago
in the release 18.05. It can be declared non experimental in 19.05.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: avoid explicit check of valid port state
Thomas Monjalon [Wed, 17 Apr 2019 22:59:27 +0000 (00:59 +0200)]
ethdev: avoid explicit check of valid port state

Some port iterations are manually checking against RTE_ETH_DEV_UNUSED
instead of using the iterators based on rte_eth_find_next().

A new macro RTE_ETH_FOREACH_VALID_DEV() is introduced, but kept private
because there should be no need of iterating over all devices in the
API. The public iterators have additional filters for ownership, parent
device or sibling ports.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoethdev: deprecate legacy filter API
Thomas Monjalon [Wed, 17 Apr 2019 00:36:27 +0000 (02:36 +0200)]
ethdev: deprecate legacy filter API

As stated in the deprecation notice from December 2016,
"the legacy filter API, including rte_eth_dev_filter_supported(),
rte_eth_dev_filter_ctrl() as well as filter types MACVLAN, ETHERTYPE,
FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded
by the generic flow API (rte_flow)".

After a long wait of more than two years, the legacy filter API
is marked as deprecated, while still tested with testpmd and
the tep_termination example.

The next step will be to announce a deadline for complete removal.
As preparation of the removal of rte_eth_ctrl.h,
RTE_ETH_FLOW_*, RTE_TUNNEL_TYPE_* and RTE_ETH_HASH_FUNCTION_* definitions
are moved to rte_ethdev.h and rte_flow.h.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/atlantic: bump internal driver version
Igor Russkikh [Thu, 18 Apr 2019 11:40:04 +0000 (11:40 +0000)]
net/atlantic: bump internal driver version

Version is synced with internal Aquantia's driver versioning

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: implement MACsec statistics
Pavel Belous [Thu, 18 Apr 2019 11:40:01 +0000 (11:40 +0000)]
net/atlantic: implement MACsec statistics

We add extra xstat fields to include MACsec counters and stats

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: configure MACsec from interrupt handler
Pavel Belous [Thu, 18 Apr 2019 11:39:57 +0000 (11:39 +0000)]
net/atlantic: configure MACsec from interrupt handler

MACSEC should be configured only after link up event, thus we use
link interrupt to file an alarm for configuration.

FW also uses link interrupt line to indicate incoming events from
MACSEC. These may include key expiration, packet counter wrap, etc.
We pass these events to the upper layers.

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: implement MACsec firmware interface
Pavel Belous [Thu, 18 Apr 2019 11:39:55 +0000 (11:39 +0000)]
net/atlantic: implement MACsec firmware interface

Implementation of firmware interface for MACsec configuration.
Structure with config data is written into FW memory, then we trigger
FW to execute the request and wait for result.

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: enable MACsec configuration
Pavel Belous [Thu, 18 Apr 2019 11:39:51 +0000 (11:39 +0000)]
net/atlantic: enable MACsec configuration

These are driver MACsec configuration routines.
They fill in config structures and prepare these
to be send to FW. Actual configuration will happen in
link interrupt handler.

We declare MACsec offload bits in DPDK offload capabilities
and provide external experimental MACsec API wrappers.

Also update documentation with feature matrix for the
enabled feature.

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: declare MACsec hardware structures
Pavel Belous [Thu, 18 Apr 2019 11:39:48 +0000 (11:39 +0000)]
net/atlantic: declare MACsec hardware structures

Here we define hardware and software configuration structures
for MACsec interface. MACSEC itself is implemented in Phy module,
but its configuration is done via firmware interface

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/i40e: fix logging on VF close
Beilei Xing [Thu, 18 Apr 2019 05:52:27 +0000 (13:52 +0800)]
net/i40e: fix logging on VF close

When launch testpmd with VF and quit testpmd, there'll
be lots of messages "i40evf_handle_aq_msg(): Request 0
is not supported yet", which are triggered during VF
reset and VF needn't do anything. So cancel alarm handler
before VF reset to ignore the admin queue messages.

Fixes: e0e6a7f2154e ("net/i40e: cancel alarm handler at the end of closure")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/iavf: fix queue interrupt for ice
Wei Zhao [Thu, 18 Apr 2019 04:58:15 +0000 (12:58 +0800)]
net/iavf: fix queue interrupt for ice

Enable CLEARPBA bit is required by ice NIC of A0/A1 version to
enable Tx and Rx queue interrupt.
Also enable CLEARPBA bit does no impact on IAVF behaviour when be
hosted by other devices, so we can make it as default.

Fixes: d6bde6b5eae9 ("net/avf: enable Rx interrupt")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/af_xdp: fix typos in Rx function
Xiaolong Ye [Wed, 17 Apr 2019 13:49:46 +0000 (21:49 +0800)]
net/af_xdp: fix typos in Rx function

We should use ETH_AF_XDP_RX_BATCH_SIZE in Rx function rather than
ETH_AF_XDP_TX_BATCH_SIZE.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agonet/af_xdp: make reserve/submit peek/release consistent
Xiaolong Ye [Wed, 17 Apr 2019 13:49:45 +0000 (21:49 +0800)]
net/af_xdp: make reserve/submit peek/release consistent

As David pointed out, if we reserve N slots for Tx, but only submit n
slots, we would end up with an incorrect opinion of the number of available
slots later, we also would get wrong idx when we call
xsk_ring_prod__reserve next time. It also applies to
xsk_ring_cons__peek()/xsk_ring_cons__release().

This patch ensures that both reserve/submit and peek/release are
consistent.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agonet/af_xdp: specify minimal and maximal MTU
Xiaolong Ye [Wed, 17 Apr 2019 13:49:44 +0000 (21:49 +0800)]
net/af_xdp: specify minimal and maximal MTU

Properly report mtu capability in port device info.

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agonet/af_xdp: enqueue buf ring when allocate Tx queue fails
Xiaolong Ye [Wed, 17 Apr 2019 13:49:43 +0000 (21:49 +0800)]
net/af_xdp: enqueue buf ring when allocate Tx queue fails

When it fails to allocate enough slots in Tx queue for transmitting
packets, we need to return the dequeued addrs to buf ring.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agonet/virtio: fix dangling pointer on failure
Aaron Conole [Mon, 15 Apr 2019 14:48:18 +0000 (10:48 -0400)]
net/virtio: fix dangling pointer on failure

When eth_virtio_dev_init() is cleaning up, it does not correctly set
the mac_addrs variable to NULL, which will lead to a double free.

Found during unit-test fixes.

Fixes: 43d18765c027 ("net/virtio: fix memory leak on failure")
Cc: stable@dpdk.org
Reported-by: Michael Santana <msantana@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: fix silent queue enabling with legacy guests
Ilya Maximets [Fri, 12 Apr 2019 13:09:49 +0000 (16:09 +0300)]
vhost: fix silent queue enabling with legacy guests

vhost should notify the application in case of all vring state changes.

In general, application should not care about negotiation of
VHOST_USER_F_PROTOCOL_FEATURES. Protocol details like this should
be hidden by the vhost library.

With this patch applications like OVS will be able to assume that
all vrings disabled by default and only process 'vring_state_changed'
events.

Fixes: 321203a54ba7 ("vhost: enable rings at the right time")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: fix passing destroyed device to destroy callback
Ilya Maximets [Fri, 12 Apr 2019 08:32:28 +0000 (11:32 +0300)]
vhost: fix passing destroyed device to destroy callback

Application should be able to obtain information like 'ifname' from
the 'vid' passed to 'destroy_connection' callback. Currently, all the
API calls with passed 'vid' fails with 'device not found'.

Fixes: efba12a78ddf ("vhost: add user callbacks for socket open/close")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: fix null pointer checking
Mohammad Abdul Awal [Thu, 11 Apr 2019 14:48:40 +0000 (15:48 +0100)]
vhost: fix null pointer checking

Null value for parameters will cause segfault.

Fixes: d7280c9fffcb ("vhost: support selective datapath")
Fixes: 72e8543093df ("vhost: add API to get MTU value")
Fixes: a277c7159876 ("vhost: refactor code structure")
Fixes: ca33faf9ef10 ("vhost: introduce API to fetch negotiated features")
Fixes: eb32247457fe ("vhost: export guest memory regions")
Fixes: 40ef286f236a ("vhost: export vhost vring info")
Fixes: bd2e0c3fe5ac ("vhost: add APIs for live migration")
Fixes: 0b8572a0c101 ("vhost: add external message handling to the API")
Fixes: b4953225cea4 ("vhost: add APIs for datapath configuration")
Fixes: 5fbb3941da9f ("vhost: introduce driver features related APIs")
Fixes: 292959c71961 ("vhost: cleanup unix socket")
Cc: stable@dpdk.org
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: fix device leak on connection add failure
Ilya Maximets [Thu, 11 Apr 2019 10:23:06 +0000 (13:23 +0300)]
vhost: fix device leak on connection add failure

Need to destroy allocated device if application fails to
add new connection or we have fdset failure.

Fixes: acbff5c67ea7 ("vhost: fix crash when exceeding file descriptors")
Fixes: efba12a78ddf ("vhost: add user callbacks for socket open/close")
Cc: stable@dpdk.org
Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio-user: fix return value check
Chenbo Xia [Wed, 10 Apr 2019 02:44:05 +0000 (02:44 +0000)]
net/virtio-user: fix return value check

Fix unchecked return value for fcntl.

Coverity issue: 277210
Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
Cc: stable@dpdk.org
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: fix buffer leak on VLAN insert
Stephen Hemminger [Fri, 5 Apr 2019 16:31:15 +0000 (09:31 -0700)]
net/virtio: fix buffer leak on VLAN insert

The function rte_vlan_insert may allocate a new buffer for the
vlan header and return a different mbuf than originally passed.
In this case, the stored mbuf in txm[] array could point to wrong
buffer.

Fixes: dd856dfcb9e7 ("virtio: use any layout on Tx")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agocrypto/virtio: fix IV offset
Fan Zhang [Fri, 5 Apr 2019 16:04:24 +0000 (17:04 +0100)]
crypto/virtio: fix IV offset

This patch fixes the incorrect iv offset calculation.

Fixes: b063e843fa03 ("crypto/virtio: fix IV physical address")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/ice: fix promiscuous mode
Ying A Wang [Wed, 17 Apr 2019 01:47:52 +0000 (09:47 +0800)]
net/ice: fix promiscuous mode

When device promiscuous mode has already been enabled,
should not return error if user re-enable it.

Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
Cc: stable@dpdk.org
Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice: fix variable storage type
Ying A Wang [Wed, 17 Apr 2019 01:47:51 +0000 (09:47 +0800)]
net/ice: fix variable storage type

Variable "status" should be defined as "enum ice_status"
instead of "uint16_t". This patch fixes the issue.

Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
Cc: stable@dpdk.org
Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/iavf: fix info get
Qiming Yang [Wed, 17 Apr 2019 16:08:34 +0000 (00:08 +0800)]
net/iavf: fix info get

iavf driver reset the dev_info structure. This action will clear
the setting in core library. This patch fix that issue.

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoapp/testpmd: fix port detach cleanup
Viacheslav Ovsiienko [Fri, 12 Apr 2019 15:48:11 +0000 (15:48 +0000)]
app/testpmd: fix port detach cleanup

At port detach routine after calling the rte_dev_remove()
testpmd performs some cleanup, checking the statuses of
remaining ports and closes the appropriate ones. The port
scanning is based on the new sibling iterator which uses the
invalid (already closed) port for reference. This patch
replaces the foreach iterator and uses the device object for
reference. It is worth to note this cleanup is not needed
for some drivers (at least for mlx5 and probably for others)
and is preserved due to possible compatibility issues.

Fixes: 13302cd5bd63 ("app/testpmd: use port sibling iterator in device cleanup")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agonet/ifc: fix used ring update
Xiao Wang [Mon, 15 Apr 2019 07:56:25 +0000 (15:56 +0800)]
net/ifc: fix used ring update

The vring relay thread is created after HW datapath start and is
canceled before HW datapath stop, so we need to take care of the
ring update when the relay thread is not on duty.

Fixes: 4bb531e152d3 ("net/ifc: support SW assisted VDPA live migration")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
5 years agonet/ifc: fix mediated vring initialization
Xiao Wang [Mon, 15 Apr 2019 07:56:24 +0000 (15:56 +0800)]
net/ifc: fix mediated vring initialization

The mediated vring's index should be set as initial value before
enabling HW datapath.

Fixes: 4bb531e152d3 ("net/ifc: support SW assisted VDPA live migration")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
5 years agonet/ifc: do not relay for Tx queue
Xiao Wang [Mon, 15 Apr 2019 07:56:23 +0000 (15:56 +0800)]
net/ifc: do not relay for Tx queue

Relay for Tx queue doesn't provide any benefit, since the packet buffer
in Tx queue is read-only, there's no dirty page logging for Tx buffer.
This change further reduces CPU usage and improves throughput.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
5 years agoapp/testpmd: set fixed flag for exact link speed
Andrew Rybchenko [Fri, 12 Apr 2019 13:12:33 +0000 (14:12 +0100)]
app/testpmd: set fixed flag for exact link speed

Setting exact link speed makes sense if auto-negotiation is
disabled. Fixed flag is required to disable auto-negotiation.

Fixes: 88fbedcd5e5a ("app/testpmd: move speed and duplex parsing in a function")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agoraw/ifpga: support ipn3ke
Rosen Xu [Tue, 16 Apr 2019 03:17:51 +0000 (11:17 +0800)]
raw/ifpga: support ipn3ke

Add Intel FPGA Acceleration NIC IPN3KE support for IFPGA Rawdev.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
5 years agoraw/ifpga/base: add prefix for feature and its ops
Tianfei Zhang [Tue, 16 Apr 2019 03:17:50 +0000 (11:17 +0800)]
raw/ifpga/base: add prefix for feature and its ops

Using prefix name "ifpga_" for feature and feature_ops data
struct on ifpga base code, which is suggested by Yigit, Ferruh.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
5 years agoraw/ifpga/base: add version description
Tianfei Zhang [Tue, 16 Apr 2019 03:17:49 +0000 (11:17 +0800)]
raw/ifpga/base: add version description

add verion description on READ about ifpga base code.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
5 years agoraw/ifpga/base: add eth group driver
Tianfei Zhang [Tue, 16 Apr 2019 03:17:48 +0000 (11:17 +0800)]
raw/ifpga/base: add eth group driver

There is two eth group devices in PAC N3000 card,
each eth group include PHY device and MAC device. Exposing
APIs for DPDK PMD driver to access those devices.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
5 years agoraw/ifpga/base: add I2C and at24 EEPROM driver
Tianfei Zhang [Tue, 16 Apr 2019 03:17:47 +0000 (11:17 +0800)]
raw/ifpga/base: add I2C and at24 EEPROM driver

1. Add Altera I2C master device driver
2. Add at24 eeprom driver which is i2c slave device
3. Introducing a new ops for opae_manager: opae_manager_networking_ops.
This ops will include some networking operation by FPGA, like vBNG
operation, MAC ROM operation and so on.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
5 years agoraw/ifpga/base: add SPI and MAX10 device driver
Tianfei Zhang [Tue, 16 Apr 2019 03:17:46 +0000 (11:17 +0800)]
raw/ifpga/base: add SPI and MAX10 device driver

There is a SPI bus link between A10 FPGA and MAX10 FPGA.
MAX10 is in charge of board management, like power management,
sensors, flash devices.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
5 years agoraw/ifpga/base: store private features in FME and port
Tianfei Zhang [Tue, 16 Apr 2019 03:17:45 +0000 (11:17 +0800)]
raw/ifpga/base: store private features in FME and port

Get private features attribute like size, id, address after
enumeration, and insert into FEM or Port dedicate list.

when initial the private feature driver, we just compare the
private feature id between the list and feature drivers array
to match the proper drivers.

This patch avoid the hardcore in feature_info array in previous
implementation. and the same time we can use one driver for mulitple
devices which the id is the same.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
5 years agoraw/ifpga/base: clean up
Tianfei Zhang [Tue, 16 Apr 2019 03:17:44 +0000 (11:17 +0800)]
raw/ifpga/base: clean up

clean up code:
1. use opae_memcpy instead of memcpy
2. use opae_memset instead of memset
3. disable opae_adapter_dump by default

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
5 years agonet/ipn3ke: support flow API
Rosen Xu [Tue, 16 Apr 2019 03:17:43 +0000 (11:17 +0800)]
net/ipn3ke: support flow API

Add Intel FPGA Acceleration NIC IPN3KE Flow of PMD driver.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
Signed-off-by: Dan Wei <dan.wei@intel.com>
5 years agonet/ipn3ke: support TM
Rosen Xu [Tue, 16 Apr 2019 03:17:42 +0000 (11:17 +0800)]
net/ipn3ke: support TM

Add Intel FPGA Acceleration NIC IPN3KE TM of PMD driver.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
Signed-off-by: Dan Wei <dan.wei@intel.com>
5 years agonet/ipn3ke: add representor
Rosen Xu [Tue, 16 Apr 2019 03:17:41 +0000 (11:17 +0800)]
net/ipn3ke: add representor

Add Intel FPGA Acceleration NIC IPN3KE representor of PMD driver.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
Signed-off-by: Dan Wei <dan.wei@intel.com>
5 years agonet/ipn3ke: add new driver
Rosen Xu [Tue, 16 Apr 2019 03:17:40 +0000 (11:17 +0800)]
net/ipn3ke: add new driver

Add Intel FPGA Acceleration NIC IPN3KE ethdev PMD driver.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
Signed-off-by: Dan Wei <dan.wei@intel.com>
5 years agobus/ifpga: support AFU device search by name
Rosen Xu [Tue, 16 Apr 2019 03:17:39 +0000 (11:17 +0800)]
bus/ifpga: support AFU device search by name

In many scenarios, AFU is needed searched by name, this
function add the feature.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
5 years agobus/ifpga: add AFU shared data
Rosen Xu [Tue, 16 Apr 2019 03:17:38 +0000 (11:17 +0800)]
bus/ifpga: add AFU shared data

AFU can be implemented into many different acceleration
devices, these devices need shared data to store private
information when they are handled by users.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
5 years agonet/enetc: fix crash at high speed traffic
Gagandeep Singh [Fri, 12 Apr 2019 12:29:11 +0000 (12:29 +0000)]
net/enetc: fix crash at high speed traffic

On xmit side, there should be a check whether BD ring
has free BDs available before transmit a packet to avoid
data corruption and buffer leak issue.

Fixes: 469c6111a799 ("net/enetc: enable Rx and Tx")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/enetc: enable Rx checksum offload validation
Gagandeep Singh [Fri, 12 Apr 2019 12:29:10 +0000 (12:29 +0000)]
net/enetc: enable Rx checksum offload validation

Checksum Validation on Rx is supported.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/enetc: enable CRC offload
Gagandeep Singh [Fri, 12 Apr 2019 12:29:08 +0000 (12:29 +0000)]
net/enetc: enable CRC offload

CRC offload keep feature supported

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/enetc: enable queue start/stop
Gagandeep Singh [Fri, 12 Apr 2019 12:29:06 +0000 (12:29 +0000)]
net/enetc: enable queue start/stop

Rx and Tx queue start-stop and deferred queue start
features enabled.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/enetc: support MTU update and jumbo frames
Gagandeep Singh [Fri, 12 Apr 2019 12:29:05 +0000 (12:29 +0000)]
net/enetc: support MTU update and jumbo frames

Enable the jumbo frames and MTU update feature.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/enetc: enable promiscuous and allmulticast
Gagandeep Singh [Fri, 12 Apr 2019 12:29:03 +0000 (12:29 +0000)]
net/enetc: enable promiscuous and allmulticast

Promiscuous and allmulticast enable/disable APIs added.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/enetc: remove forward declarations
Gagandeep Singh [Fri, 12 Apr 2019 12:29:02 +0000 (12:29 +0000)]
net/enetc: remove forward declarations

Remove unneeded forward declarations and re-order the code.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/enetc: replace register read/write macros with functions
Gagandeep Singh [Fri, 12 Apr 2019 12:29:00 +0000 (12:29 +0000)]
net/enetc: replace register read/write macros with functions

Replacing read-write macros with already available
read-write functions.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/enetc: add basic statistics
Gagandeep Singh [Fri, 12 Apr 2019 12:28:59 +0000 (12:28 +0000)]
net/enetc: add basic statistics

Enable basic statistics APIs enetc_stats_get
and enetc_stats_reset.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/enetc: set interface mode for SXGMII
Gagandeep Singh [Fri, 12 Apr 2019 12:28:58 +0000 (12:28 +0000)]
net/enetc: set interface mode for SXGMII

Support for SXGMII port has been enabled. It will
depends on boot loader information passed through IERB.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/enetc: fix big endian build and buffer allocation
Gagandeep Singh [Fri, 12 Apr 2019 12:28:56 +0000 (12:28 +0000)]
net/enetc: fix big endian build and buffer allocation

There was an error at rte_constant_bswap64 while compiling
with big endian toolchain. so fixing it by adding type cast.

Also, rte_pktmbuf_alloc API should be used to allocate mbuf
instead of rte_pktmbuf_raw_alloc to avoid use of stale mbuf
information.

Fixes: 469c6111a799 ("net/enetc: enable Rx and Tx")
Cc: stable@dpdk.org
Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/enetc: fix SMMU unhandled context fault
Gagandeep Singh [Fri, 12 Apr 2019 12:28:54 +0000 (12:28 +0000)]
net/enetc: fix SMMU unhandled context fault

First configure ring with BDs properly then enable
the ring.

Fixes: 469c6111a799 ("net/enetc: enable Rx and Tx")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/enetc: support physical addressing mode
Gagandeep Singh [Fri, 12 Apr 2019 12:28:53 +0000 (12:28 +0000)]
net/enetc: support physical addressing mode

Support added for physical addressing mode and
change driver flags to don't care.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
5 years agonet/ice: enable RSS for IPv4/IPv6 packets
Leyi Rong [Mon, 15 Apr 2019 06:04:05 +0000 (14:04 +0800)]
net/ice: enable RSS for IPv4/IPv6 packets

Enable RSS for general IPv4 and IPv6 packets.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/mlx5: fix RSS validation function
Ori Kam [Sun, 14 Apr 2019 07:05:21 +0000 (07:05 +0000)]
net/mlx5: fix RSS validation function

The RSS validation function was missing the verifcation that
if RSS is requested on inner packet, the flow must have tunnel data.

Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
Cc: stable@dpdk.org
Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/bnx2x: fix optic module verification
Rasesh Mody [Fri, 12 Apr 2019 01:47:42 +0000 (18:47 -0700)]
net/bnx2x: fix optic module verification

Enable the optic module vendor and part number verification from driver
by setting appropriate flags. Link handling module in conjunction with
FW performs optic module verification.

Without this fix the SFP is powered down and the link doesn't come up,
if module verification is enforced in nvram setting.

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rmody@marvell.com>
5 years agonet/bnx2x: fix race for periodic flags
Rasesh Mody [Fri, 12 Apr 2019 01:47:41 +0000 (18:47 -0700)]
net/bnx2x: fix race for periodic flags

The periodic callout function and the interrupt handler both modify the
periodic flags. There is a possible race condition when an application
is going through dev_stop()/dev_start() and an interrupt handler is
invoked. We also need to ensure that periodic polling is not invoked in
interrupt context.

This patch handles such case by using separate variable to check for
interrupt context. Also, atomically load and store the periodic flag
value.

Fixes: 0f6ebeee2402 ("net/bnx2x: fix call to link handling periodic function")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rmody@marvell.com>
5 years agonet/bnx2x: fix DMAE timeout
Shahed Shaikh [Fri, 12 Apr 2019 01:47:40 +0000 (18:47 -0700)]
net/bnx2x: fix DMAE timeout

In some cases, DPDK application may send packets
while PMD is going through load or unload flow.
This causes firmware to access invalid/unallocated
memory to process transmit buffer. Which results in
error on PCI bus and chip further blocks access to host,
causing a DMAE timeout.

Fix this issue by installing dummy empty transmit and receive
handlers at the beginning of unload path (rte_eth_dev_stop())
and install actual transmit and receive handlers after successful
load of the PMD port (rte_eth_dev_start()). This way, application
won't be able to send packets while device is going through
load/unload flow.

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
5 years agonet/bnx2x: fix ramrod timeout
Shahed Shaikh [Fri, 12 Apr 2019 01:47:39 +0000 (18:47 -0700)]
net/bnx2x: fix ramrod timeout

There is a race condition while processing RAMROD
completion in fast path queue through interrupt handler
and polling method.

Interrupt handler invoked from actual interrupt event
and from RAMROD processing polling flow may create a
situation where one flow will read and clear a fastpath
interrupt without actually processing the RAMROD completion.
Thus, causing a RAMROD timeout even though HW sent an
completion event.

Fix this by introducing an atomic variable which will be
set only when interrupt handler needs to process RAMROD
completion.

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
5 years agonet/bnx2x: fix memory leak
Shahed Shaikh [Fri, 12 Apr 2019 01:47:38 +0000 (18:47 -0700)]
net/bnx2x: fix memory leak

We allocate DMA memory but never free after using it.
Add function to free DMA memory.

Fixes: b5bf7719221d ("bnx2x: driver support routines")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
5 years agonet/bnx2x: fix MTU for jumbo frame
Rasesh Mody [Fri, 12 Apr 2019 01:47:37 +0000 (18:47 -0700)]
net/bnx2x: fix MTU for jumbo frame

Fix to update eth dev MTU for jumbo frames

Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rmody@marvell.com>
5 years agombuf: update Tx VLAN and QinQ flags documentation
Ferruh Yigit [Tue, 2 Apr 2019 17:09:46 +0000 (18:09 +0100)]
mbuf: update Tx VLAN and QinQ flags documentation

Currently PKT_TX_VLAN and PKT_TX_QINQ mbuf flags are documented as
they are to say packet contains VLAN or QINQ information.

Updating the definition as they are requests from application to
driver to insert VLAN or double VLAN tags into packet.

Fixes: dc6c911c9993 ("mbuf: use reserved space for double vlan")
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
5 years agodevtools: fix meson build test for plain bourne shell
Bruce Richardson [Fri, 19 Apr 2019 12:04:49 +0000 (13:04 +0100)]
devtools: fix meson build test for plain bourne shell

The pipefail option is not supported in /bin/sh, just in bash/ksh and
similar shells - which means it's there by default on most Linux distros
but not on e.g. FreeBSD. Therefore we check for it's presence before
setting the option, and if it's missing, we upgrade verbosity level if
needed to ensure we never hide any build failures.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agotest/compress: fix missing include
Bruce Richardson [Fri, 19 Apr 2019 12:03:27 +0000 (13:03 +0100)]
test/compress: fix missing include

Build of test_compressdev.c fails on FreeBSD due to the missing
include of unistd.h, to provide the function usleep.

Fixes: b06aa643cac4 ("test/compress: add initial unit tests")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agotest/compress: fix build
Fiona Trahe [Fri, 19 Apr 2019 16:52:48 +0000 (17:52 +0100)]
test/compress: fix build

Fixed the compilation error:

app/test/test_compressdev.c:1949:11: note:
previous definition of 'i' was here
app/test/test_compressdev.c:1992:2: error:
'for' loop initial declarations are only allowed in C99 mode
app/test/test_compressdev.c:1992:2: note:
use option -std=c99 or -std=gnu99 to compile your code
app/test/test_compressdev.c:1996:19: warning:
assignment from incompatible pointer type [enabled by default]

Fixes: 355b02eedc65 ("test/compress: add max mbuf size test case")

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agokni: fix type for MAC address
Jie Pan [Wed, 10 Apr 2019 06:20:55 +0000 (14:20 +0800)]
kni: fix type for MAC address

The type for MAC address should be unsigned.

Fixes: 1cfe212ed17a ("kni: support MAC address change")
Cc: stable@dpdk.org
Signed-off-by: Jie Pan <panjie5@jd.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agokni: implement header_ops parse method
Igor Ryzhov [Wed, 10 Apr 2019 10:30:03 +0000 (13:30 +0300)]
kni: implement header_ops parse method

It allows applications running packet sockets over KNI interfaces to get
source Ethernet addresses of packets received using recvfrom function.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agokni: fix build with Linux 5.1
Ferruh Yigit [Mon, 8 Apr 2019 14:22:26 +0000 (15:22 +0100)]
kni: fix build with Linux 5.1

Build error seen with Linux kernel 5.1 and
when CONFIG_RTE_KNI_KMOD_ETHTOOL is enabled.

Build error:
kernel/linux/kni/igb_main.c:2352:18:
  error: initialization of ... from incompatible pointer type ...
  [-Werror=incompatible-pointer-types]
    .ndo_fdb_add  = igb_ndo_fdb_add,
                      ^~~~~~~~~~~~~~~

ndo_fdb_add() is changed in Linux kernel version 5.1 and now requires
a new parameter, 'struct netlink_ext_ack *extack':
Linux Commit 87b0984ebfab ("net: Add extack argument to ndo_fdb_add()")

ndo_fdb_add() parameter updated with compile time Linux kernel version
check.

Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agocrypto/dpaa: fix session destroy
Akhil Goyal [Wed, 17 Apr 2019 10:28:14 +0000 (15:58 +0530)]
crypto/dpaa: fix session destroy

Coverity issue: 336798
Fixes: 1f14d500bce1 ("crypto/dpaa_sec: support IPsec protocol offload")
Fixes: 0a23d4b6f4c2 ("crypto/dpaa2_sec: support protocol offload IPsec")
Cc: stable@dpdk.org
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agotest/ipsec: fix logic around dequeue burst
Bernard Iremonger [Fri, 12 Apr 2019 14:08:09 +0000 (15:08 +0100)]
test/ipsec: fix logic around dequeue burst

Added crypto_dequeue_burst() function to call
rte_crypto_dequeue_burst() in a loop with a
delay to ensure that all the  packets are
dequeued from the crypto device.

Fixes: 59d7353b0df0 ("test/ipsec: fix test suite setup")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoapp/crypto-perf: check range of socket id
Bruce Richardson [Mon, 8 Apr 2019 09:25:14 +0000 (10:25 +0100)]
app/crypto-perf: check range of socket id

The socket_id is used as an array index so should be within the range
of zero to max numa nodes. Add a range check to ensure we don't get
excessive values.

Coverity issue: 336812
Coverity issue: 336829
Fixes: 2c59bd32b70d ("cryptodev: do not create session mempool internally")
CC: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agodoc: fix missing asymmetric crypto table
Fiona Trahe [Wed, 3 Apr 2019 10:38:20 +0000 (11:38 +0100)]
doc: fix missing asymmetric crypto table

Fixes: 11e5ba72cf67 ("doc: add crypto asymmetric feature list")
Cc: stable@dpdk.org
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agotest/ipsec: fix initialisation
Bernard Iremonger [Thu, 4 Apr 2019 14:51:51 +0000 (15:51 +0100)]
test/ipsec: fix initialisation

Fix xform initialisation.
Fix testsuite_setup.
Remove unused variables.

Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")
Fixes: 59d7353b0df0 ("test/ipsec: fix test suite setup")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agocompress/qat: fix dataplane return
Fiona Trahe [Mon, 8 Apr 2019 16:16:28 +0000 (17:16 +0100)]
compress/qat: fix dataplane return

Fixes: 352332744c3a ("compress/qat: add dynamic SGL allocation")
Cc: stable@dpdk.org
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
5 years agotest/compress: add max mbuf size test case
Tomasz Jozwiak [Tue, 2 Apr 2019 12:16:53 +0000 (14:16 +0200)]
test/compress: add max mbuf size test case

This patch adds new test case in which max. size of
chain mbufs has been used to compress random data dynamically.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Tomasz Cel <tomaszx.cel@intel.com>
5 years agocrypto/caam_jr: fix memory leak and illegal access
Gagandeep Singh [Tue, 9 Apr 2019 06:18:38 +0000 (06:18 +0000)]
crypto/caam_jr: fix memory leak and illegal access

Opendir() returns allocated storage which must be freed at the
end of function or in case any return on error. so freeing the
allocation using closedir in an error case.

Coverity issue: 323507
Coverity issue: 325880
Fixes: e7a45f3cc245 ("crypto/caam_jr: add UIO specific operations")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocrypto/caam_jr: fix total length in auth only s/g
Gagandeep Singh [Mon, 8 Apr 2019 08:59:30 +0000 (08:59 +0000)]
crypto/caam_jr: fix total length in auth only s/g

CAAM return wrong digest value in AUTH only sg test case
because digest calculated on wrong length of data

Fixes: 71dd6b9d44e7 ("crypto/caam_jr: add scatter gather")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocrypto/caam_jr: fix shared descriptor endianness
Gagandeep Singh [Mon, 8 Apr 2019 08:59:28 +0000 (08:59 +0000)]
crypto/caam_jr: fix shared descriptor endianness

build a shared descriptor accordingly if core and
CAAM endianness is same or different

Fixes: 6ef6beca8844 ("crypto/caam_jr: add enqueue/dequeue operations")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocrypto/aesni_gcm: use architecture independent API
Pablo de Lara [Wed, 10 Apr 2019 00:41:34 +0000 (01:41 +0100)]
crypto/aesni_gcm: use architecture independent API

IPSec Multi-buffer library has recently added API
that sets pointers depending on the architecture, at initiliazation,
in version 0.52.

AESNI MB PMD was updated with these changes, but not
the AESNI GCM PMD, which also uses the same library.

This makes the PMD to be only compatible with version 0.52,
but makes both PMD consistent on version compatibility,
plus adds support for AVX512.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
5 years agodoc: add missing algorithms for AESNI-MB PMD
Pablo de Lara [Wed, 10 Apr 2019 01:36:17 +0000 (02:36 +0100)]
doc: add missing algorithms for AESNI-MB PMD

The supported algorithm tables for AESNI MB PMD were
missing some supported algorithms.

Fixes: 0e9f8507afcb ("crypto/aesni_mb: support AES-GCM algorithm")
Fixes: e5eecd3dc838 ("crypto/aesni_mb: support AES-GMAC")
Fixes: 11fdbf1b7866 ("crypto/aesni_mb: support plain SHA")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agocryptodev: fix uninitialized session clear
Marko Kovacevic [Mon, 15 Apr 2019 15:04:49 +0000 (16:04 +0100)]
cryptodev: fix uninitialized session clear

added check to see if a session for a device
has been initialised if it has return 0.

Fixes: 5d6c73dd5938 ("cryptodev: add reference count to session private data")
Cc: stable@dpdk.org
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agoexamples/fips_validation: fix CMAC test
Marko Kovacevic [Mon, 15 Apr 2019 15:04:48 +0000 (16:04 +0100)]
examples/fips_validation: fix CMAC test

As a result of the cmac test running the test where
PT len is 65536 it should give a result back to the
user USER1: Error -1: Prepare op USER1: PT len 65536
as this MSG len is not supported. Issue was
that the application was not freeing the op properly after
a while causing the app to fail.

CRYPTODEV: rte_cryptodev_sym_session_create() line 1340:
couldn't get object from session mempool
USER1: Error -12: test block
USER1: Error -12: Failed test CMAC/req/CMAC.req

Fixes: cd255ccf5764 ("examples/fips_validation: support AES parsing")
Cc: stable@dpdk.org
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agoexamples/fips_validation: fix HMAC test
Marko Kovacevic [Mon, 15 Apr 2019 15:04:47 +0000 (16:04 +0100)]
examples/fips_validation: fix HMAC test

Application was failing as the HMAC and
Plain SHA fips request files are similar in a
way that they both have SHA- in the top section to
determine the hash algo and hash sizes. And HMAC having the
algo in the second line but the Plain SHA in the third
meant that when the HMAC files was used once it parsed the third
line Plain SHA was set as the algo and not HMAC.

USER1: Failed to get capability for cdev 0
USER1: Error -22: test block
[L=20 SHAAlg=SHA_2]
USER1: Error -22: Failed test /root/FIPS/HMAC/req/HMAC.req

Fixes: f4797bae0050 ("examples/fips_validation: support plain SHA")

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agoconfig: add Mellanox BlueField for meson cross-compilation
Yongseok Koh [Thu, 18 Apr 2019 11:49:03 +0000 (04:49 -0700)]
config: add Mellanox BlueField for meson cross-compilation

Mellanox BlueField is armv8 CPU having cortex-a72. The implementor ID is
0x41 (arm) and the primary part number is 0xd08 (cortex-a72).

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoconfig: change defaults of armv8
Yongseok Koh [Thu, 18 Apr 2019 11:49:01 +0000 (04:49 -0700)]
config: change defaults of armv8

Current default cache line size for armv8 CPUs having Implementor ID of
0x41 is 128 bytes, changing it to 64 bytes. Also, the max number of lcores
is changed to 16 from 256.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
5 years agonet/mlx: fix library search in meson build
Yongseok Koh [Thu, 18 Apr 2019 11:49:02 +0000 (04:49 -0700)]
net/mlx: fix library search in meson build

If MLNX_OFED is installed, there's no .pc file installed for libraries and
dependency() can't find libraries by pkg-config. By adding fallback of
using cc.find_library(), libraries are properly located.

Fixes: e30b4e566f47 ("build: improve dependency handling")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agodrivers/event: disable OcteonTx for buggy Arm compilers
Yongseok Koh [Thu, 18 Apr 2019 11:49:00 +0000 (04:49 -0700)]
drivers/event: disable OcteonTx for buggy Arm compilers

Disable octeontx for gcc 4.8.5 as compiler is emitting "internal compiler
error" for aarch64

Fixes: bd77f2d64c44 ("event/octeontx: build with meson")
Fixes: 4f760550a093 ("mk: disable OcteonTx for buggy compilers")
Fixes: f3af3e44a444 ("mk: disable OcteonTx for buggy compilers only on arm64")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agodoc: mention machine=default option for meson
Luca Boccassi [Thu, 18 Apr 2019 09:30:20 +0000 (10:30 +0100)]
doc: mention machine=default option for meson

Document the new value, as it's useful for distributions and users
who need to use a stable baseline -march

Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
5 years agobuild: use default flags for default Arm machine
Luca Boccassi [Wed, 20 Mar 2019 13:18:01 +0000 (13:18 +0000)]
build: use default flags for default Arm machine

When building for generic distribution we need a stable baseline
architecture, or depending on the build worker the result will vary.

Force the default flags if the user explicitly sets machine=default
at configuration time.

Fixes: b1d48c41189a ("build: support ARM with meson")
Cc: stable@dpdk.org
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agotimer: add function to stop all timers in a list
Erik Gabriel Carrillo [Mon, 15 Apr 2019 21:41:28 +0000 (16:41 -0500)]
timer: add function to stop all timers in a list

Add a function to the timer API that allows a caller to traverse a
specified set of timer lists, stopping each timer in each list,
and invoking a callback function.

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
5 years agotimer: allow management in shared memory
Erik Gabriel Carrillo [Mon, 15 Apr 2019 21:41:27 +0000 (16:41 -0500)]
timer: allow management in shared memory

Currently, the timer library uses a per-process table of structures to
manage skiplists of timers presumably because timers contain arbitrary
function pointers whose value may not resolve properly in other
processes.

However, if the same callback is used handle all timers, and that
callback is only invoked in one process, then it woud be safe to allow
the data structures to be allocated in shared memory, and to allow
secondary processes to modify the timer lists.  This would let timers be
used in more multi-process scenarios.

The library's global variables are wrapped with a struct, and an array
of these structures is created in shared memory.  The original APIs
are updated to reference the zeroth entry in the array. This maintains
the original behavior for both primary and secondary processes since
the set intersection of their coremasks should be empty [1].  New APIs
are introduced to enable the allocation/deallocation of other entries
in the array.

New variants of the APIs used to start and stop timers are introduced;
they allow a caller to specify which array entry should be used to
locate the timer list to insert into or delete from.

Finally, a new variant of rte_timer_manage() is introduced, which
allows a caller to specify which array entry should be used to locate
the timer lists to process; it can also process multiple timer lists per
invocation.

[1] https://doc.dpdk.org/guides/prog_guide/multi_proc_support.html#multi-process-limitations

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
5 years agodevargs: promote experimental API as stable
Hemant Agrawal [Thu, 4 Apr 2019 11:45:45 +0000 (11:45 +0000)]
devargs: promote experimental API as stable

These APIs are available in DPDK for last 4 releases
and used by multiple drivers.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoexamples/l2fwd-cat: fix build on FreeBSD
Bruce Richardson [Tue, 9 Apr 2019 10:55:38 +0000 (11:55 +0100)]
examples/l2fwd-cat: fix build on FreeBSD

The definition of CPU_AND differs from Linux to BSD, so we need to use
RTE_CPU_AND instead.

Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for PQoS CAT and CDP")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>