dpdk.git
5 years agobuild: add workarounds for Windows helloworld
Anand Rawat [Tue, 2 Apr 2019 03:54:58 +0000 (20:54 -0700)]
build: add workarounds for Windows helloworld

Added meson workarounds to build helloworld on Windows.
Windows currently only supports kvargs and eal libraries.
This change restricts the build flow to supported libraries
only.

Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
5 years agoeal/windows: add minimum viable code
Anand Rawat [Tue, 2 Apr 2019 03:54:56 +0000 (20:54 -0700)]
eal/windows: add minimum viable code

Add Windows specific logic for eal.c, eal_lcore.c,
eal_debug.c and eal_thread.c. Updated header files to
contain suitable function declarations.

Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
5 years agoeal/windows: add headers for compatibility
Anand Rawat [Tue, 2 Apr 2019 03:54:55 +0000 (20:54 -0700)]
eal/windows: add headers for compatibility

Added headers to support Windows environment for common source.
These headers will have Windows specific implementions of the
system library APIs provided in Linux and FreeBSD.

Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
5 years agoeal/windows: add sys/queue.h implementation copy
Anand Rawat [Tue, 2 Apr 2019 03:54:54 +0000 (20:54 -0700)]
eal/windows: add sys/queue.h implementation copy

Adding sys/queue.h on Windows for supporting common code.
This implementation has BSD-3-Clause licensing.

Signed-off-by: Ranjit Menon <ranjit.menon@intel.com>
Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
5 years agobuild: add module definition files for Windows
Anand Rawat [Tue, 2 Apr 2019 03:54:53 +0000 (20:54 -0700)]
build: add module definition files for Windows

Updated lib/meson.build to create shared libraries on Windows.
Added DEF files to list the exports for the eal and kvargs libraries.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
5 years agoeal/windows: add wrappers for string functions
Anand Rawat [Tue, 2 Apr 2019 03:54:52 +0000 (20:54 -0700)]
eal/windows: add wrappers for string functions

Updated rte_common.h to include rte_os.h to contain
OS specific macros and functions. Updated rte_string_fns.h
to include rte_common.h for rte_os.h

Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
5 years agoeal: add OS specific header file
Anand Rawat [Tue, 2 Apr 2019 03:54:51 +0000 (20:54 -0700)]
eal: add OS specific header file

Added rte_os.h files to support OS specific functionality.
Updated build system to contain OS headers in the include
path.

Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com>
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoeal/windows: introduce Windows support
Anand Rawat [Tue, 2 Apr 2019 03:54:49 +0000 (20:54 -0700)]
eal/windows: introduce Windows support

Added initial stub source files and required meson changes
for Windows support.

kernel/windows/meson is a stub file added to support
Windows specific source in future releases.

Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
5 years agoeal: remove exec-env directory
Thomas Monjalon [Mon, 1 Apr 2019 23:07:12 +0000 (01:07 +0200)]
eal: remove exec-env directory

Only one header file (rte_kni_common.h) was in the sub-directory
include/exec-env/
This file was installed in a sub-directory of the same name
in the makefile-based build.
Source and install directories are moved as below:

   lib/librte_eal/linux/eal/include/exec-env/
-> lib/librte_eal/linux/eal/include/

   build/include/exec-env/
-> build/include/

The consequence is to have a file hierarchy a bit more flat.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agombuf: remove Intel offload checks from generic API
Andrew Rybchenko [Fri, 29 Mar 2019 13:42:14 +0000 (13:42 +0000)]
mbuf: remove Intel offload checks from generic API

rte_validate_tx_offload() is used in Tx prepare callbacks
(RTE_LIBRTE_ETHDEV_DEBUG only) to check Tx offloads consistency.
Requirement that packet headers should not be fragmented is not
documented and unclear where it comes from except
rte_net_intel_cksum_prepare() functions which relies on it.

It could be NIC vendor specific driver or hardware limitation, but,
if so, it should be documented and checked in corresponding Tx
prepare callbacks.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
5 years agomem: do not use lockfiles for single file segments mode
Anatoly Burakov [Fri, 29 Mar 2019 17:55:29 +0000 (17:55 +0000)]
mem: do not use lockfiles for single file segments mode

Due to internal glibc limitations [1], DPDK may exhaust internal
file descriptor limits when using smaller page sizes, which results
in inability to use system calls such as select() by user
applications.

Single file segments option stores lock files per page to ensure
that pages are deleted when there are no more users, however this
is not necessary because the processes will be holding onto the
pages anyway because of mmap(). Thus, removing pages from the
filesystem is safe even though they may be used by some other
secondary process. As a result, single file segments mode no
longer stores inordinate amounts of segment fd's, and the above
issue with fd limits is solved.

However, this will not work for legacy mem mode. For that, simply
document that using bigger page sizes is the only option.

[1] https://mails.dpdk.org/archives/dev/2019-February/124386.html

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agomem: refactor segment resizing function
Anatoly Burakov [Fri, 29 Mar 2019 17:55:28 +0000 (17:55 +0000)]
mem: refactor segment resizing function

Currently, segment resizing code sits in one giant function which
handles both in-memory and regular modes. Split them up into
individual functions.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoeal: initialize alarms early
Darek Stojaczyk [Mon, 1 Apr 2019 14:18:14 +0000 (16:18 +0200)]
eal: initialize alarms early

