Commit Graph

105 Commits

Author SHA1 Message Date
Bruce Richardson
4ad4b20a79 drivers: change indentation in build files
Switch from using tabs to 4 spaces for meson.build indentation.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2021-04-21 14:04:09 +02:00
Li Zhang
784b83495b net/mvpp2: check meter packet mode
Currently meter algorithms only supports bytes per second(BPS).
Check packet_mode set to TRUE are rejected.

Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Liron Himi <lironh@marvell.com>
2021-04-13 18:40:58 +02:00
Thomas Monjalon
fb7ad441d4 ethdev: replace callback getting filter operations
Since rte_flow is the only API for filtering operations,
the legacy driver interface filter_ctrl was too much complicated
for the simple task of getting the struct rte_flow_ops.

The filter type RTE_ETH_FILTER_GENERIC and
the filter operarion RTE_ETH_FILTER_GET are removed.
The new driver callback flow_ops_get replaces filter_ctrl.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-03-26 18:37:13 +01:00
Dana Vardi
4b86050aab net/mvpp2: add fill buffs to configuration file
Extend config file with 'fill_bpool_buffs'
which control the amount of refill buffers

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Dana Vardi
41c60f74d8 net/mvpp2: update QoS defaults variable name
'global_default' is only being used for 'qos'
so adding 'qos' into its name

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Dana Vardi
ef08031fc1 net/mvpp2: support forwarding bad packets
Extend the config file with option to forward packets
that were marked as "l2 bad pkts".
By default the driver drop those packets

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Dana Vardi
21aa25e033 net/mvpp2: support custom header in config file
Extend 'start_hdr' options with custom header.

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
006f6ccb44 net/mvpp2: consider packet type in checksum info
Provide checksum information based on the ptype.

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Dana Vardi
6000b5be6a net/mvpp2: update start header name in config file
Change 'dsa_mode' to 'start_hdr' in config file

Signed-off-by: Dana Vardi <danat@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
7f2ae5ddb1 net/mvpp2: apply flow control after port init
In case ppio was not initialized yet (only at 'start' function)
the flow-ctrl setting should be saved for later stage.

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Meir Levi
528ec03a6f net/mvpp2: add 2.5G link info
Update capability with 2.5G support

Signed-off-by: Meir Levi <mlevi4@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
949cdedd0c net/mvpp2: expose max MTU
Expose max-MTU based on the max frame size that
l4 checksum generation can be done by HW.

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
2021-01-29 18:16:11 +01:00
Yuri Chipchev
c0e5d09e81 net/mvpp2: update flow control autoneg disable handling
Flow control autoneg disable is not supported

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
30d3072070 net/mvpp2: introduce fixup for FIFO overrun
Currently the HW is configured with only one pool which its
buffer size may be larger than the rx-fifo-size.
In that situation, frame size larger than the fifo-size
is gets dropped due to fifo overrun.
This is cause because the HW works in cut-through mode which
waits to have in the fifo at least the amount of bytes as define
in the smallest pool's buffer size.

This patch add a dummy pool which its buffer size
is very small (smaller than 64B frame). This tricks the HW and
any frame size is gets passed from the FIFO to the PP2.

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
f85c08f795 net/mvpp2: rearrange functions order
Rearrange functions order

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
3e09b2a7dc net/mvpp2: support user defined configuration
Extend the config file with 'udf' (user-defined) settings

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
55e429ac7a net/mvpp2: skip QoS init if not requested
Skip qos init if not requested

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
cb932ddbe3 net/mvpp2: support raw flow pattern
Add support for RAW type and connect it to MUSDK UDF

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
a1559d13a1 net/mvpp2: move common functions to common location
Move common functions to common location

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
b57d1a8397 net/mvpp2: build flow table key along with rule
Currently the key is always built in network order
regardless of user input.
Besides the fact that it is not in user order,
it prevent future support for udf header between standard headers.
This patch builds the key while parsing the given rule.

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
e0ae4cf6a4 net/mvpp2: support generic flow pattern combinations
Currently only specific pattern combinations are supported.
This makes it hard to support additional pattern.
In addition there is no a real limitation that prevent any combination.
This patch iterate the input patterns and convert them to a mvpp2 API.

