dpdk.git
6 years agonet/qede: remove primary MAC removal
Rasesh Mody [Sat, 23 Jun 2018 21:20:33 +0000 (14:20 -0700)]
net/qede: remove primary MAC removal

This was added to dev_stop when set MTU requested vport restart.
We are not requiring vport restart any more with set MTU as it just
needs vport to be inactive and doesn't need the port reconfigured.

Fixes: d121a6b5f781 ("net/qede: fix VF MTU update")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
6 years agonet/qede: fix legacy interrupt mode
Shahed Shaikh [Sat, 23 Jun 2018 21:20:32 +0000 (14:20 -0700)]
net/qede: fix legacy interrupt mode

qede pmd does not have support for legacy interrupt mode.
This causes slow path completion failure with uio_pci_generic module,
since it uses legacy interrupt (INTx) mode.

Fix this issue by installing legacy interrupt handler.

Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
6 years agonet/qede: fix unicast MAC address handling in VF
Shahed Shaikh [Sat, 23 Jun 2018 21:20:31 +0000 (14:20 -0700)]
net/qede: fix unicast MAC address handling in VF

We did not register unicast mac configuration handlers
for VF causing failure in bonding of VFs.

Also, mac_addr_set operation requires mac_remove followed
by mac_add.

Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
6 years agonet/thunderx: fix build with gcc optimization on
Ferruh Yigit [Thu, 21 Jun 2018 18:14:50 +0000 (19:14 +0100)]
net/thunderx: fix build with gcc optimization on

build error gcc version 6.3.1 20161221 (Red Hat 6.3.1-1),
with EXTRA_CFLAGS="-O3":

.../drivers/net/thunderx/nicvf_ethdev.c:907:9:
   error: ‘txq’ may be used uninitialized in this function
   [-Werror=maybe-uninitialized]
  if (txq->pool_free == nicvf_single_pool_free_xmited_buffers)
      ~~~^~~~~~~~~~~
.../drivers/net/thunderx/nicvf_ethdev.c:886:20:
   note: ‘txq’ was declared here
  struct nicvf_txq *txq;
                    ^~~

Same error on function 'nicvf_eth_dev_init' and 'nicvf_dev_start', it
seems 'nicvf_set_tx_function' inlined when optimization enabled.

Initialize the txq and add NULL check before using it to fix.

Fixes: 7413feee662d ("net/thunderx: add device start/stop and close")
Cc: stable@dpdk.org
Reported-by: Richard Walsh <richard.walsh@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agonet/bonding: support add/remove MAC addrs
Alex Kiselev [Wed, 20 Jun 2018 08:37:00 +0000 (11:37 +0300)]
net/bonding: support add/remove MAC addrs

Add functions to add/remove MAC addresses

Signed-off-by: Alex Kiselev <alex@therouter.net>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Chas Williams <chas3@att.com>
6 years agoeal: do not enable static log macro for ethdev
Ferruh Yigit [Tue, 19 Jun 2018 01:04:57 +0000 (02:04 +0100)]
eal: do not enable static log macro for ethdev

static logging macro RTE_PMD_DEBUG_TRACE is enabled with a few DEBUG
config options, including RTE_LIBRTE_ETHDEV_DEBUG

RTE_LIBRTE_ETHDEV_DEBUG is still used for data path logging, but all
ethdev logging switched to dynamic logging, so no need to enable static
logging macro for ethdev.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agoethdev: convert static log type usage to dynamic
Ferruh Yigit [Tue, 19 Jun 2018 01:04:56 +0000 (02:04 +0100)]
ethdev: convert static log type usage to dynamic

Replace RTE_PMD_DEBUG_TRACE with RTE_ETHDEV_LOG.

RTE_PMD_DEBUG_TRACE is using hardcoded PMD logtype and ERR log level,
controlled by compile time flags.
RTE_ETHDEV_LOG is using dynamic ethdev_logtype.

Also a few minor cleanups, like
- use %u for unsigned values like port_id which is uint16_t
- use PRIx64 for owner_id
- Join some log lines
- Unify to not have a "." at the end of the log
- Unify log start with uppercase

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agoethdev: move log macro to header
Ferruh Yigit [Tue, 19 Jun 2018 01:04:55 +0000 (02:04 +0100)]
ethdev: move log macro to header

Macro moved to header to be able to convert logging usage in header.
And since it has been moved to public header changed naming and added
RTE prefix, ethdev_log -> RTE_ETHDEV_LOG

Also need to add logtype variable to map file since logging macro used
from other libraries.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agonet/pcap: consolidate duplicated code
Ido Goshen [Tue, 19 Jun 2018 14:37:26 +0000 (17:37 +0300)]
net/pcap: consolidate duplicated code

Signed-off-by: Ido Goshen <ido@cgstowernetworks.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/pcap: fix multiple queues
Ido Goshen [Tue, 19 Jun 2018 14:37:25 +0000 (17:37 +0300)]
net/pcap: fix multiple queues

Change open_rx/tx_pcap/iface functions to open only a single pcap/dumper
and not loop num_of_queue times
The num_of_queue loop is already achieved by the
caller rte_kvargs_process

Fixing:
1. Opens N requested pcaps/dumpers instead of N^2
2. Leak of pcap/dumper's which are being overwritten by
   the sequential calls to open_rx/tx_pcap/iface functions
3. Use the filename/iface args per queue and not just the last one
   that overwrites the previous names