On Linux, we currently initialize rte_alarms after
starting to listen for IPC hotplug requests, which gives
us a data race window. Upon receiving such hotplug
request we always try to set an alarm and this obviously
doesn't work if the alarms weren't initialized yet.

To fix it, we initialize alarms before starting to
listen for IPC hotplug messages. Specifically, we move
rte_eal_alarm_init() right after rte_eal_intr_init() as
it makes some sense to keep those two close to each other.

We update the BSD code as well to keep the initialization
order the same in both EAL implementations.

Fixes: 244d5130719c ("eal: enable hotplug on multi-process")
Cc: stable@dpdk.org
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
5 years agoeal: increase max number of interrupt vectors
Pavan Nikhilesh [Sun, 31 Mar 2019 14:55:20 +0000 (14:55 +0000)]
eal: increase max number of interrupt vectors

MSI-X permits a device to allocate up to 2048 interrupts as per PCIe
spec.
Increase the max number of vectors to a reasonable value of 512.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agomaintainers: update for IBM POWER
David Christensen [Wed, 27 Mar 2019 22:31:39 +0000 (15:31 -0700)]
maintainers: update for IBM POWER

Succeed Chao Zhu as maintainer of EAL for IBM POWER.

Cc: stable@dpdk.org
Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
5 years agomaintainers: claim responsibility for timer library
Erik Gabriel Carrillo [Mon, 11 Mar 2019 16:13:09 +0000 (11:13 -0500)]
maintainers: claim responsibility for timer library

Add myself as co-maintainer for the timer library.

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Acked-by: Robert Sanford <rsanford@akamai.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoapp/test: fix sprintf with strlcat
Pallantla Poornima [Wed, 13 Mar 2019 11:07:23 +0000 (11:07 +0000)]
app/test: fix sprintf with strlcat

sprintf function is not secure as it doesn't check the length of string.
More secure function strlcat is used.

Fixes: 727909c592 ("app/test: introduce dynamic commands list")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Reviewed-by: Aaron Conole <aconole@redhat.com>
5 years agotelemetry: fix mapping of statistics
Bruce Richardson [Thu, 28 Mar 2019 15:30:45 +0000 (15:30 +0000)]
telemetry: fix mapping of statistics

If we have two NIC ports which have a different set of NIC stats we can
end up having two different stats registered with xstats with the same
name. [Since the stats are updated in bulk as a contiguous set, the
second driver re-using the registration of the first is not possible.]

This causes issues with the invalid stat for one driver being found due to
a lookup by name which is unnecessary. Instead of getting stat names
involved do the lookup by ID instead.

Fixes: 1b756087db93 ("telemetry: add parser for client socket messages")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
5 years agoexamples/distributor: detect high frequency cores
David Hunt [Mon, 1 Apr 2019 16:14:41 +0000 (17:14 +0100)]
examples/distributor: detect high frequency cores

The distributor application is bottlenecked by the distributor core,
so if we can give more frequency to this core, then the overall
performance of the application may increase.

This patch uses the rte_power_get_capabilities() API to query the
cores provided in the core mask, and if any high frequency cores are
found (e.g. Turbo Boost is enabled), we will pin the distributor
workload to that core.

Signed-off-by: Liang Ma <liang.j.ma@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agopower: add bit for high frequency cores
David Hunt [Mon, 1 Apr 2019 16:14:40 +0000 (17:14 +0100)]
power: add bit for high frequency cores

This patch adds a new bit in the capabilities mask that's returned by
rte_power_get_capabilities(), allowing application to query which cores
have the higher frequencies, and can then pin the workloads accordingly.

Returned Bits:
 0 - Turbo Boost enabled
 1 - Higher core base_frequency

Signed-off-by: Liang Ma <liang.j.ma@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agopower: fix governor storage to trim newlines
David Hunt [Fri, 29 Mar 2019 16:39:20 +0000 (16:39 +0000)]
power: fix governor storage to trim newlines

Currently the Power Libray stores the governor name with an embedded
newline read from the scaling_governor sysfs file. This patch strips
it out.

Fixes: 445c6528b55f ("power: common interface for guest and host")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agodevtools: allow test build outside source directory
Bruce Richardson [Mon, 1 Apr 2019 16:08:33 +0000 (17:08 +0100)]
devtools: allow test build outside source directory

The test-meson-builds.sh script correctly detects the source directory and
builds the native builds successfully in a directory outside of the source
tree. However, the paths to the cross-files are not prefixed with the
source directory path, so the cross-builds all fail. Fix this by prepending
the source directory path appropriately.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agobuild: fix meson build in CI environments
Ali Alnubani [Mon, 1 Apr 2019 15:38:59 +0000 (15:38 +0000)]
build: fix meson build in CI environments

This is to fix a build error with meson in GNU/Linux that is caused
by using the 'more' command to read the VERSION file. The error:

    config/meson.build:10:10: ERROR:  String
    '::::::::::::::\n<RTE_SDK_PATH>VERSION\n::::::::::::::\n19' cannot be
    converted to int

The command 'more' prints the file name before the actual
contents of the file when it's being run without a controlling terminal.
This could happen in CI environments.

Please refer to:
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/text-utils/more.c