The doc doesn't describes those limitation so
just update the action list

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
d7eb4fb210 net/mvpp2: use generic name for global config variable
As the config file is not just for 'qos'
it is more accurate to replace the name from 'qos_cfg'
to 'cfg'

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
7da1aed6cc net/mvpp2: adjust number of unicast address
HW support 25 mac address for filtering plus one for
the primary mac address.

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Yuri Chipchev
8537663b1a net/mvpp2: add Tx flow control
Add tx flow control operations.

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
c2b5ae61c0 net/mvpp2: support DSA mode
Extend the config file with 'dsa-mode' field.
Currently 'eth' (default) and 'dsa' headers are supported.

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Liron Himi
45ea4c59e8 net/mvpp2: update Tx checksum
According to the dpdk spec, only 'ol_flags'
should be used for tx checksum generation

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Yuri Chipchev
ff0b8b10dc net/mvpp2: support VLAN offload
Enable VLAN filter configuration

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Yuri Chipchev
fc026401f4 net/mvpp2: support loopback
Add support for loopback mode

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Yuri Chipchev
5147cc7506 net/mvpp2: save initial configuration
Save configuration that was done prior 'start' as
only then the ppio is being configured.

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Yuri Chipchev
d2c37f739c net/mvpp2: align checking order
First check for 'isolated' and then for '!ppio'

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:11 +01:00
Yuri Chipchev
3617350353 net/mvpp2: do cosmetic changes to cookie usage
No need to add high address to cookie on transmit side, as it has
already 64bit value

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:10 +01:00
Yuri Chipchev
25ddbf199b net/mvpp2: update RSS tables reservation
In kernel-4.14 the pp2 kernel occupied 4 RSS tables
as opposed to 1 RSS table in older version.

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:10 +01:00
Liron Himi
1c9a958a8b net/mvpp2: fix frame size checking
Need to add CRC len to the frame-size to compare against
max_rx_pkt_len which includes it.

Fixes: 79ec62028b ("net/mvpp2: update MTU and MRU related calculations")
Cc: stable@dpdk.org

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
2021-01-29 18:16:10 +01:00
Liron Himi
31536a6892 net/mvpp2: remove CRC length from MRU validation
CRC is being removed by HW before packet get
write to the buffer, so CRC len should not be
included in MRU validation

Fixes: 79ec62028b ("net/mvpp2: update MTU and MRU related calculations")
Cc: stable@dpdk.org

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
2021-01-29 18:16:10 +01:00
Liron Himi
8fb1d5eba0 net/mvpp2: remove VLAN flush
VLAN-flush in MUSDK is not supported yet.
Until it does, the code should be removed as currently
an redundant error message is displayed.

Fixes: a8f3d6783a ("net/mrvl: support VLAN filtering")
Cc: stable@dpdk.org

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:10 +01:00
Liron Himi
fa876f3ae2 net/mvpp2: remove debug log on fast-path
In case of non-ip frame the current code reached the 'default'
case which result with function call to log a msg.
Those kind of calls should not be performed on fast-path.

The performance for this kind of frames increased by 50%

Fixes: acab7d58c8 ("net/mvpp2: convert to dynamic logging")
Cc: stable@dpdk.org

Signed-off-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:10 +01:00
Yuri Chipchev
8ce3c5db53 net/mvpp2: fix stack corruption
Fixes stack corruption in mrvl_fill_bpool function
in case num > MRVL_PP2_RXD_MAX

Fixes: c3637258d8 ("net/mrvl: fix Rx descriptors number")
Cc: stable@dpdk.org

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
2021-01-29 18:16:10 +01:00
Bruce Richardson
df96fd0d73 ethdev: make driver-only headers private
The rte_ethdev_driver.h, rte_ethdev_vdev.h and rte_ethdev_pci.h files are
for drivers only and should be a private to DPDK and not installed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Steven Webster <steven.webster@windriver.com>
2021-01-29 20:59:09 +01:00
Bruce Richardson
7be7dc6dea build: force pkg-config for dependency detection
Meson can use cmake as a fallback for detecting packages, and this can
lead to picking up 64-libs for 32-bit builds. To work around this, force
the use of pkg-config only for detecting libcrypto, zlib, jansson and
other package dependencies.

Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Liron Himi <lironh@marvell.com>
Tested-by: Lee Daly <lee.daly@intel.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Martin Spinler <spinler@cesnet.cz>
2021-01-26 00:43:59 +01:00
Pallavi Kadam
b9d60b5434 drivers/net: build i40e and mlx5 on Windows
Allows i40e and mlx5 PMDs to compile on Windows and disable other drivers.

Disable few i40e warnings with Clang such as comparison of integers of
different signs and macro redefinitions.

Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2021-01-14 23:51:24 +01:00
Liron Himi
7432c8cf8e build: update meson for Marvell Armada drivers
With pkg-config support available within musdk library
(from musdk-release-SDK-10.3.5.0-PR2 version),
meson option 'lib_musdk_dir' can be removed.
PKG_CONFIG_PATH environment variable should be set appropriately
to use the musdk library.

docs are updated with new musdk version and meson instructions.

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-08 16:03:05 +01:00
Yunjian Wang
1b2c17d60d net/mvpp2: fix memory leak in error path
In mrvl_create() allocated memory for 'mtr', we don't free it
when profile get fails and it will lead to memory leak.

We can get profile at the beginning of the function to
fix it, before calling mtr = rte_zmalloc_socket().

Fixes: cdb53f8da6 ("net/mvpp2: support metering")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Liron Himi <lironh@marvell.com>
2020-11-03 23:24:26 +01:00
Stephen Hemminger
cb056611a8 eal: rename lcore master and slave
Replace master lcore with main lcore and
replace slave lcore with worker lcore.