Fixes: 4c173302c307 ("pcap: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Ido Goshen <ido@cgstowernetworks.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/thunderx: add support for hardware first skip feature
Rakesh Kudurumalla [Mon, 18 Jun 2018 05:36:24 +0000 (11:06 +0530)]
net/thunderx: add support for hardware first skip feature

This feature is used to create a hole between HEADROOM
and actual data.Size of hole is specified in bytes as
module param to pmd

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agonet/mlx5: separate generic tunnel TSO from the standard one
Shahaf Shuler [Sun, 24 Jun 2018 06:22:26 +0000 (09:22 +0300)]
net/mlx5: separate generic tunnel TSO from the standard one

The generic tunnel TSO was depended in the regular one capabilities to
be enabled.

Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agovhost: fix potential null pointer dereference
Tiwei Bie [Fri, 22 Jun 2018 03:53:05 +0000 (11:53 +0800)]
vhost: fix potential null pointer dereference

Coverity issue: 293097
Fixes: d90cf7d111ac ("vhost: support host notifier")

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: fix missing increment of log cache count
Maxime Coquelin [Fri, 15 Jun 2018 13:48:46 +0000 (15:48 +0200)]
vhost: fix missing increment of log cache count

The log_cache_nb_elem was never incremented, resulting
in all dirty pages to be missed during live migration.

Fixes: c16915b87109 ("vhost: improve dirty pages logging performance")
Cc: stable@dpdk.org
Reported-by: Peng He <xnhp0320@icloud.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
6 years agonet/nfp: use generic PCI config access functions
Alejandro Lucero [Mon, 18 Jun 2018 20:06:12 +0000 (21:06 +0100)]
net/nfp: use generic PCI config access functions

This patch avoids direct access to device config sysfs file using
rte_pci_read_config instead.

Apart from replicating code, it turns out this direct access does
not always work if non-root users execute DPDK apps. In those cases
it is mandatory to go through VFIO specific function for reading pci
config space.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
6 years agonet/i40e: do not reset device info data
Damjan Marion [Wed, 6 Jun 2018 20:31:25 +0000 (22:31 +0200)]
net/i40e: do not reset device info data

At this point valid data is already set by rte_eth_get_device_info.
device field becomes zero and consumer is not able to retrieve pci data.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Damjan Marion <damarion@cisco.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: check illegal packets
Yanglong Wu [Wed, 20 Jun 2018 02:12:47 +0000 (10:12 +0800)]
net/i40e: check illegal packets

Some illegal packets will lead to TX/RX hang and
can't recover automatically. This patch check those
illegal packets and protect TX/RX from hanging.

Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agonet/i40e: workaround performance degradation
Haiyue Wang [Wed, 13 Jun 2018 05:52:41 +0000 (13:52 +0800)]
net/i40e: workaround performance degradation

The GL_SWR_PM_UP_THR value is not impacted from the link speed, its
value is set according to the total number of ports for a better
pipe-monitor configuration.

All bellowing relevant device IDs are considered (NICs, LOMs, Mezz
and Backplane):

Device-ID  Value        Comments
0x1572     0x03030303   10G SFI
0x1581     0x03030303   10G Backplane
0x1586     0x03030303   10G BaseT
0x1589     0x03030303   10G BaseT (FortPond)
0x1580     0x06060606   40G Backplane
0x1583     0x06060606   2x40G QSFP
0x1584     0x06060606   1x40G QSFP
0x1587     0x06060606   20G Backplane (HP)
0x1588     0x06060606   20G KR2 (HP)
0x158A     0x06060606   25G Backplane
0x158B     0x06060606   25G SFP28

Fixes: c9223a2bf53c ("i40e: workaround for XL710 performance")
Fixes: 75d133dd3296 ("net/i40e: enable 25G device")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agoapp/testpmd: fix VLAN TCI mask set error for FDIR
Wei Zhao [Tue, 5 Jun 2018 09:12:11 +0000 (17:12 +0800)]
app/testpmd: fix VLAN TCI mask set error for FDIR

The vlan tci mask should be set to 0xEFFF, not 0x0,
the wrong mask will cause mask error for register set.

Fixes: d9d5e6f2f0ba ("app/testpmd: set default flow director mask")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
6 years agonet/i40e: remove summarized global register change info
Beilei Xing [Thu, 7 Jun 2018 02:40:08 +0000 (10:40 +0800)]
net/i40e: remove summarized global register change info

The summarized global register change info will be logged
no matter if there's real global register change. Since
only real changes are logged now, there's no need to
summarize global register change info, otherwise will
cause misunderstanding.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: print real global changes
Beilei Xing [Thu, 7 Jun 2018 02:40:07 +0000 (10:40 +0800)]
net/i40e: print real global changes

Currently no matter if there's global change, the global
configuration will be always logged. But there's no value
to log the info if the configuration is not changed.
This patch prints only real global changes.
Also, change log level from DEBUG to WARNING.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: fix shifts of 32-bit value
Beilei Xing [Wed, 23 May 2018 07:46:46 +0000 (15:46 +0800)]
net/i40e: fix shifts of 32-bit value

Cppcheck reports following error,
(error) Shifting 32-bit value by 36 bits is undefined behaviour

According to datasheet, there's PHY type and PHY type extension
in setting PHY config command, should exclude PHY type extension
when setting PHY type.

Fixes: 1bb8f661168d ("net/i40e: fix link down and negotiation")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/ixgbe: fix mask bits register set error for FDIR
Wei Zhao [Fri, 15 Jun 2018 06:08:03 +0000 (14:08 +0800)]
net/ixgbe: fix mask bits register set error for FDIR

MAC address bits in mask registers should be set to zero
when the is mac mask is 0xFF, otherwise if it is 0x0
these bits should be to 0x3F.

Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
6 years agonet/ixgbe: fix tunnel type set error for FDIR
Wei Zhao [Thu, 14 Jun 2018 08:17:28 +0000 (16:17 +0800)]
net/ixgbe: fix tunnel type set error for FDIR

Tunnel type format should be translated to ixgbe required format
before register set in FDIR cloud mode, Ans also some register
not useful in cloud mode but only useful in IP mode should be set
to zero as datasheet request.

Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550")
Fixes: 11777435c727 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
6 years agonet/ixgbe: fix tunnel id format error for FDIR
Wei Zhao [Wed, 13 Jun 2018 08:11:22 +0000 (16:11 +0800)]
net/ixgbe: fix tunnel id format error for FDIR

In cloud mode for FDIR, tunnel id should be set as protocol
request, the lower 8 bits should be set as reserved.

Fixes: 82fb702077f6 ("ixgbe: support new flow director modes for X550")
Fixes: 11777435c727 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
6 years agonet/ixgbe: add support for VLAN in IP mode FDIR
Wei Zhao [Wed, 13 Jun 2018 08:09:55 +0000 (16:09 +0800)]
net/ixgbe: add support for VLAN in IP mode FDIR

In IP mode FDIR, X550 can support not only 4 tuple parameters
but also vlan tci in protocol, so add this feature to flow parser.

Fixes: 11777435c727 ("net/ixgbe: parse flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
6 years agonet/ixgbe: add query rule stats support for FDIR
Wei Zhao [Wed, 13 Jun 2018 08:08:50 +0000 (16:08 +0800)]
net/ixgbe: add query rule stats support for FDIR

There are many registeres in x550 support stats of
flow director filters, for example the number of added
or removed rules and the number match or miss match packet
count for this for port, all these important information
can be read form registeres in x550 and display with command
xstats.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
6 years agonet/ixgbe: fix crash on detach
Pablo de Lara [Thu, 31 May 2018 09:53:07 +0000 (10:53 +0100)]
net/ixgbe: fix crash on detach

When detaching a port bound to ixgbe PMD, if the port
does not have any VFs, *vfinfo is not set and there is
a NULL dereference attempt, when calling
rte_eth_switch_domain_free(), which expects VFs to be used,
causing a segmentation fault.

Steps to reproduce:

./testpmd -- -i
testpmd> port stop all
testpmd> port close all
testpmd> port detach 0

Bugzilla ID: 57
Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports")
Cc: stable@dpdk.org
Reported-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
6 years agonet/mlx5: fix error number handling
Yongseok Koh [Tue, 19 Jun 2018 23:13:13 +0000 (16:13 -0700)]
net/mlx5: fix error number handling

rte_errno should be saved only if error has occurred because rte_errno
could have garbage value.

Fixes: a6d83b6a9209 ("net/mlx5: standardize on negative errno values")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: clean-up developer logs
Nelio Laranjeiro [Tue, 5 Jun 2018 08:45:22 +0000 (10:45 +0200)]
net/mlx5: clean-up developer logs

Split maintainers logs from user logs.

A lot of debug logs are present providing internal information on how
the PMD works to users.  Such logs should not be available for them and
thus should remain available only when the PMD is compiled in debug
mode.

This commits removes some useless debug logs, move the Maintainers ones
under DEBUG and also move dump into debug mode only.

Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/ena: enable write combining
Rafal Kozik [Fri, 29 Jun 2018 13:54:08 +0000 (15:54 +0200)]
net/ena: enable write combining

Write combining (WC) increases NIC performance by making better
utilization of PCI bus. ENA PMD may make usage of this feature.

To enable it load igb_uio driver with wc_activate set to 1.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agobus/pci: enable write combining during mapping
Rafal Kozik [Fri, 29 Jun 2018 13:54:07 +0000 (15:54 +0200)]
bus/pci: enable write combining during mapping

Write combining (WC) increases NIC performance by making better
utilization of PCI bus, but cannot be used by all PMDs.

It will be enabled only if RTE_PCI_DRV_WC_ACTIVATE will be set in
drivers flags. For proper work also igb_uio driver must be loaded with
wc_activate set to 1.

When mapping PCI resources, firstly check if it support WC
and then try to use it.
In case of failure, it will fallback to normal mode.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobus/pci: reference driver structure before mapping
Rafal Kozik [Fri, 29 Jun 2018 13:54:06 +0000 (15:54 +0200)]
bus/pci: reference driver structure before mapping

Add pointer to driver structure before calling rte_pci_map_device.
It allows to use driver flags for adjusting configuration.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoigb_uio: add write combining option
Rafal Kozik [Fri, 29 Jun 2018 13:54:05 +0000 (15:54 +0200)]
igb_uio: add write combining option

Write combining (WC) increases NIC performance by making better
utilization of PCI bus, but cannot be use by all PMD.

To get internal_addr memory need to be mapped. But as memory could not be
mapped twice: with and without WC it should be skipped for WC. [1]

To do not spoil other drivers that potentially could use internal_addr,
parameter wc_activate adds possibility to skip it for those PMDs,
that do not use it.

[1] https://www.kernel.org/doc/ols/2008/ols2008v2-pages-135-144.pdf
section 5.3 and 5.4

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agomaintainers: update for ethdev
Thomas Monjalon [Fri, 29 Jun 2018 14:58:57 +0000 (16:58 +0200)]
maintainers: update for ethdev

Ferruh and Andrew are doing excellent reviews and contributions
to ethdev API.
They become official maintainers and responsibles of this major lib.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoipc: fix locking while sending messages
Anatoly Burakov [Wed, 27 Jun 2018 09:44:25 +0000 (10:44 +0100)]
ipc: fix locking while sending messages

Previously, we were putting an exclusive lock to prevent secondary
processes spinning up while we are sending our messages. However,
using exclusive locks had an effect of disallowing multiple
simultaenous unrelated messages/requests being sent, which was
not the intention behind locking.

Fix it to put a shared lock on the directory. That way, we still
prevent secondary process initializations while sending data over
IPC, but allow multiple unrelated transmissions to proceed.

Fixes: 89f1fe7e6d95 ("eal: lock IPC directory on init and send")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agocryptodev: fix ABI breakage
Pablo de Lara [Wed, 13 Jun 2018 09:36:48 +0000 (10:36 +0100)]
cryptodev: fix ABI breakage

In 17.08, the crypto operation was restructured,
and some reserved bytes (5) were added  to have the mempool
pointer aligned to 64 bits, since the structure is expected
to be aligned to 64 bits, allowing future additions with no
ABI breakage needed.

In 18.05, a new 2-byte field was added, so the reserved bytes
were reduced to 3. However, this field was added after the first 3 bytes
of the structure, causing it to be placed in an offset of 4 bytes,
and therefore, forcing the mempool pointer to be placed after 16 bytes,
instead of a 8 bytes, causing unintentionally the ABI breakage.

This commit fixes the breakage, by swapping the reserved bytes
and the private_data_offset field, so the latter is aligned to 2 bytes
and the offset of the mempool pointer returns to its original offset,
8 bytes.

Fixes: 54c836846603 ("cryptodev: set private data for session-less mode")
Cc: stable@dpdk.org
Reported-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
6 years agocryptodev: convert to SPDX license tag
Pablo de Lara [Mon, 11 Jun 2018 08:56:46 +0000 (09:56 +0100)]
cryptodev: convert to SPDX license tag

Converted the license header of the files
that still have the old full header.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
6 years agodoc: document QAT debug options
Fiona Trahe [Thu, 14 Jun 2018 11:03:06 +0000 (13:03 +0200)]
doc: document QAT debug options

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: move to dynamic logging for data-path trace
Tomasz Jozwiak [Thu, 14 Jun 2018 11:03:05 +0000 (13:03 +0200)]
crypto/qat: move to dynamic logging for data-path trace

For all trace on the data-path move to dynamic logging.
Add new QAT_DP_LOG macro to separate from non-dp trace.
Use the overall RTE_LOG_DP_LEVEL to override and compile out
debug data-path trace.
Add "unlikely" in two appropriate error checks.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: rename log macro for non-dp logs
Fiona Trahe [Thu, 14 Jun 2018 11:03:04 +0000 (13:03 +0200)]
crypto/qat: rename log macro for non-dp logs

Rename PMD_DRV_LOG to the more appropriate name QAT_LOG.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: move to dynamic logging for non-dp trace
Tomasz Jozwiak [Thu, 14 Jun 2018 11:03:03 +0000 (13:03 +0200)]
crypto/qat: move to dynamic logging for non-dp trace

For all trace not on the data-path move to dynamic logging.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: clean up unused and useless trace
Tomasz Jozwiak [Thu, 14 Jun 2018 11:03:02 +0000 (13:03 +0200)]
crypto/qat: clean up unused and useless trace

Removed INIT_FUNC trace and other unused macros.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: remove configurable max number of sessions
Tomasz Jozwiak [Wed, 13 Jun 2018 12:14:22 +0000 (14:14 +0200)]
crypto/qat: remove configurable max number of sessions

This patch removes CONFIG_RTE_QAT_PMD_MAX_NB_SESSIONS
from common_base, config/rte_config.h files and
defines QAT_SYM_PMD_MAX_NB_SESSIONS inside qat_sym_pmd.h
file instead.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agodoc: specify QAT driver and device name formats
Fiona Trahe [Wed, 13 Jun 2018 12:14:21 +0000 (14:14 +0200)]
doc: specify QAT driver and device name formats

Document the driver and device naming formats.
Changed the underscores alignment.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocrypto/qat: check for service type
Fiona Trahe [Wed, 13 Jun 2018 12:14:20 +0000 (14:14 +0200)]
crypto/qat: check for service type

Other services, apart from symmetric crypto,
such as compression, will be added in future patches.
Therefore, the assumption that only symmetric crypto
operations are processed will not be valid anymore,
and service type needs to be checked.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: make response process function inline
Fiona Trahe [Wed, 13 Jun 2018 12:14:19 +0000 (14:14 +0200)]
crypto/qat: make response process function inline

Optimize the dequeue function by inlining the response
processing function, assuming only symmetric
operations are supported.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: remove unused arguments
Fiona Trahe [Wed, 13 Jun 2018 12:14:18 +0000 (14:14 +0200)]
crypto/qat: remove unused arguments

Process response function is only implemented
for crypto symmetric operations, which do not require
some of the arguments.
Therefore, these arguments can be removed from the
function prototype.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: optimize ADF modulo function
Fiona Trahe [Wed, 13 Jun 2018 12:14:17 +0000 (14:14 +0200)]
crypto/qat: optimize ADF modulo function

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: add max PCI devices to config file
Fiona Trahe [Wed, 13 Jun 2018 12:14:16 +0000 (14:14 +0200)]
crypto/qat: add max PCI devices to config file

Added CONFIG_RTE_PMD_QAT_MAX_PCI_DEVICES to
build config files.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocrypto/qat: register appropriately named device
Fiona Trahe [Wed, 13 Jun 2018 12:14:15 +0000 (14:14 +0200)]
crypto/qat: register appropriately named device

For every QAT PCI device probed, populate a local rte_device
containing an rte_driver. The rte_driver was created in a previous
patch to provide a crypto-specific driver name: "crypto_qat".
This was previously only used for driver registration, now it's also
used in device creation.
This allows applications to find devices driven by "crypto_qat".

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: move macro to common file
Fiona Trahe [Wed, 13 Jun 2018 12:14:14 +0000 (14:14 +0200)]
crypto/qat: move macro to common file

QAT_64_BTYE_ALIGN_MASK macro is not specific to
symmetric crypto, but it is common for other
future services.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocrypto/qat: remove unused macro
Fiona Trahe [Wed, 13 Jun 2018 12:14:13 +0000 (14:14 +0200)]
crypto/qat: remove unused macro

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocrypto/qat: free cookie pool on queue creation error
Fiona Trahe [Wed, 13 Jun 2018 12:14:12 +0000 (14:14 +0200)]
crypto/qat: free cookie pool on queue creation error

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocrypto/qat: modify debug message
Fiona Trahe [Wed, 13 Jun 2018 12:14:11 +0000 (14:14 +0200)]
crypto/qat: modify debug message

Removed crypto reference in common debug message.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocrypto/qat: rename variables
Fiona Trahe [Wed, 13 Jun 2018 12:14:10 +0000 (14:14 +0200)]
crypto/qat: rename variables

Renamed sgl_cookie to cookie and qp_gen_config
to qat_gen_config, as it is intended to hold
more than just queue pair data.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocrypto/qat: remove incorrect usage of bundle number
Fiona Trahe [Wed, 13 Jun 2018 12:14:09 +0000 (14:14 +0200)]
crypto/qat: remove incorrect usage of bundle number

As bundle_num is included in qat_gen1_qps static array
there shouldn't be a multiplier used in qat_qps_per_service()
Then removed ADF_NUM_BUNDLES_PER_DEV as no longer used.
Also renamed ADF_MAX_QPS_PER_BUNDLE to ADF_MAX_QPS_ON_ANY_SERVICE
and reduced from 4 to 2 which is enough for all current devices.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: add lock around CSR access and change logic
Fiona Trahe [Wed, 13 Jun 2018 12:14:08 +0000 (14:14 +0200)]
crypto/qat: add lock around CSR access and change logic

Add lock around accesses to the arbiter CSR
and use & instead of ^ as ^ not safe if
arb_disable called when already disabled.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: move code into appropriate files
Fiona Trahe [Wed, 13 Jun 2018 12:14:07 +0000 (14:14 +0200)]
crypto/qat: move code into appropriate files

Move all code into appropriate files, no actual code changes. Specifically:
 - Rename rte_qat_cryptodev.c to qat_sym_pmd.c
 - Create qat_sym_pmd.h and populate with fn prototypes for qat_sym_pmd.c
 - Create qat_comp_pmd.c/.h and populate with placeholder functions
 - Create qat_asym_pmd.c/.h and populate with placeholder functions
 - Rename qat_crypto_capabilities.h to qat_sym_capabilities.h
 - Move CRYPTODEV_NAME_QAT_SYM_PMD from qat_common.h to qat_sym_pmd.h
 - Move qat_sym_dev_private from qat_device.h to qat_sym_pmd.h
 - Move prototype for qat_sym_dev_info_get frm qat_device.h 2 qat_sym_pmd.h
 - Move all qat_device.c sym dev_ops fns to qat_sym_pmd.c file
 - Move all qat_sym.c dev_ops fns to qat_sym_pmd.c file
 - Remove unused header file #includes from all files.
 - Move pci_id_qat_map, probe/release/register from
   rte_qat_cryptodev.c to qat_device.c
 - Moved stray comment for bpi_cipher_ctx_init() from qat_sym.c
   to qat_sym_session.c
 - Changed all files to use SPDX license header

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: rename functions which depend on cryptodev
Fiona Trahe [Wed, 13 Jun 2018 12:14:06 +0000 (14:14 +0200)]
crypto/qat: rename functions which depend on cryptodev

Rename all device functions which depend on cryptodev structs.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: use common stats structures
Fiona Trahe [Wed, 13 Jun 2018 12:14:05 +0000 (14:14 +0200)]
crypto/qat: use common stats structures

Split qat_sym_stats_get/reset into 2 functions, a wrapper function calling
a new qat_stats_get/reset function which can be called per service.
Remove cryptodev stats struct from qat_qp, replace with qat_common_stats.
Add links for qat_qp into qat_pci_device using an array per service to
avoid need for a lock and so qp_id for the service can be used as index.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: move to using new device structure
Fiona Trahe [Wed, 13 Jun 2018 12:14:04 +0000 (14:14 +0200)]
crypto/qat: move to using new device structure

Struct qat_pmd_private held the data needed by cryptodev, common code
now gets most data from struct qat_pci_device instead. qat_pmd_private
is trimmed to hold only sym crypto data and renamed qat_sym_private
to reflect its usage.
Specifically
 - remove max_nb_queue_pairs from qat_pmd_private, get from qp_hw_data
 - remove max_nb_sesssions from qat_pmd_private as not needed.
 - remove qat_gen from qat_pmd_private, get from qat_pci_device instead.
 - use qat_pci_device throughout common code instead of qat_pmd_private
 - rename qat_pmd_private to qat_sym_dev_private - this now holds only
   sym-specific data for the cryptodev API
 - extend pci device name to <bdf>_qat for clarity, was just <bdf>
 - update qp mem and cookiepool names to reflect the appropriate device,
   service and qp.
 - rename qat_dev_info_get() to qat_sym_dev_info_get() as mostly sym,
   not enough common info to warrant a generic fn.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: use generic driver name for PCI registration
Fiona Trahe [Wed, 13 Jun 2018 12:14:03 +0000 (14:14 +0200)]
crypto/qat: use generic driver name for PCI registration

The QAT PMD used to register with PCI using the name "crypto_qat".
Keep this name for the driver registered with cryptodev
and use a more generic name "qat" for the PCI registration.
This paves the way for the PCI device to host other services.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: add PCI device struct
Fiona Trahe [Wed, 13 Jun 2018 12:14:02 +0000 (14:14 +0200)]
crypto/qat: add PCI device struct

- Added struct qat_pci_device to use internally in QAT PMD
   to avoid dependencies on rte_cryptodev or rte_compressdev
 - Added a global array of these
 - Restructured probe/release to separate QAT common init/clear
   from crypto pmd create/destroy.
 - In QAT common part allocated a qat_pci_device and populated it
 - Removed meaningless check in probe for RTE_PROC_PRIMARY

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: move sgl related element to appropriate files
Fiona Trahe [Wed, 13 Jun 2018 12:14:01 +0000 (14:14 +0200)]
crypto/qat: move sgl related element to appropriate files

Move SGL (Scatter-Gather List) related functions to common file
Move qat_sym_op_cookie struct to sym header file

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: rename sgl related objects
Fiona Trahe [Wed, 13 Jun 2018 12:14:00 +0000 (14:14 +0200)]
crypto/qat: rename sgl related objects

Change SGL (Scatter-Gather List) related structs and member names

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
6 years agocrypto/qat: create structures to support various generations
Fiona Trahe [Wed, 13 Jun 2018 12:13:59 +0000 (14:13 +0200)]
crypto/qat: create structures to support various generations

Create data structures to support different generations
of qat hardware supplying services through different queue pairs.
 - Add two new structs qat_gen_hw_data and qat_qp_hw_dat
 - Add a qat_service_type enum
An array of qat_qp_hw_data elements is
initialised with constants, these are arranged so that the qp_id used
on the API can be used as an index to pick up the qp data to use.
The constants are common to current generations,
new arrays will be added for future generations.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: move defines from sym to qp header file
Fiona Trahe [Wed, 13 Jun 2018 12:13:58 +0000 (14:13 +0200)]
crypto/qat: move defines from sym to qp header file

Move defines related to coalescing from sym header file to qp header
file as these will be common for all services.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: remove dependencies on cryptodev from common
Fiona Trahe [Wed, 13 Jun 2018 12:13:57 +0000 (14:13 +0200)]
crypto/qat: remove dependencies on cryptodev from common

Remove dependence on rte_cryptodev from common qp code
to facilitate being used by other device types in future.
Transferred required data into qat-specific structures.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: move sym-specific qp code to sym file
Fiona Trahe [Wed, 13 Jun 2018 12:13:56 +0000 (14:13 +0200)]
crypto/qat: move sym-specific qp code to sym file

Move sym qp setup code from qat_qp.c to qat_sym.c

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: separate sym-specific from generic qp setup
Fiona Trahe [Wed, 13 Jun 2018 12:13:55 +0000 (14:13 +0200)]
crypto/qat: separate sym-specific from generic qp setup

Extracted all sym-specific code from qp setup fns, leaving
generic qat_qp_setup fn and helper fns. Created a new
meta-data struct qat_qp_config to hold all the data needed
to create a qp, filled this out in the sym-specific code
and passed to the generic qp_setup fn.
No need now for rx and tx queue_create fns, one generic
queue_create fn replaces these.
Included the service name (e.g. "sym") in the qp memzone
and cookie pool names.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: move generic qp function to qp file
Fiona Trahe [Wed, 13 Jun 2018 12:13:54 +0000 (14:13 +0200)]
crypto/qat: move generic qp function to qp file

Move the generic enqueue and dequeue fns from
the qat_sym.c file to the qat_qp.c file
Move generic qp structs to a new qat_qp.h file

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: make dequeue function generic
Fiona Trahe [Wed, 13 Jun 2018 12:13:53 +0000 (14:13 +0200)]
crypto/qat: make dequeue function generic

Queue-handling code in dequeue is made generic, so it can
be used by other services in future. This is done by
 - Removing all sym-specific refs in input params - replace with void ptrs.
 - Wrapping this generic dequeue with the sym-specific dequeue
   called through the API.
 - extracting the sym-specific response processing into a new fn.
 - Setting a fn ptr for process_response in qp on qp creation
 - Passing void * params to this, in the service-specific implementation
   qat_sym_process_response cast back to sym structs.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: make enqueue function generic
Fiona Trahe [Wed, 13 Jun 2018 12:13:52 +0000 (14:13 +0200)]
crypto/qat: make enqueue function generic

Queue-handling code in enqueue is made generic, so it can
be used by other services in future. This is done by
 - Removing all sym-specific refs in input params - replace with void ptrs.
 - Wrapping this generic enqueue with the sym-specific enqueue
   called through the API.
 - Setting a fn ptr for build_request in qp on qp creation
 - Passing void * params to this, in the service-specific implementation
   qat_sym_build_request cast back to sym structs.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: rename sym-specific structs
Fiona Trahe [Wed, 13 Jun 2018 12:13:51 +0000 (14:13 +0200)]
crypto/qat: rename sym-specific structs

qat_session           -> qat_sym_session
qat_crypto_proto_flag -> qat_sym_proto_flag
qat_alg_cd            -> qat_sym_cd
qat_crypto_op_cookie  -> qat_sym_op_cookie
qat_gen1_capabilities -> qat_gen1_sym_capabilities
qat_gen2_capabilities -> qat_gen2_sym_capabilities

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: rename functions for consistency
Fiona Trahe [Wed, 13 Jun 2018 12:13:50 +0000 (14:13 +0200)]
crypto/qat: rename functions for consistency

Rename fn names to shorten them, i.e.
  qat_crypto_sym_xxx to qat_sym_xxx
  _content_desc_ to _cd_
Renaming symmetric crypto specific with consistent names:
  qat_crypto_set_session_parameters->qat_sym_set_session_parameters
  qat_write_hw_desc_entry()->qat_sym_build_request()
  qat_alg_xxx ->qat_sym_xxx
  qat_sym_xxx_session_yyy()->qat_sym_session_xxx_yyy()
Removed unused prototypes:
  qat_get_inter_state_size()
  qat_pmd_session_mempool_create()
Removed 2 unnecessary extern declarations

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: change filename crypto to sym
Fiona Trahe [Wed, 13 Jun 2018 12:13:49 +0000 (14:13 +0200)]
crypto/qat: change filename crypto to sym

This commit renames qat_crypto.c/h to qat_sym.c/h
And makes a few whitespace changes to resolve line-length
issues.

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: add symmetric session file
Fiona Trahe [Wed, 13 Jun 2018 12:13:48 +0000 (14:13 +0200)]
crypto/qat: add symmetric session file

This commit adds qat_sym_session.c/h files and moves objects
from qat_algs_build_desc and qat_algs.h

Following objects were moved:
qat_adf/qat_algs_build_desc.c => qat_sym_session.c
- all objects -
qat_adf/qat_algs.h => qat_sym_session.h
- enum qat_crypto_proto_flag
- struct qat_alg_cd
- struct qat_session
- int qat_get_inter_state_size()
- int qat_alg_aead_session_create_content_desc_cipher()
- int qat_alg_aead_session_create_content_desc_auth()
- void qat_alg_init_common_hdr()
- int qat_alg_validate_aes_key()
- int qat_alg_validate_aes_docsisbpi_key()
- int qat_alg_validate_snow3g_key()
- int qat_alg_validate_kasumi_key()
- int qat_alg_validate_3des_key()
- int qat_alg_validate_des_key()
- int qat_cipher_get_block_size()
- int qat_alg_validate_zuc_key()
-- all macros
qat_crypto.h => qat_sym_session.h
int qat_crypto_sym_configure_session()
int qat_crypto_set_session_parameters()
int qat_crypto_sym_configure_session_aead()
int qat_crypto_sym_configure_session_cipher()
int qat_crypto_sym_configure_session_auth()
int qat_alg_aead_session_create_content_desc_cipher()
int qat_alg_aead_session_create_content_desc_auth()
static struct rte_crypto_auth_xform qat_get_auth_xform()
static struct rte_crypto_cipher_xform qat_get_cipher_xform()

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocrypto/qat: remove unused includes
Tomasz Jozwiak [Wed, 13 Jun 2018 12:13:47 +0000 (14:13 +0200)]
crypto/qat: remove unused includes

This commit removes unused includes from qat_crypto.c

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocrypto/qat: add device files
Fiona Trahe [Wed, 13 Jun 2018 12:13:46 +0000 (14:13 +0200)]
crypto/qat: add device files

This commit adds new qat_device file.
Following objects were moved:

qat_crypto.h => qat_device.h
- struct qat_pmd_private
- uint8_t cryptodev_qat_driver_id
- int qat_crypto_sym_qp_release (EXTERN)
- int qat_dev_config()
- int qat_dev_start()
- void qat_dev_stop()
- int qat_dev_close()
- void qat_dev_info_get()
qat_crypto.c => qat_device.c
- int qat_dev_config()
- int qat_dev_start()
- void qat_dev_stop()
- int qat_dev_close()
- void qat_dev_info_get()

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/qat: add common header
Fiona Trahe [Wed, 13 Jun 2018 12:13:45 +0000 (14:13 +0200)]
crypto/qat: add common header

This commit adds qat_common.h header file.
Following objects were moved to it:

qat_algs.h =>. qat_common.h
- struct qat_alg_buf
- struct qat_alg_buf_list
- struct qat_crypto_op_cookie
- QAT_SGL_MAX_NUMBER
qat_crypto.h => qat_common.h
- CRYPTODEV_NAME_QAT_SYM_PMD

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agonet: rename u16 to fix shadowed declaration
Gage Eads [Mon, 4 Jun 2018 19:40:00 +0000 (14:40 -0500)]
net: rename u16 to fix shadowed declaration

This patch renames u16 to u16_buf. u16 as a variable name causes a shadowed
declaration warning if, for example, the application also typedefs u16
(e.g. by including a header containing "typedef unsigned short u16") and
the application is built with -Wshadow.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agobus/pci: remove unused function to detach by address
Rami Rosen [Sun, 20 May 2018 19:52:58 +0000 (22:52 +0300)]
bus/pci: remove unused function to detach by address

The function rte_pci_detach() is private to PCI and is
not used anywhere in current code base. Remove dead code.

Signed-off-by: Rami Rosen <rami.rosen@intel.com>
6 years agobus/pci: remove unused function to probe by address
Stephen Hemminger [Thu, 17 May 2018 23:44:58 +0000 (16:44 -0700)]
bus/pci: remove unused function to probe by address

The function rte_pci_probe_one is private to PCI and is
not used anywhere in current code base. Remove dead code.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
6 years agobus/pci: remove unused unbind function prototype
Stephen Hemminger [Mon, 21 May 2018 16:41:50 +0000 (09:41 -0700)]
bus/pci: remove unused unbind function prototype

Prototype for pci_unbind_kernel_driver exists but no code.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agobus/pci: make remove function static
Stephen Hemminger [Mon, 21 May 2018 16:41:49 +0000 (09:41 -0700)]
bus/pci: make remove function static

Only used in one file, and therefore can be made static.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agocmdline: remove useless intermediate buffer
David Marchand [Thu, 31 May 2018 08:03:28 +0000 (10:03 +0200)]
cmdline: remove useless intermediate buffer

Rather than copy the string, we can use a precision in the format string
given to printf.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agolog: remove useless intermediate buffer
David Marchand [Thu, 31 May 2018 08:03:27 +0000 (10:03 +0200)]
log: remove useless intermediate buffer

Rather than copy the log message, we can use a precision in the format
string given to syslog.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
6 years agoigb_uio: fail and log if kernel lock down is enabled
Ferruh Yigit [Wed, 16 May 2018 14:42:20 +0000 (15:42 +0100)]
igb_uio: fail and log if kernel lock down is enabled

When EFI secure boot is enabled, it is possible to lock down kernel and
prevent accessing device BARs and this makes igb_uio unusable.

Lock down patches are not part of the vanilla kernel but they are
applied and used by some distros already [1].

It is not possible to fix this issue, but intention of this patch is to
detect and log if kernel lock down enabled and don't insert the module
for that case.

The challenge is since this feature enabled by distros, they have
different config options and APIs for it. This patch is done based on
Fedora and Ubuntu kernel source, may needs to add more distro specific
support.

[1]
kernel.ubuntu.com/git/ubuntu/ubuntu-artful.git/commit/?id=99f9ef18d5b6
And a few more patches too.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agokni: fix build with gcc 8.1
Ferruh Yigit [Tue, 26 Jun 2018 11:38:07 +0000 (12:38 +0100)]
kni: fix build with gcc 8.1

Error observed when CONFIG_RTE_KNI_KMOD_ETHTOOL config option is
enabled.

build error:
In function ‘strncpy’,
    inlined from ‘igb_get_drvinfo’ at
    kernel/linux/kni/igb_ethtool.c:814:2:
    include/linux/string.h:246:9: error: ‘__builtin_strncpy’ output
    may be truncated copying 31 bytes from a string of length 42
    [-Werror=stringop-truncation]
      return __builtin_strncpy(p, q, size);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixed by using strlcpy instead of strncpy.

adapter->fw_version size kept same because of
c3698192940c ("kni: fix build with gcc 7.1")

Also next line strncpy usage replaced with strlcpy while arround.

Fixes: c3698192940c ("kni: fix build with gcc 7.1")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agomaintainers: update for tep_termination example
Helin Zhang [Fri, 22 Jun 2018 09:13:59 +0000 (17:13 +0800)]
maintainers: update for tep_termination example

Xiaoyun Li has agreed to take over the maintainership of example
application tep_termination, as Jijiang Liu is no longer working
on that.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agomaintainers: update Intel sub-tree committers
Helin Zhang [Wed, 20 Jun 2018 10:37:02 +0000 (11:37 +0100)]
maintainers: update Intel sub-tree committers

For subtree of dpdk-next-net-intel, Qi Zhang has agreed to take
the committer role, to replace Helin Zhang. Also Beilei Xing has
agreed to be the backup committer of the subtree.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agobus/dpaa: fix build
Thomas Monjalon [Wed, 20 Jun 2018 10:38:06 +0000 (12:38 +0200)]
bus/dpaa: fix build

The DPAA bus driver is defining some macros without prefix.
So it can conflict with other libraries like libbsd:

drivers/bus/dpaa/include/compat.h:53:
error: "__packed" redefined
/usr/include/bsd/sys/cdefs.h:120:
note: this is the location of the previous definition

Fixes: 39f373cf015a ("bus/dpaa: add compatibility and helper macros")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agonet/ena: fix FreeBSD build
Michal Krawczyk [Tue, 19 Jun 2018 07:58:20 +0000 (09:58 +0200)]
net/ena: fix FreeBSD build

The FreeBSD define was removed from platform file when HAL was upgraded
to newer version.

In file included from drivers/net/ena/ena_ethdev.c:45:
from drivers/net/ena/ena_ethdev.h:42:
from drivers/net/ena/base/ena_com.h:37:
drivers/net/ena/base/ena_plat.h:48:2: error: "Invalid platform"

Fixes: 3adcba9a8987 ("net/ena: update HAL to the newer version")

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
6 years agoeventdev: fix Rx SW adapter stop
Nikhil Rao [Mon, 4 Jun 2018 12:55:17 +0000 (18:25 +0530)]
eventdev: fix Rx SW adapter stop

The Rx adapter stop call does not guarantee that the
SW service function will not execute after the
rte_event_eth_rx_adapter_stop() call.

Add a "started" flag to prevent the adapter from executing
if stop has been called.

Fixes: 9c38b704d280 ("eventdev: add eth Rx adapter implementation")
Cc: stable@dpdk.org
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
6 years agoeventdev: fix internal port logic in Rx adapter
Nikhil Rao [Sun, 3 Jun 2018 14:10:46 +0000 (19:40 +0530)]
eventdev: fix internal port logic in Rx adapter

Set the internal_event_port flag when the ethdev-eventdev
packet transfer is implemented in hardware and add a check
for the flag to ignore the connection when setting up the
WRR polling sequence.

Fixes: 9c38b704d280 ("eventdev: add eth Rx adapter implementation")
Cc: stable@dpdk.org
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoeventdev: add event buffer flush in Rx adapter
Nikhil Rao [Sun, 3 Jun 2018 12:42:25 +0000 (18:12 +0530)]
eventdev: add event buffer flush in Rx adapter

Add an event buffer flush when the current invocation
of the Rx adapter is completed.

This patch provides lower latency in case there is a
BATCH_SIZE of events in the event buffer.

Cc: stable@dpdk.org
Suggested-by: Narender Vangati <narender.vangati@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoeventdev: fix missing update to Rx adaper WRR position
Nikhil Rao [Sun, 3 Jun 2018 11:41:08 +0000 (17:11 +0530)]
eventdev: fix missing update to Rx adaper WRR position

After dequeuing Rx packets and enqueueing them to the
temporary buffer towards eventdev, the packet Rx loop exits
if the temporary buffer is full but the current WRR position
is not saved.

Save away the current value of the WRR position, so packets
are dequeued from the correct Rx queue in the next invocation.

Fixes: 9c38b704d280 ("eventdev: add eth Rx adapter implementation")
Cc: stable@dpdk.org
Suggested-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
6 years agotest/eventdev: add multi-ports test
Vipin Varghese [Mon, 21 May 2018 13:53:55 +0000 (19:23 +0530)]
test/eventdev: add multi-ports test

Add a new test to enhance the test suite, to allow multiple eth ports
rx queue to be added to rx bridge adapter. Update the test function to
reflect change of port index from 8 to 16 bit

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agodoc: fix octeontx eventdev selftest argument
Jerin Jacob [Fri, 8 Jun 2018 03:32:27 +0000 (09:02 +0530)]
doc: fix octeontx eventdev selftest argument

Fixes: 3516327e00fd ("event/octeontx: add selftest to device arguments")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>