Fixes: c04172b5f031 ("build: add single source of DPDK version number")
Fixes: d320fe56bd51 ("build: use version number from config file")

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agonet: add PPPoE ethertypes
Nemanja Marjanovic [Mon, 21 Jan 2019 11:11:24 +0000 (11:11 +0000)]
net: add PPPoE ethertypes

Add PPPoE ethertypes in to rte_ether.h.

Signed-off-by: Nemanja Marjanovic <nemanja.marjanovic@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
5 years agonet/softnic: support QinQ PPPoE encapsulation
Nemanja Marjanovic [Mon, 21 Jan 2019 11:11:23 +0000 (11:11 +0000)]
net/softnic: support QinQ PPPoE encapsulation

Add implementation of QinQ PPPoE packet encapsulation action.

Signed-off-by: Nemanja Marjanovic <nemanja.marjanovic@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
5 years agoexamples/ip_pipeline: support QinQ PPPoE encapsulation
Nemanja Marjanovic [Mon, 21 Jan 2019 11:11:22 +0000 (11:11 +0000)]
examples/ip_pipeline: support QinQ PPPoE encapsulation

Add implementation of QinQ PPPoE packet encapsulation action.

Signed-off-by: Nemanja Marjanovic <nemanja.marjanovic@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
5 years agopipeline: support QinQ PPPoE encapsulation
Nemanja Marjanovic [Mon, 21 Jan 2019 11:11:21 +0000 (11:11 +0000)]
pipeline: support QinQ PPPoE encapsulation

Add support of QinQ PPPoE packet encapsulation action.

Signed-off-by: Nemanja Marjanovic <nemanja.marjanovic@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
5 years agometer: fix divide by zero for RFC4115
Eelco Chaudron [Tue, 19 Mar 2019 12:10:44 +0000 (12:10 +0000)]
meter: fix divide by zero for RFC4115

RFC 4115 allows a meter with either cir and/or eir configured.
When only one is configured a divide by zero would occur.

Fixes: 655796d2b5fb ("meter: support RFC4115 trTCM")

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
5 years agoapp/testpmd: make txonly mode generate multiple flows
Yongseok Koh [Thu, 28 Mar 2019 18:46:28 +0000 (11:46 -0700)]
app/testpmd: make txonly mode generate multiple flows

Testpmd can generate multiple flows without taking much cost and this
could be a simple traffic generator for developer's quick tests.
If "--txonly-multi-flow" is specified in the command line, IP source
address is varied to generate multiple flows.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agoapp/testpmd: verify MTU with device provided limits
Ian Stokes [Fri, 29 Mar 2019 17:52:19 +0000 (17:52 +0000)]
app/testpmd: verify MTU with device provided limits

This commit uses the MTU fields populated in rte_eth_dev_info_get()
to validate the MTU value being passed in port_mtu_set().

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/e1000: set min and max MTU
Ian Stokes [Fri, 29 Mar 2019 17:52:18 +0000 (17:52 +0000)]
net/e1000: set min and max MTU

This commit sets the min and max supported MTU values for igb devices
via the eth_igb_info_get() function. Min MTU supported is set to
ETHER_MIN_MTU and max MTU is calculated as the max packet length
supported minus the transport overhead. To aid in these calculations
a new MACRO 'E1000_ETH_OVERHEAD' has been introduced to consolidate
overhead calculation and avoid duplication.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ixgbe: set min and max MTU for VF
Ian Stokes [Fri, 29 Mar 2019 17:52:17 +0000 (17:52 +0000)]
net/ixgbe: set min and max MTU for VF

This commit sets the min and max supported MTU values for ixgbe VF
devices via the ixgbevf_dev_set_mtu() function. Min MTU supported is
set to ETHER_MIN_MTU and max MTU is calculated as the max packet length
supported minus the transport overhead. As transport overhead is the
same for VF and PF ixgbe devices, reuse MACRO 'IXGBE_ETH_OVERHEAD' to
avoid duplication.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ixgbe: set min and max MTU
Ian Stokes [Fri, 29 Mar 2019 17:52:16 +0000 (17:52 +0000)]
net/ixgbe: set min and max MTU

This commit sets the min and max supported MTU values for ixgbe devices
via the ixgbe_dev_info_get() function. Min MTU supported is set to
ETHER_MIN_MTU and max MTU is calculated as the max packet length
supported minus the transport overhead. To aid in these calculations
a new MACRO 'IXGBE_ETH_OVERHEAD' has been introduced to consolidate
overhead calculation and avoid duplication.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/i40e: set min and max MTU for VF
Ian Stokes [Fri, 29 Mar 2019 17:52:15 +0000 (17:52 +0000)]
net/i40e: set min and max MTU for VF

This commit sets the min and max supported MTU values for i40e VF
devices via the i40evf_dev_info_get() function. Min MTU supported
is set to ETHER_MIN_MTU and max MTU is calculated as the max packet
length supported minus the transport overhead.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/i40e: set min and max MTU
Ian Stokes [Fri, 29 Mar 2019 17:52:14 +0000 (17:52 +0000)]
net/i40e: set min and max MTU