Keep the old functions and macros but mark them as deprecated
for this release.

The "--master-lcore" command line option is also deprecated
and any usage will print a warning and use "--main-lcore"
as replacement.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2020-10-20 13:17:08 +02:00
Bruce Richardson
63b3907833 build: remove library name from version map file name
Since each version map file is contained in the subdirectory of the library
it refers to, there is no need to include the library name in the filename.
This makes things simpler in case of library renaming.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Rosen Xu <rosen.xu@intel.com>
2020-10-19 22:13:59 +02:00
Ferruh Yigit
f30e69b41f ethdev: add device flag to bypass auto-filled queue xstats
Queue stats are stored in 'struct rte_eth_stats' as array and array size
is defined by 'RTE_ETHDEV_QUEUE_STAT_CNTRS' compile time flag.

As a result of technical board discussion, decided to remove the queue
statistics from 'struct rte_eth_stats' in the long term.

Instead PMDs should represent the queue statistics via xstats, this
gives more flexibility on the number of the queues supported.

Currently queue stats in the xstats are filled by ethdev layer, using
some basic stats, when queue stats removed from basic stats the
responsibility to fill the relevant xstats will be pushed to the PMDs.

During the switch period, temporary 'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS'
device flag is created. Initially all PMDs using xstats set this flag.
The PMDs implemented queue stats in the xstats should clear the flag.

When all PMDs switch to the xstats for the queue stats, queue stats
related fields from 'struct rte_eth_stats' will be removed, as well as
'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' flag.
Later 'RTE_ETHDEV_QUEUE_STAT_CNTRS' compile time flag also can be
removed.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2020-10-16 23:27:15 +02:00
Ivan Ilchenko
62024eb827 ethdev: change stop operation callback to return int
Change eth_dev_stop_t return value from void to int.
Make eth_dev_stop_t implementations across all drivers to return
negative errno values if case of error conditions.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-10-16 22:26:41 +02:00
Thomas Monjalon
8a5a0aad5d ethdev: allow close function to return an error
The API function rte_eth_dev_close() was returning void.
The return type is changed to int for notifying of errors.

If an error happens during a close operation,
the status of the port is undefined,
a maximum of resources having been freed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Liron Himi <lironh@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-10-16 22:26:41 +02:00
Thomas Monjalon
3041049375 drivers/net: check process type in close operation
The secondary processes are not allowed to release shared resources.
Only process-private resources should be freed in a secondary process.
Most of the time, there is no process-private resource,
so the close operation is just forbidden in a secondary process.

After adding proper check in the port close functions,
some redundant checks in the device remove functions are dropped.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
Reviewed-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2020-09-30 19:19:14 +02:00
Thomas Monjalon
fbd1913561 ethdev: remove old close behaviour
The temporary flag RTE_ETH_DEV_CLOSE_REMOVE is removed.
It was introduced in DPDK 18.11 in order to give time for PMDs to migrate.

The old behaviour was to free only queues when closing a port.
The new behaviour is calling rte_eth_dev_release_port() which does
three more tasks:
	- trigger event callback
	- reset state and few pointers
	- free all generic port resources

The private port resources must be released in the .dev_close callback.

The .remove callback should:
	- call .dev_close callback
	- call rte_eth_dev_release_port()
	- free multi-port device shared resources

Despite waiting two years, some drivers have not migrated,
so they may hit issues with the incompatible new behaviour.
After sending emails, adding logs, and announcing the deprecation,
the only last solution is to declare these drivers as unmaintained:
	ionic, liquidio, nfp
Below is a summary of what to implement in those drivers.

* The freeing of private port resources must be moved
from the ".remove(device)" function to the ".dev_close(port)" function.

* If a generic resource (.mac_addrs or .hash_mac_addrs) cannot be freed,
it must be set to NULL in ".dev_close" function to protect from
subsequent rte_eth_dev_release_port() freeing.

* Note 1:
The generic resources are freed in rte_eth_dev_release_port(),
after ".dev_close" is called in rte_eth_dev_close(), but not when
calling ".dev_close" directly from the ".remove" PMD function.
That's why rte_eth_dev_release_port() must still be called explicitly
from ".remove(device)" after calling the ".dev_close" PMD function.

* Note 2:
If a device can have multiple ports, the common resources must be freed
only in the ".remove(device)" function.

* Note 3:
The port is supposed to be in a stopped state when it is closed.
If it is not the case, it is free to the PMD implementation
how to react when trying to close a non-stopped port:
either try to stop it automatically or just return an error.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2020-09-30 19:19:14 +02:00
Thomas Monjalon
b142387b07 ethdev: allow drivers to return error on close
The device operation .dev_close was returning void.
This driver interface is changed to return an int.

Note that the API rte_eth_dev_close() is still returning void,
although a deprecation notice is pending to change it as well.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
Reviewed-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2020-09-30 19:19:13 +02:00