path: root/drivers/net/mvpp2
AgeCommit message (Collapse)Author
2019-03-29drivers: fix SPDX license id consistencyStephen Hemminger
All drivers should have SPDX on the first line of the source files in the format /* SPDX-License-Identifier: ... Several files used minor modifications which were inconsistent with the pattern. Fix it to make scanning tools easier. Signed-off-by: Stephen Hemminger <>
2018-11-16net/mvpp2: fix possible uninitialized variable accessFerruh Yigit
Fixes: cdb53f8da628 ("net/mvpp2: support metering") Signed-off-by: Ferruh Yigit <> Acked-by: Tomasz Duszynski <>
2018-10-26ethdev: free all common data when releasing portThomas Monjalon
This is a clean-up of common ethdev data freeing. All data freeing are moved to rte_eth_dev_release_port() and done only in case of primary process. It is probably fixing some memory leaks for PMDs which were not freeing all data. Signed-off-by: Thomas Monjalon <> Acked-by: Andrew Rybchenko <>
2018-09-28net/mvpp2: support Tx scatter/gatherZyta Szpak
The patch introduces scatter/gather support on transmit path. A separate Tx callback is added and set if the application requests multisegment Tx offload. Multiple descriptors are sent per one packet. Signed-off-by: Zyta Szpak <> Signed-off-by: Natalie Samsonov <> Reviewed-by: Yelena Krivosheev <>
2018-09-28net/mvpp2: align with MUSDK 18.09Tomasz Duszynski
This patch introduces necessary changes required by MUSDK 18.09 library. * As of MUSDK 18.09, pp2_cookie_t is no longer available. Now RX descriptor cookie is defined as plain u64 so existing cast is no longer valid. * MUSDK 18.09 increased number of available bpools (buffer hw pools) by introducing dma regions support. Update mvpp2 driver accordingly. * replace MV_NET_IP4_F_TOS with MV_NET_IP4_F_DSCP Before this patch, API allowed to configure a classification rule according to IPv4 TOS, which was not supported in classifier. This patch fixes this by using proper field. * use 48 bit address mask We cannot get pointers exceeding 48 bits thus using 48 bit mask for extracting higher IOVA address bits is enough. Signed-off-by: Natalie Samsonov <> Signed-off-by: Yuval Caduri <> Signed-off-by: Tomasz Duszynski <> Reviewed-by: Shlomi Gridish <> Reviewed-by: Alan Winkowski <> Reviewed-by: Liron Himi <>
2018-09-28net/mvpp2: update MTU and MRU related calculationsNatalie Samsonov
This commit updates MTU and MRU related calculations. Signed-off-by: Natalie Samsonov <> Reviewed-by: Yelena Krivosheev <> Reviewed-by: Dmitri Epshtein <>
2018-09-28net/mvpp2: detach Tx QoS from Rx cls/QoS configYuval Caduri
Functional change: Open receive cls/qos related features, only if the config file contains an rx_related configuration entry. This allows to configure tx_related entries, w/o unintentionally opening rx cls/qos. Code: 'use_global_defaults' is by default set to '1'. Only if an rx_related entry was configured, it is updated to '0'. rx cls/qos is performed only if 'use_global_defaults' is '0'. Default TC configuration is now only mandatory when 'use_global_defaults' is '0'. Signed-off-by: Yuval Caduri <> Reviewed-by: Natalie Samsonov <> Tested-by: Natalie Samsonov <>
2018-09-28net/mvpp2: support traffic managerTomasz Duszynski
Add traffic manager support. Signed-off-by: Tomasz Duszynski <> Signed-off-by: Natalie Samsonov <> Reviewed-by: Liron Himi <>
2018-09-28net/mvpp2: add init and deinit to flowTomasz Duszynski
Add init and deinit functionality to flow implementation. Init puts structures used by flow in a sane sate. Deinit deallocates all resources used by flow. Signed-off-by: Tomasz Duszynski <> Signed-off-by: Natalie Samsonov <> Reviewed-by: Liron Himi <> Reviewed-by: Shlomi Gridish <>
2018-09-28net/mvpp2: change default policer configurationTomasz Duszynski
Change QoS configuration file syntax for port's default policer setup. Since default policer configuration is performed before any other policer configuration we can pick a default id. This simplifies default policer configuration since user no longer has to choose ids from range [0, PP2_CLS_PLCR_NUM]. Explicitly document values for rate_limit_enable field. Signed-off-by: Tomasz Duszynski <> Signed-off-by: Natalie Samsonov <> Reviewed-by: Liron Himi <>
2018-09-28net/mvpp2: support meteringTomasz Duszynski
Add support for configuring plcr via DPDK generic metering API. Signed-off-by: Tomasz Duszynski <> Signed-off-by: Natalie Samsonov <> Reviewed-by: Liron Himi <>
2018-09-28net/mvpp2: move common codeTomasz Duszynski
Cleanup sources by moving common code to the pmd header file. Signed-off-by: Tomasz Duszynski <> Signed-off-by: Natalie Samsonov <> Reviewed-by: Liron Himi <>
2018-09-28net/mvpp2: initialize ppio only onceNatalie Samsonov
This changes stop/start/configure behavior due to issue in MUSDK library itself. From now on, ppio can be reconfigured only after interface is closed. Signed-off-by: Natalie Samsonov <> Reviewed-by: Yuval Caduri <>
2018-09-14ethdev: make default behavior CRC strip on RxFerruh Yigit
Removed DEV_RX_OFFLOAD_CRC_STRIP offload flag. Without any specific Rx offload flag, default behavior by PMDs is to strip CRC. PMDs that support keeping CRC should advertise DEV_RX_OFFLOAD_KEEP_CRC Rx offload capability. Applications that require keeping CRC should check PMD capability first and if it is supported can enable this feature by setting DEV_RX_OFFLOAD_KEEP_CRC in Rx offload flag in rte_eth_dev_configure() Signed-off-by: Ferruh Yigit <> Acked-by: Tomasz Duszynski <> Acked-by: Shahaf Shuler <> Reviewed-by: Maxime Coquelin <> Acked-by: Jan Remes <> Acked-by: Jerin Jacob <> Acked-by: Hyong Youb Kim <>
2018-08-28net/mvpp2: support VLAN for parser offloadNatalie Samsonov
Add VLAN packet type support for parser offload. Signed-off-by: Natalie Samsonov <> Reviewed-by: Shlomi Gridish <> Reviewed-by: Dmitri Epshtein <> Reviewed-by: Yuval Caduri <>
2018-08-28net/mvpp2: make private variables staticNatalie Samsonov
Mark internal variables static to avoid potential redefinition errors later on. Signed-off-by: Natalie Samsonov <> Reviewed-by: Yelena Krivosheev <>
2018-08-28net/mvpp2: fix comments and error messagesNatalie Samsonov
Fix comments and error messages. Fixes: 7235341d7517 ("net/mrvl: support classifier") Cc: Signed-off-by: Natalie Samsonov <> Reviewed-by: Liron Himi <>
2018-08-28net/mvpp2: fix array initializationTomasz Duszynski
Fix used_bpools array initialization by using range initializer. This way all necessary variables are properly initialized regardless of PP2_NUM_PKT_PROC value. Fixes: 0ddc9b815b11 ("net/mrvl: add net PMD skeleton") Cc: Signed-off-by: Tomasz Duszynski <>
2018-08-28net/mvpp2: use common code to initialize DMALiron Himi
Use common code to initialize MUSDK DMA memory buffers. Signed-off-by: Liron Himi <> Reviewed-by: Natalie Samsonov <>
2018-07-12remove useless constructor headersThomas Monjalon
A constructor is usually declared with RTE_INIT* macros. As it is a static function, no need to declare before its definition. The macro is used directly in the function definition. Signed-off-by: Thomas Monjalon <>
2018-07-03ethdev: add new offload flag to keep CRCFerruh Yigit
DEV_RX_OFFLOAD_KEEP_CRC offload flag is added. PMDs that support keeping CRC should advertise this offload capability. DEV_RX_OFFLOAD_CRC_STRIP flag will remain one more release default behavior in PMDs are to keep the CRC until this flag removed Until DEV_RX_OFFLOAD_CRC_STRIP flag is removed: - Setting both KEEP_CRC & CRC_STRIP is INVALID - Setting only CRC_STRIP PMD should strip the CRC - Setting only KEEP_CRC PMD should keep the CRC - Not setting both PMD should keep the CRC A helper function rte_eth_dev_is_keep_crc() has been added to be able to change the no flag behavior with minimal changes in PMDs. The PMDs that doesn't report the DEV_RX_OFFLOAD_KEEP_CRC offload can remove rte_eth_dev_is_keep_crc() checks next release, related code commented to help the maintenance task. And DEV_RX_OFFLOAD_CRC_STRIP has been added to virtual drivers since they don't use CRC at all, when an application requires this offload virtual PMDs should not return error. Signed-off-by: Ferruh Yigit <> Acked-by: Allain Legacy <> Acked-by: Andrew Rybchenko <> Acked-by: Thomas Monjalon <>
2018-06-14net/mvpp2: check pointer before using itTomasz Duszynski
Avoid NULL dereference by checking pointer before using it. Note that the fixes tag is before the driver was renamed to mvpp2, so the patch will not apply that far back. Fixes: 3588aaa68eab ("net/mrvl: fix HIF objects allocation") Signed-off-by: Tomasz Duszynski <>
2018-06-14net/mvpp2: convert to dynamic loggingTomasz Duszynski
Convert mvpp2 PMD to use dynamic logging. Signed-off-by: Tomasz Duszynski <>
2018-05-14ethdev: add probing finish functionThomas Monjalon
A new hook function is added and called inside the PMDs at the end of the device probing: - in primary process, after allocating, init and config - in secondary process, after attaching and local init This new function is almost empty for now. It will be used later to add some post-initialization processing. For the PMDs calling the helpers rte_eth_dev_create() or rte_eth_dev_pci_generic_probe(), the hook rte_eth_dev_probing_finish() is called from here, and not in the PMD itself. Note that the helper rte_eth_dev_create() could be used more, especially for vdevs, avoiding some code duplication in PMDs. Cc: Signed-off-by: Thomas Monjalon <> Reviewed-by: Andrew Rybchenko <> Reviewed-by: Stephen Hemminger <>
2018-05-14ethdev: new Rx/Tx offloads APIWei Dai
This patch check if a input requested offloading is valid or not. Any reuqested offloading must be supported in the device capabilities. Any offloading is disabled by default if it is not set in the parameter dev_conf->[rt]xmode.offloads to rte_eth_dev_configure() and [rt]x_conf->offloads to rte_eth_[rt]x_queue_setup(). If any offloading is enabled in rte_eth_dev_configure() by application, it is enabled on all queues no matter whether it is per-queue or per-port type and no matter whether it is set or cleared in [rt]x_conf->offloads to rte_eth_[rt]x_queue_setup(). If a per-queue offloading hasn't be enabled in rte_eth_dev_configure(), it can be enabled or disabled for individual queue in ret_eth_[rt]x_queue_setup(). A new added offloading is the one which hasn't been enabled in rte_eth_dev_configure() and is reuqested to be enabled in rte_eth_[rt]x_queue_setup(), it must be per-queue type, otherwise trigger an error log. The underlying PMD must be aware that the requested offloadings to PMD specific queue_setup() function only carries those new added offloadings of per-queue type. This patch can make above such checking in a common way in rte_ethdev layer to avoid same checking in underlying PMD. This patch assumes that all PMDs in 18.05-rc2 have already converted to offload API defined in 17.11 . It also assumes that all PMDs can return correct offloading capabilities in rte_eth_dev_infos_get(). In the beginning of [rt]x_queue_setup() of underlying PMD, add offloads = [rt]xconf->offloads | dev->data->dev_conf.[rt]xmode.offloads; to keep same as offload API defined in 17.11 to avoid upper application broken due to offload API change. PMD can use the info that input [rt]xconf->offloads only carry the new added per-queue offloads to do some optimization or some code change on base of this patch. Signed-off-by: Wei Dai <> Signed-off-by: Ferruh Yigit <> Signed-off-by: Qi Zhang <>
2018-04-27ethdev: add transfer attribute to flow APIAdrien Mazarguil
This new attribute enables applications to create flow rules that do not simply match traffic whose origin is specified in the pattern (e.g. some non-default physical port or VF), but actively affect it by applying the flow rule at the lowest possible level in the underlying device. It breaks ABI compatibility for the following public functions: - rte_flow_copy() - rte_flow_create() - rte_flow_validate() Signed-off-by: Adrien Mazarguil <>
2018-04-27ethdev: fix TPID handling in flow APIAdrien Mazarguil
TPID handling in rte_flow VLAN and E_TAG pattern item definitions is not consistent with the normal stacking order of pattern items, which is confusing to applications. Problem is that when followed by one of these layers, the EtherType field of the preceding layer keeps its "inner" definition, and the "outer" TPID is provided by the subsequent layer, the reverse of how a packet looks like on the wire: Wire: [ ETH TPID = A | VLAN EtherType = B | B DATA ] rte_flow: [ ETH EtherType = B | VLAN TPID = A | B DATA ] Worse, when QinQ is involved, the stacking order of VLAN layers is unspecified. It is unclear whether it should be reversed (innermost to outermost) as well given TPID applies to the previous layer: Wire: [ ETH TPID = A | VLAN TPID = B | VLAN EtherType = C | C DATA ] rte_flow 1: [ ETH EtherType = C | VLAN TPID = B | VLAN TPID = A | C DATA ] rte_flow 2: [ ETH EtherType = C | VLAN TPID = A | VLAN TPID = B | C DATA ] While specifying EtherType/TPID is hopefully rarely necessary, the stacking order in case of QinQ and the lack of documentation remain an issue. This patch replaces TPID in the VLAN pattern item with an inner EtherType/TPID as is usually done everywhere else (e.g. struct vlan_hdr), clarifies documentation and updates all relevant code. It breaks ABI compatibility for the following public functions: - rte_flow_copy() - rte_flow_create() - rte_flow_query() - rte_flow_validate() Summary of changes for PMDs that implement ETH, VLAN or E_TAG pattern items: - bnxt: EtherType matching is supported with and without VLAN, but TPID matching is not and triggers an error. - e1000: EtherType matching is only supported with the ETHERTYPE filter, which does not support VLAN matching, therefore no impact. - enic: same as bnxt. - i40e: same as bnxt with existing FDIR limitations on allowed EtherType values. The remaining filter types (VXLAN, NVGRE, QINQ) do not support EtherType matching. - ixgbe: same as e1000, with additional minor change to rely on the new E-Tag macro definition. - mlx4: EtherType/TPID matching is not supported, no impact. - mlx5: same as bnxt. - mvpp2: same as bnxt. - sfc: same as bnxt. - tap: same as bnxt. Fixes: b1a4b4cbc0a8 ("ethdev: introduce generic flow API") Fixes: 99e7003831c3 ("net/ixgbe: parse L2 tunnel filter") Signed-off-by: Adrien Mazarguil <> Acked-by: Andrew Rybchenko <>
2018-04-27ethdev: remove experimental flag of ports enumerationThomas Monjalon
The basic operations for ports enumeration should not be considered as experimental in DPDK 18.05. The iterator RTE_ETH_FOREACH_DEV was introduced in DPDK 17.05. It uses the function the rte_eth_find_next_owned_by() to get only ownerless ports. Its API can be considered stable. So the flag experimental is removed from rte_eth_find_next_owned_by(). The flag experimental is removed from rte_eth_dev_count_avail() which is the new name of the old function rte_eth_dev_count(). The flag experimental is set to rte_eth_dev_count_total() in the .c file for consistency with the declaration in the .h file. A lot of internal applications are fixed to not allow experimental API. Fixes: 8728ccf37615 ("fix ethdev ports enumeration") Fixes: d9a42a69febf ("ethdev: deprecate port count function") Fixes: e70e26861eaf ("net/mvpp2: fix build") Signed-off-by: Thomas Monjalon <> Tested-by: David Marchand <>
2018-04-19net/mvpp2: add to meson buildTomasz Duszynski
Add support for building MRVL MVPP2 PMD with meson. To avoid cluttering the build environment and to keep all relevant settings local to a cross build we get MUSDK library installation path from a meson option. Signed-off-by: Tomasz Duszynski <> Acked-by: Bruce Richardson <>
2018-04-17net/mvpp2: rename version map file to standardTomasz Duszynski
Rename the version file to follow standard naming convention. Signed-off-by: Tomasz Duszynski <> Acked-by: Bruce Richardson <>
2018-04-20net/mvpp2: fix buildThomas Monjalon
The iterator RTE_ETH_FOREACH_DEV (added in below commit) requires to enable experimental APIs. Fixing also the config option rename in the build test. Fixes: 8728ccf37615 ("fix ethdev ports enumeration") Fixes: fe93968722af ("net/mrvl: rename PMD as mvpp2") Reported-by: Ferruh Yigit <> Signed-off-by: Thomas Monjalon <> Tested-by: Ferruh Yigit <>
2018-04-18fix ethdev ports enumerationThomas Monjalon
Some DPDK applications wrongly assume these requirements: - no hotplug, i.e. ports are never detached - all allocated ports are available to the application Such application iterates over ports by its own mean. The most common pattern is to request the port count and assume ports with index in the range [0..count[ can be used. There are three consequences when using such wrong design: - new ports having an index higher than the port count won't be seen - old ports being detached (RTE_ETH_DEV_UNUSED) can be seen as ghosts - failsafe sub-devices (RTE_ETH_DEV_DEFERRED) will be seen by the application Such mistake will be less common with growing hotplug awareness. All applications and examples inside this repository - except testpmd - must be fixed to use the iterator RTE_ETH_FOREACH_DEV. Signed-off-by: Thomas Monjalon <>
2018-04-14ethdev: return diagnostic when setting MAC addressOlivier Matz
Change the prototype and the behavior of dev_ops->eth_mac_addr_set(): a return code is added to notify the caller (librte_ether) if an error occurred in the PMD. The new default MAC address is now copied in dev->data->mac_addrs[0] only if the operation is successful. The patch also updates all the PMDs accordingly. Signed-off-by: Olivier Matz <> Signed-off-by: Ivan Malov <> Acked-by: Andrew Rybchenko <> Acked-by: Adrien Mazarguil <> Acked-by: Shreyansh Jain <> Reviewed-by: Ferruh Yigit <> Acked-by: Thomas Monjalon <> Acked-by: Nelio Laranjeiro <>
2018-04-04convert snprintf to strlcpyBruce Richardson
Since we have support for the strlcpy function in DPDK, replace all instances where a string is copied using snprintf. Signed-off-by: Bruce Richardson <> Reviewed-by: Stephen Hemminger <>
2018-03-30net/mrvl: rename PMD as mvpp2Natalie Samsonov
The name "mrvl" for Marvell PMD driver for PPv2 Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter is too generic and causes problem for adding new PMD drivers for other Marvell devices. Changed to "mvpp2" for specific Marvell PPv2 PMD. This patch doesn't introduce any change except renaming. Signed-off-by: Natalie Samsonov <> Acked-by: Ferruh Yigit <>