This commit sets the min and max supported MTU values for i40e devices
via the i40e_dev_info_get() function. Min MTU supported is set to
ETHER_MIN_MTU and max mtu is calculated as the max packet length
supported minus the transport overhead.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoethdev: add min/max MTU to device info
Stephen Hemminger [Fri, 29 Mar 2019 17:52:13 +0000 (17:52 +0000)]
ethdev: add min/max MTU to device info

This addresses the usability issue raised by OVS at DPDK Userspace
summit. It adds general min/max MTU into device info. For compatibility,
and to save space, it fits in a hole in existing structure.

The initial version sets max MTU to normal Ethernet, it is up to
PMD to set larger value if it supports Jumbo frames.

Also remove the deprecation notice introduced in 18.11 regarding this
change and bump ethdev ABI version.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: fix speed capability
Chenmin Sun [Fri, 29 Mar 2019 09:53:51 +0000 (17:53 +0800)]
net/ice: fix speed capability

Device speed capability should be specified based on different PHY types
instead of a fixed value, this patch fix the issue.

Fixes: 690175ee51bf ("net/ice: support getting device information")
Cc: stable@dpdk.org
Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/virtio: remove useless condition
Stephen Hemminger [Wed, 27 Mar 2019 21:08:43 +0000 (14:08 -0700)]
net/virtio: remove useless condition

Since previous test is for mtu < 1519 the next else if
is always true. This causes the lgtm static tool to complain.
Not a real issue, just cosmetic.

Fixes: 76d4c652e07d ("virtio: add extended stats")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/netvsc: remove useless condition
Stephen Hemminger [Wed, 27 Mar 2019 21:08:42 +0000 (14:08 -0700)]
net/netvsc: remove useless condition

Since previous test is for mtu < 1519 the next else if
is always true. This causes the lgtm static tool to complain.
Not a real issue, just cosmetic.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
5 years agoraw/ifpga: modify log output
Andy Pei [Wed, 27 Mar 2019 01:32:57 +0000 (09:32 +0800)]
raw/ifpga: modify log output

Print function name in ifpga log and a new line goes after
every IFPGA log.

Fixes: ef1e8ede3da5 ("raw/ifpga: add Intel FPGA bus rawdev driver")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
5 years agonet/mlx5: add source vport match to the ingress rules
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:47 +0000 (13:15 +0000)]
net/mlx5: add source vport match to the ingress rules

For E-Switch configurations over multiport Infiniband devices
we should add source vport match to correctly distribute
traffic between representors.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: update event handler for multiport IB devices
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:46 +0000 (13:15 +0000)]
net/mlx5: update event handler for multiport IB devices

This patch modifies asynchronous event handler to support multiport
Infiniband devices. Handler queries the event parameters, including
event source port index, and invokes the handler for specific
devices with appropriate port_id.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: update install/uninstall event handlers
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:45 +0000 (13:15 +0000)]
net/mlx5: update install/uninstall event handlers

We are implementing the support for multiport Infiniband device
with representors attached to these multiple ports. Asynchronous
device event notifications (link status change, removal event, etc.)
should be shared between ports. We are going to implement shared
event handler and this patch introduces appropriate device
structure changes and updated event handler install and uninstall
routines.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: provide IB port for the object being created
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:44 +0000 (13:15 +0000)]
net/mlx5: provide IB port for the object being created

The code is updated to provide IB port index for the Verbs
objects being created - QPs and Verbs Flows.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: switch to the shared IB device context
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:43 +0000 (13:15 +0000)]
net/mlx5: switch to the shared IB device context

The code is updated to use the shared IB device context and
device handles. The IB device context is shared between
reprentors created over the single multiport IB device. All
Verbs and DevX objects will be created within this shared context.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: switch to the shared context IB attributes
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:42 +0000 (13:15 +0000)]
net/mlx5: switch to the shared context IB attributes

The code is updated to use the shared IB device attributes,
located in the shared IB context. It saves some memory if
there are representors created over the single Infiniband
device with multiple ports.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: switch to the shared protection domain
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:41 +0000 (13:15 +0000)]
net/mlx5: switch to the shared protection domain

The PMD code is updated to use Protected Domain from the
shared IB device context. The Domain is shared between
all devices belonging to the same multiport Infiniband device.
If IB device has only one port, the PD is not shared, because
there is only ethernet device created over IB one.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: switch to the names in the shared IB context
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:40 +0000 (13:15 +0000)]
net/mlx5: switch to the names in the shared IB context

The IB device names are moved from device private data
to the shared context, code involving the names is updated.
The IB port index treatment is added where it is relevant.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add IB shared context alloc/free functions
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:39 +0000 (13:15 +0000)]
net/mlx5: add IB shared context alloc/free functions

The Mellanox NICs support SR-IOV and have E-Switch feature.
When SR-IOV is set up in switchdev mode and E-Switch is enabled
we have so called VF representors in the system. All representors
belonging to the same E-Switch are created on the basis of the
single PCI function and with current implementation each representor
has its own dedicated Infiniband device and operates within its
own Infiniband context. It is proposed to provide representors
as ports of the single Infiniband device and operate on the
shared Infiniband context saving various resources. This patch
introduces appropriate structures.

Also the functions to allocate and free shared IB context for
multiport are added. The IB device context, Protection Domain,
device attributes, Infiniband names are going to be relocated
to the shared structure from the device private one.
mlx5_dev_spawn() is updated to support shared context.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: support multiport IB device during probing
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:38 +0000 (13:15 +0000)]
net/mlx5: support multiport IB device during probing

mlx5_pci_probe() routine is refactored to probe the ports
of found Infiniband devices. All active ports (with attached
network interface), belonging to the same Infiniband device
will use the single shared Infiniband context of that device.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add getting IB ports number for multiport IB
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:37 +0000 (13:15 +0000)]
net/mlx5: add getting IB ports number for multiport IB

There is the routine mlx5_nl_portnum() added to get
the number of ports of multiport Infiniband device.
It is assumed the Uplink/VF representors are attached
on these ports.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: modify get ifindex routine for multiport IB
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:36 +0000 (13:15 +0000)]
net/mlx5: modify get ifindex routine for multiport IB

There is the routine mlx5_nl_ifindex() returning the
network interface index associated with Infiniband device.
We are going to support multiport IB devices, now function
takes the IB port as argument and returns ifindex associated
with tuple <IB device, IB port>

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add representor recognition on Linux 5.x
Viacheslav Ovsiienko [Wed, 27 Mar 2019 13:15:35 +0000 (13:15 +0000)]
net/mlx5: add representor recognition on Linux 5.x

The master device and VF representors were distinguished by
presence of port name, master device did not have one. The new Linux
kernels starting from 5.0 provide the port name for master device
and the implemented representor recognizing method does not work.
The new recognizing method is based on querying the VF number,
has been created on the base of the device.

The IFLA_NUM_VF attribute is returned by kernel if IFLA_EXT_MASK
attribute is specified in the Netlink request message.

Also the presence check of device symlink in device sysfs folder
is added to distinguish representors with sysfs based method.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agovhost/crypto: fix parens
Fan Zhang [Mon, 25 Mar 2019 14:37:31 +0000 (14:37 +0000)]
vhost/crypto: fix parens

Coverity issue: 277214, 277220, 277233, 277236
Fixes: cd1e8f03abf0 ("vhost/crypto: fix packet copy in chaining mode")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: define avail and used flags as constants
Tiwei Bie [Mon, 25 Mar 2019 05:27:16 +0000 (13:27 +0800)]
net/virtio: define avail and used flags as constants

We are consistently passing 1 as the argument in the data path,
so there is no need to define avail/used flags as function-like
macros anymore. This patch changes the avail and used flags to
constants. And a frequently used combination is also introduced.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio-user: fix multi-process support
Tiwei Bie [Mon, 25 Mar 2019 04:12:15 +0000 (12:12 +0800)]
net/virtio-user: fix multi-process support

This patch fixes the multi-process support for virtio-user.
Currently virtio-user just provides some limited secondary
process supports. Only some basic operations can be done in
secondary process on virtio-user port, e.g. getting port stats.
Actions which will trigger the communication with vhost backend
can't be done in secondary process for now, as the fds are
not synced between processes. The processing of server mode
devargs is also moved into virtio_user_dev_init().

Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel")
Fixes: ee27edbe0c10 ("drivers/net: share vdev data to secondary process")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: fix duplicate naming of include guard
Andrius Sirvys [Thu, 21 Mar 2019 10:09:53 +0000 (10:09 +0000)]
net/virtio: fix duplicate naming of include guard

"The macro name '_VHOST_NET_USER_H' of this include guard is used
in 2 different header files."

lib/librte_vhost/vhost_user.h has the same include guard.
Renamed the include guard in vhost.h to differentiate.

Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer")
Cc: stable@dpdk.org
Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/nfp: support setting link up/down
Pablo Cascón [Wed, 27 Mar 2019 10:27:39 +0000 (10:27 +0000)]
net/nfp: support setting link up/down

Add functions to set the link state up or down.

Signed-off-by: Pablo Cascón <pablo.cascon@netronome.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agonet/fm10k: fix VLAN strip offload flag
Xiao Wang [Wed, 27 Mar 2019 05:09:03 +0000 (13:09 +0800)]
net/fm10k: fix VLAN strip offload flag

Since the VLAN header is stripped from mbuf data, PKT_RX_VLAN_STRIPPED
should be set in offload flag.

Fixes: 6b59a3bc82b1 ("fm10k: fix VLAN in Rx mbuf")
Fixes: 7092be8437bd ("fm10k: add vector Rx")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
5 years agonet/failsafe: support secondary process
Raslan Darawsheh [Mon, 18 Mar 2019 16:05:27 +0000 (16:05 +0000)]
net/failsafe: support secondary process

Add implementation for probe in secondary.

Failsafe will attempt to attach all the sub-devices in
secondary process.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/failsafe: replace sub-device pointer with port id
Raslan Darawsheh [Mon, 18 Mar 2019 16:05:27 +0000 (16:05 +0000)]
net/failsafe: replace sub-device pointer with port id

In multiprocess context, the pointer to sub-device is shared between
processes. Previously, it was a pointer to per process eth_dev so
it's needed to replace this dependency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/failsafe: change back-reference from sub-device
Raslan Darawsheh [Mon, 18 Mar 2019 16:05:26 +0000 (16:05 +0000)]
net/failsafe: change back-reference from sub-device

In multiprocess context, the sub-device structure is shared
between processes. The reference to the failsafe device was
a per process pointer. It's changed to port id which is the
same for all processes.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/failsafe: replace local device with shared data
Raslan Darawsheh [Mon, 18 Mar 2019 16:05:25 +0000 (16:05 +0000)]
net/failsafe: replace local device with shared data

In multiprocess context, the private structure is shared between
processes. The back reference from private to generic data was using
a pointer to a per process eth_dev. It's now changed to a reference of
the shared data.

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/mlx5: add missing return value check
Ali Alnubani [Thu, 21 Mar 2019 09:07:26 +0000 (09:07 +0000)]
net/mlx5: add missing return value check

This patch fixes the build failure with message:
  drivers/net/mlx5/mlx5_ethdev.c: In function â€˜mlx5_sysfs_switch_info’:
  drivers/net/mlx5/mlx5_ethdev.c:1381:3:
    error: ignoring return value of â€˜fscanf’, declared with attribute
           warn_unused_result [-Werror=unused-result]
  fscanf(file, "%s", port_name);
    ^

Which reproduces on Ubuntu 16.04 LTS with
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609.

Fixes: b2f3a3810125 ("net/mlx5: support new representor naming format")

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Dekel Peled <dekelp@mellanox.com>
5 years agonet/bnxt: fix Rx VLAN offload flags
Stephen Hemminger [Mon, 25 Mar 2019 21:27:54 +0000 (14:27 -0700)]
net/bnxt: fix Rx VLAN offload flags

The bnxt driver is not correctly setting the receive VLAN offload
flags.  When VLAN is offloaded the driver must set the
PKT_RX_VLAN_STRIPPED flag.

Actually, several drivers have the same bug, only most of the
Intel drivers look right. Any driver that sets vlan_tci is probably
stripping the tag, and should be setting RX_VLAN_STRIPPED.

To quote rte_mbuf.h:

/**
 * The RX packet is a 802.1q VLAN packet, and the tci has been
 * saved in in mbuf->vlan_tci.
 * If the flag PKT_RX_VLAN_STRIPPED is also present, the VLAN
 * header has been stripped from mbuf data, else it is still
 * present.
 */

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/i40e: log when provided RSS key is not valid
Wei Zhao [Tue, 26 Mar 2019 08:35:24 +0000 (16:35 +0800)]
net/i40e: log when provided RSS key is not valid

A log message is required when provided RSS key is
not valid so that driver will use the default RSS key.

Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: enable RSS when device init
Qiming Yang [Mon, 25 Mar 2019 09:01:02 +0000 (17:01 +0800)]
net/ice: enable RSS when device init

This patch enabled RSS for UPD/TCP/SCTP+IPV4/IPV6 packets.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: add safe mode
Qiming Yang [Mon, 25 Mar 2019 09:01:01 +0000 (17:01 +0800)]
net/ice: add safe mode

If E810 download package failed, driver need to go to safe mode.
In the safe mode, some advanced features will not be supported.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ice: load OS default package
Qiming Yang [Mon, 25 Mar 2019 09:01:00 +0000 (17:01 +0800)]
net/ice: load OS default package

This patch enables package downloading to the device. The package is
to be in the /lib/firmware/intel/ice/ddp directory and named ice.pkg.
The package is shared by the kernel driver and the DPDK PMD.

There is no per device package be supported so far, all the
devices can only download the same package. This limitation will
be removed in the future.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agoethdev: fix a typo
Rami Rosen [Fri, 22 Mar 2019 15:17:53 +0000 (17:17 +0200)]
ethdev: fix a typo

This patch fixes a trivial typo in rte_ethdev.h.
retieve=>retrieve

Fixes: 80a1deb4c77a ("ethdev: add API to retrieve queue information")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: display/clear forwarding stats on demand
David Marchand [Mon, 25 Mar 2019 08:51:46 +0000 (09:51 +0100)]
app/testpmd: display/clear forwarding stats on demand

Add a new "show/clear fwd stats all" command to display fwd and port
statistics on the fly.

To be able to do so, the (testpmd only) rte_port structure can't be used
to maintain any statistics.
Moved the stats dump parts from stop_packet_forwarding() and merge with
fwd_port_stats_display() into fwd_stats_display().
fwd engine statistics are then aggregated into a local per port array.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: remove useless casts on statistics
David Marchand [Mon, 25 Mar 2019 08:51:45 +0000 (09:51 +0100)]
app/testpmd: remove useless casts on statistics

Caught by code review while investigating the fwd stats display code.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: extend forwarding statistics to 64 bits
David Marchand [Mon, 25 Mar 2019 08:51:44 +0000 (09:51 +0100)]
app/testpmd: extend forwarding statistics to 64 bits

fwd engine statistics are stored as unsigned int (32bits) and can wrap
quite quickly.
Example: sending 7mpps for 614s gives us 4298000000 packets =>
0x1002e4680 larger than 32bits.

testpmd reports forwarding stats as:
RX-packets: 3500381        TX-packets: 3500010        TX-dropped: 371

While the port and accumulated stats are reported as 64bits:
RX-packets: 4298467677     RX-dropped: 0             RX-total: 4298467677
TX-packets: 4298467306     TX-dropped: 371           TX-total: 4298467677

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: add missing newline when showing statistics
David Marchand [Mon, 25 Mar 2019 08:51:43 +0000 (09:51 +0100)]
app/testpmd: add missing newline when showing statistics

Having the standard stats and the rx burst stats on the same line gives a
really long line and is not consistent with the rest.

Before:
iofwd engine
  RX-packets: 121811360      TX-packets: 121811392      TX-dropped: 0               RX-bursts : 3806605 [100% of 32 pkts]
  TX-bursts : 3806606 [100% of 32 pkts]

csum engine
  RX-packets: 5467488        TX-packets: 5467520        TX-dropped: 0               RX- bad IP checksum: 0               Rx- bad L4 checksum: 0              Rx- bad outer L4 checksum: 0
  RX-bursts : 170859 [100% of 32 pkts]
  TX-bursts : 170860 [100% of 32 pkts]

After:
iofwd engine
  RX-packets: 259770560      TX-packets: 259770592      TX-dropped: 0
  RX-bursts : 8117830 [100% of 32 pkts]
  TX-bursts : 8117831 [100% of 32 pkts]

csum engine
  RX-packets: 7834016        TX-packets: 7834048        TX-dropped: 0               RX- bad IP checksum: 0               Rx- bad L4 checksum: 0              Rx- bad outer L4 checksum: 0
  RX-bursts : 244813 [100% of 32 pkts]
  TX-bursts : 244814 [100% of 32 pkts]

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/vdev_netvsc: fix device cast
Stephen Hemminger [Wed, 13 Mar 2019 02:12:53 +0000 (19:12 -0700)]
net/vdev_netvsc: fix device cast

The return value from bus->find_device is a rte_device
which is not safe to cast to a rte_vdev_device structure.
It doesn't really matter since only being checked for NULL
but static checkers might find a bug here.

Fixes: 56252de779a6 ("net/vdev_netvsc: add automatic probing")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Matan Azrad <matan@mellanox.com>
5 years agonet/ice/base: rework on bit ops
Qi Zhang [Mon, 25 Mar 2019 05:44:52 +0000 (13:44 +0800)]
net/ice/base: rework on bit ops

Move all bit ops related functions from ice_osdep.h into ice_bitops.h.
Also remove the limitation that bitmap can only be 64 bits in
ice_set_bit and ice_clear_bit.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: revert workaround for resource allocation
Qi Zhang [Mon, 25 Mar 2019 05:44:51 +0000 (13:44 +0800)]
net/ice/base: revert workaround for resource allocation

Revert the workaround for allocating TCAM and FV entries to align
with latest firmware.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: increase protocol offset size
Qi Zhang [Mon, 25 Mar 2019 05:44:50 +0000 (13:44 +0800)]
net/ice/base: increase protocol offset size

OS package's format is changed, field vector's protocol offset size is
changed from 8 bit to 16 bit. So base code also need to align to this,
or PMD will not be able to load OS package correctly.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: fix minor issues
Qi Zhang [Mon, 25 Mar 2019 05:44:49 +0000 (13:44 +0800)]
net/ice/base: fix minor issues

1. clean flow entry's action structure after remove it.
2. initialized priority when add a new flow entry
3. remove RSS configuration before deleting the flow profile.

Fixes: aa1cd410fa64 ("net/ice/base: add flow module")
Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module")

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: fix duplicate resource allocations
Qi Zhang [Mon, 25 Mar 2019 05:44:48 +0000 (13:44 +0800)]
net/ice/base: fix duplicate resource allocations

This patch ensure that TCAM allocations made by a newly added VSIG
that has the same characteristic list of an existing VSIG are removed.

Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module")

Signed-off-by: Vignesh Sridhar <vignesh.sridhar@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: change profile priority for RSS reply
Qi Zhang [Mon, 25 Mar 2019 05:44:47 +0000 (13:44 +0800)]
net/ice/base: change profile priority for RSS reply

1. Add call to replay RSS configurations
2. Add RSS configurations to end of list and not the head to avoid
inversion on replay.

Signed-off-by: Vignesh Sridhar <vignesh.sridhar@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: support FDIR
Qi Zhang [Mon, 25 Mar 2019 05:44:46 +0000 (13:44 +0800)]
net/ice/base: support FDIR

Add flow director related support base code.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: support DCB
Qi Zhang [Mon, 25 Mar 2019 05:44:45 +0000 (13:44 +0800)]
net/ice/base: support DCB

Add module to support DCB related features.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: change profile id reference counting
Qi Zhang [Mon, 25 Mar 2019 05:44:44 +0000 (13:44 +0800)]
net/ice/base: change profile id reference counting

Improved the profile reference counting, by moving it from being
based on how many TCAM entries using the profile to how many
profile map entries are using the profile.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add function to check FW recovery mode
Qi Zhang [Mon, 25 Mar 2019 05:44:43 +0000 (13:44 +0800)]
net/ice/base: add function to check FW recovery mode

Code added to check the FW recovery mode. This function will be
used by the drivers during init to check whether the FW is in
recovery mode or not. If FW is in recovery mode then the drivers
need to run in a recovery mode where it can allow only limited
operations. Link should be down, allow only certain AQ commands
etc.

Signed-off-by: Victor Raj <victor.raj@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: return config error without queue to disable
Qi Zhang [Mon, 25 Mar 2019 05:44:42 +0000 (13:44 +0800)]
net/ice/base: return config error without queue to disable

If there is no queue to disable, return appropriate configuration error
earlier without acquiring the lock.

Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: fix unreachable code usage
Qi Zhang [Mon, 25 Mar 2019 05:44:41 +0000 (13:44 +0800)]
net/ice/base: fix unreachable code usage

Klocwork points out some code is unreachable in
ice_get_itr_intrl_gran and ice_ptg_find_ptype.
The patch removed the unreachable code and resolved the static
analysis reported issues.

Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module")
Fixes: 453d087ccaff ("net/ice/base: add common functions")

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: update copyright time
Qi Zhang [Mon, 25 Mar 2019 05:44:40 +0000 (13:44 +0800)]
net/ice/base: update copyright time

Update copyright time to 2019.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: fix minor issues
Qi Zhang [Mon, 25 Mar 2019 05:44:39 +0000 (13:44 +0800)]
net/ice/base: fix minor issues

1. Fix some problems with filling the HW tables.
2. Fix a logic error in ice_rem_prof_from_list.

Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module")

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: remove local VSIG allocations
Qi Zhang [Mon, 25 Mar 2019 05:44:38 +0000 (13:44 +0800)]
net/ice/base: remove local VSIG allocations

If allocating a VSI to a VSIG fails the local allocations made for VSIG
profiles and change-lists will not be removed. Adding calls to free
these entries on error in VSIG management calls.

Signed-off-by: Vignesh Sridhar <vignesh.sridhar@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: do not write TCAM entries back
Qi Zhang [Mon, 25 Mar 2019 05:44:37 +0000 (13:44 +0800)]
net/ice/base: do not write TCAM entries back

Profile TCAM entry removal is handled by the firmware when
freeing the resource, so the driver does not need to write these
default entries back with an update Package action.

This patch removes writing of the TCAM entry using Update Package
command when removing it, since the entry has already been freed
by firmware.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add RSS key related macro and structures
Qi Zhang [Mon, 25 Mar 2019 05:44:36 +0000 (13:44 +0800)]
net/ice/base: add RSS key related macro and structures

Add define for 52 byte RSS hash key size, and add struct
ice_aqc_get_set_rss_keys comments regarding setting 40 bytes and
52 byte hash key.

Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: enhance get link status command
Qi Zhang [Mon, 25 Mar 2019 05:44:35 +0000 (13:44 +0800)]
net/ice/base: enhance get link status command

Extend the functionality of the admin queue command by including
additional status and ID bits to improve link topology configuration.

Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: ensure only valid bits are set
Qi Zhang [Mon, 25 Mar 2019 05:44:34 +0000 (13:44 +0800)]
net/ice/base: ensure only valid bits are set

In the ice_aq_set_phy_cfg AQ command, the 16.4 bit is reserved.
This patch will make sure that this bit will never be set to 1.

Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: enable VSI queue context
Qi Zhang [Mon, 25 Mar 2019 05:44:33 +0000 (13:44 +0800)]
net/ice/base: enable VSI queue context

The patch added to retrieve the queue context and update the queue
handle for lan queues.

Signed-off-by: Victor Raj <victor.raj@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: clean code
Qi Zhang [Mon, 25 Mar 2019 05:44:32 +0000 (13:44 +0800)]
net/ice/base: clean code

Change below function as static and also relocated code line
to align with kernel driver.

ice_aq_move_sched_elems
ice_sched_get_agg_node
ice_sched_set_node_bw_lmt
ice_sched_cfg_node_bw_alloc
ice_sched_add_agg_cfg
ice_sched_rm_agg_cfg
ice_sched_move_vsi_to_agg
ice_sched_del_rl_profile
ice_sched_rm_unused_rl_prof

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: update macros
Qi Zhang [Mon, 25 Mar 2019 05:44:31 +0000 (13:44 +0800)]
net/ice/base: update macros

Update macros for metadata and package flags.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: fix minor issues
Qi Zhang [Mon, 25 Mar 2019 05:44:30 +0000 (13:44 +0800)]
net/ice/base: fix minor issues

1. ICE_SW_LKUP_LAST need to be handled correctly in
ice_aq_alloc_free_vsi_list and ice_update_vsi_list_rule
2. ICE_SW_LKUP_ETHERTYPE_MAC need to be handled correctly in
ice_update_vsi_lkup_fltr
3. free package segment pointer during ice_deinit_hw

Fixes: c7dd15931183 ("net/ice/base: add virtual switch code")
Fixes: 453d087ccaff ("net/ice/base: add common functions")

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add helper functions for flow management
Qi Zhang [Mon, 25 Mar 2019 05:44:29 +0000 (13:44 +0800)]
net/ice/base: add helper functions for flow management

1. ice_rem_all_sw_rules_info - remove all switch rules.
2. ice_reply_all_fltr - replay all filters stored in book keeping list.

These APIs will be used when switch rule feature is enabled.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add MAC filter with marker and counter
Qi Zhang [Mon, 25 Mar 2019 05:44:28 +0000 (13:44 +0800)]
net/ice/base: add MAC filter with marker and counter

1. ice_add_mac_with_sw_marker - add filter with software marker.
2. ice_add_mac_with_counter - add filter with counter enabled.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>