#
392bf908 |
| 27-Jul-2020 |
Parav Pandit <parav@mellanox.com> |
common/mlx5: register class drivers through common layer
Migrate mlx5 net, vdpa and regex PMD to start using mlx5 common class driver.
Signed-off-by: Parav Pandit <parav@mellanox.com> Acked-by: Mat
common/mlx5: register class drivers through common layer
Migrate mlx5 net, vdpa and regex PMD to start using mlx5 common class driver.
Signed-off-by: Parav Pandit <parav@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
038e7fc0 |
| 15-Jul-2020 |
Shy Shyman <shys@mellanox.com> |
net/mlx5: fix HW counters path in switchdev mode
When debugging performance of a DPDK application the user may need to view the different statistics of DPDK (for example out_of_buffer) This can be e
net/mlx5: fix HW counters path in switchdev mode
When debugging performance of a DPDK application the user may need to view the different statistics of DPDK (for example out_of_buffer) This can be enabled by using testpmd command 'show port xstats <port_id>' for example.
The current implementation assumes legacy mode in which the counters are at <ibdev_path>/<port_id>/hw_counters/<file_name>. In switchdev mode the counters file is located right after the device name, hence resides at <ibdev_path>/hw_counters.
The fix tries to open the path in the second location after a failure to open the file from the first location.
Fixes: 9c0a9eed37f1 ("net/mlx5: switch to the names in the shared IB context") Cc: stable@dpdk.org
Signed-off-by: Shy Shyman <shys@mellanox.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
show more ...
|
#
161d103b |
| 19-Jul-2020 |
Viacheslav Ovsiienko <viacheslavo@mellanox.com> |
net/mlx5: add queue start and stop
The mlx5 PMD did not support queue_start and queue_stop eth_dev API routines, queue could not be suspended and resumed during device operation.
There is the use c
net/mlx5: add queue start and stop
The mlx5 PMD did not support queue_start and queue_stop eth_dev API routines, queue could not be suspended and resumed during device operation.
There is the use case when this feature is crucial for applications:
- there is the secondary process handling the queue - secondary process crashed/aborted - some mbufs were allocated or used by secondary application - some mbufs were allocated by Rx queues to receive packets - some mbufs were placed to send queue - queue goes to undefined state
In this case there was no reliable way to recovery queue handling by restarted secondary process but reset queue to initial state freeing all involved resources, including buffers involved in queue operations, reset the mbuf pools, and then reinitialize queue to working state:
- reset mbuf pool, allocate all mbuf to initialize pool into safe state after the crush and allow safe mbuf free calls - stop queue, free all potentially involved mbufs - reset mbuf pool again - start queue, reallocate mbufs needed
This patch introduces the queue start/stop feature with some limitations:
- hairpin queues are not supported - it is application responsibility to synchronize start/stop with datapath routines, rx/tx_burst must be suspended during the queue_start/queue_stop calls - it is application responsibility to track queue usage and provide coordinated queue_start/queue_stop calls from secondary and primary processes. - Rx queues with vectorized Rx routine and engaged CQE compression are not supported by this patch currently
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
show more ...
|
#
08d1838f |
| 19-Jul-2020 |
Dekel Peled <dekelp@mellanox.com> |
net/mlx5: implement CQ for Rx using DevX API
This patch continues the work to use DevX API for different objects creation and management. On Rx control path, the RQ, RQT, and TIR objects can already
net/mlx5: implement CQ for Rx using DevX API
This patch continues the work to use DevX API for different objects creation and management. On Rx control path, the RQ, RQT, and TIR objects can already be created using DevX API. This patch adds the support to create CQ for RxQ using DevX API. The corresponding event channel is also created and utilized using DevX API.
Signed-off-by: Dekel Peled <dekelp@mellanox.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
show more ...
|
#
9d60f545 |
| 19-Jul-2020 |
Ophir Munk <ophirmu@mellanox.com> |
common/mlx5: remove inclusion of Verbs header files
Several source files include Verbs header files as in (1). These source files will not compile under non-Linux operating systems. This commit remo
common/mlx5: remove inclusion of Verbs header files
Several source files include Verbs header files as in (1). These source files will not compile under non-Linux operating systems. This commit removes this inclusion in two cases:
Case 1: There is no usage of ibv_* or mlx5dv_* symbols in the source file so the inclusion in (1) can be safely removed.
Case 2: Verbs symbols are used. Please note the inclusion in (1) already appears in file linux/mlx5_glue.h (which represents the interface to the rdma-core library). Therefore, replace (1) in the source file with (2). Under non-Linux operating systems - file mlx5_glue.h will not include (1).
(1) #include <infiniband/verbs.h> #include <infiniband/mlx5dv.h>
(2) #include <mlx5_glue.h>
Signed-off-by: Ophir Munk <ophirmu@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
2e86c4e5 |
| 19-Jul-2020 |
Ophir Munk <ophirmu@mellanox.com> |
net/mlx5: refactor multi-process communication
1. The shared data communication between the primary and the secondary processes is implemented using Linux API. Move the Linux API code under linux di
net/mlx5: refactor multi-process communication
1. The shared data communication between the primary and the secondary processes is implemented using Linux API. Move the Linux API code under linux directory (file linux/mlx5_os.c).
2. File net/mlx5/mlx5_mp.c handles requests to the primary and secondary processes (e.g. start_rxtx, stop_rxtx). It is Linux based so it is moved under linux (new file linux/mlx5_mp_os.c).
Signed-off-by: Ophir Munk <ophirmu@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
98c4b12a |
| 19-Jul-2020 |
Ophir Munk <ophirmu@mellanox.com> |
net/mlx5: eliminate dependency on Linux in shared header
This commit eliminates Linux dependencies in shared file mlx5.h.
1. All functions using 'struct ifreq' are moved to file linux/mlx5_ethdev_o
net/mlx5: eliminate dependency on Linux in shared header
This commit eliminates Linux dependencies in shared file mlx5.h.
1. All functions using 'struct ifreq' are moved to file linux/mlx5_ethdev_os.c such that this struct can be removed from mlx5.h. 2. Function mlx5_set_flags() that uses Linux flags (e.g. IFF_UP) is changed to static and its prototype is removed from mlx5.h. 3. Remove redundant member verbs_action from 'struct mlx5_priv'.
Signed-off-by: Ophir Munk <ophirmu@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
4d18abd1 |
| 19-Jul-2020 |
Ophir Munk <ophirmu@mellanox.com> |
net/mlx5: wrap Linux promiscuous and multicast functions
This commit adds Linux implementation of routines mlx5_os_set_promisc() and mlx5_os_set_promisc(). The routines call netlink APIs.
Signed-of
net/mlx5: wrap Linux promiscuous and multicast functions
This commit adds Linux implementation of routines mlx5_os_set_promisc() and mlx5_os_set_promisc(). The routines call netlink APIs.
Signed-off-by: Ophir Munk <ophirmu@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
ab27cdd9 |
| 19-Jul-2020 |
Ophir Munk <ophirmu@mellanox.com> |
net/mlx5: refactor Linux MAC operations
Move OS specific MAC operations add, remove, modify VF into file linux/mlx5_os.c. Remove unused function mlx5_get_mac().
Signed-off-by: Ophir Munk <ophirmu@m
net/mlx5: refactor Linux MAC operations
Move OS specific MAC operations add, remove, modify VF into file linux/mlx5_os.c. Remove unused function mlx5_get_mac().
Signed-off-by: Ophir Munk <ophirmu@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
2aba9fc7 |
| 19-Jul-2020 |
Ophir Munk <ophirmu@mellanox.com> |
net/mlx5: replace Linux specific calls
The following Linux calls are replaced by their matching rte APIs.
mmap ==> rte_mem_map() munmap == >rte_mem_unmap() sysconf(_SC_PAGESIZE) ==> rte_mem_page_si
net/mlx5: replace Linux specific calls
The following Linux calls are replaced by their matching rte APIs.
mmap ==> rte_mem_map() munmap == >rte_mem_unmap() sysconf(_SC_PAGESIZE) ==> rte_mem_page_size()
Signed-off-by: Ophir Munk <ophirmu@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
50f95b23 |
| 15-Jul-2020 |
Suanming Mou <suanmingm@mellanox.com> |
net/mlx5: add option to configure FCS or decapsulation
There are some limitations on some NICs (at least on ConnectX-6 Dx and BlueField 2) with supporting FCS (frame checksum) scattering for the tun
net/mlx5: add option to configure FCS or decapsulation
There are some limitations on some NICs (at least on ConnectX-6 Dx and BlueField 2) with supporting FCS (frame checksum) scattering for the tunnel decapsulated packets.
For the case only one of the features can be supported in the same time, and the new devarg "decap_en" is introduced to provide the choice to the users.
If FCS scattering feature is not supposed to be engaged by application, this new devarg should be specified as "decap_en=0", forcing the FCS feature enable and rejecting tunnel decap actions in the rte_flow engine. If FCS scatter is not needed and application supposes to use tunnel decapsulation in rte_flow, the devarg can be omitted or set to non-zero value (this is default settings).
Signed-off-by: Suanming Mou <suanmingm@mellanox.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
show more ...
|
#
2175c4dc |
| 28-Jun-2020 |
Suanming Mou <suanmingm@mellanox.com> |
net/mlx5: convert configuration objects to unified malloc
This commit allocates the miscellaneous configuration objects from the unified malloc function.
Signed-off-by: Suanming Mou <suanmingm@mell
net/mlx5: convert configuration objects to unified malloc
This commit allocates the miscellaneous configuration objects from the unified malloc function.
Signed-off-by: Suanming Mou <suanmingm@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
5522da6b |
| 28-Jun-2020 |
Suanming Mou <suanmingm@mellanox.com> |
net/mlx5: add option to allocate memory from system
Currently, for MLX5 PMD, once millions of flows created, the memory consumption of the flows are also very huge. For the system with limited memor
net/mlx5: add option to allocate memory from system
Currently, for MLX5 PMD, once millions of flows created, the memory consumption of the flows are also very huge. For the system with limited memory, it means the system need to reserve most of the memory as huge page memory to serve the flows in advance. And other normal applications will have no chance to use this reserved memory any more. While most of the time, the system will not have lots of flows, the reserved huge page memory becomes a bit waste of memory at most of the time.
By the new sys_mem_en devarg, once set it to be true, it allows the PMD allocate the memory from system by default with the new add mlx5 memory management functions. Only once the MLX5_MEM_RTE flag is set, the memory will be allocate from rte, otherwise, it allocates memory from system.
So in this case, the system with limited memory no need to reserve most of the memory for hugepage. Only some needed memory for datapath objects will be enough to allocated with explicitly flag. Other memory will be allocated from system. For system with enough memory, no need to care about the devarg, the memory will always be from rte hugepage.
One restriction is that for DPDK application with multiple PCI devices, if the sys_mem_en devargs are different between the devices, the sys_mem_en only gets the value from the first device devargs, and print out a message to warn that.
Signed-off-by: Suanming Mou <suanmingm@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
a2854c4d |
| 16-Jul-2020 |
Viacheslav Ovsiienko <viacheslavo@mellanox.com> |
net/mlx5: convert Rx timestamps in real-time format
The ConnectX-6DX supports the timestamps in various formats, the new realtime format is introduced - the upper 32-bit word of timestamp contains t
net/mlx5: convert Rx timestamps in real-time format
The ConnectX-6DX supports the timestamps in various formats, the new realtime format is introduced - the upper 32-bit word of timestamp contains the UTC seconds and the lower 32-bit word contains the nanoseconds. This patch detects what format is configured in the NIC and performs the conversion accordingly.
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
b94d93ca |
| 16-Jul-2020 |
Viacheslav Ovsiienko <viacheslavo@mellanox.com> |
net/mlx5: support reading device clock
If send schedule feature is engaged there is the Clock Queue created, that reports reliable the current device clock counter value. The device clock counter ca
net/mlx5: support reading device clock
If send schedule feature is engaged there is the Clock Queue created, that reports reliable the current device clock counter value. The device clock counter can be read directly from the Clock Queue CQE.
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
d133f4cd |
| 16-Jul-2020 |
Viacheslav Ovsiienko <viacheslavo@mellanox.com> |
net/mlx5: create clock queue for packet pacing
This patch creates the special completion queue providing reference completions to schedule packet send from other transmitting queues.
Signed-off-by:
net/mlx5: create clock queue for packet pacing
This patch creates the special completion queue providing reference completions to schedule packet send from other transmitting queues.
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
24feb045 |
| 16-Jul-2020 |
Viacheslav Ovsiienko <viacheslavo@mellanox.com> |
net/mlx5: fix UAR lock sharing for multiport devices
The master and representors might be created over the multiport Infiniband devices and the UAR resource allocated for sibling ports might belong
net/mlx5: fix UAR lock sharing for multiport devices
The master and representors might be created over the multiport Infiniband devices and the UAR resource allocated for sibling ports might belong to the same underlying Infiniband device. Hardware requires the write access to the UAR must be performed as atomic 64-bit write, on 32-bit systems this is two sequential writes, protected by lock. Due to possibility to share the same UAR between sibling devices the locks must be moved to shared context.
Fixes: f048f3d479a6 ("net/mlx5: switch to the shared IB device context") Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
8f848f32 |
| 16-Jul-2020 |
Viacheslav Ovsiienko <viacheslavo@mellanox.com> |
net/mlx5: introduce send scheduling devargs
This patch introduces the new devargs:
tx_pp - enables accurate packet send scheduling on mbuf timestamps in the PMD. On the device start if "rte_dynfl
net/mlx5: introduce send scheduling devargs
This patch introduces the new devargs:
tx_pp - enables accurate packet send scheduling on mbuf timestamps in the PMD. On the device start if "rte_dynflag_timestamp" dynamic flag is registered and this devarg non-zero value is specified, the driver initializes all necessary internal infrastructure to provide packet scheduling. The parameter value specifies scheduling granularity in nanoseconds.
tx_skew - the parameter adjusts the send packet scheduling on timestamps and represents the average delay between beginning of the transmitting descriptor processing by the hardware and appearance of actual packet data on the wire. The value should be provided in nanoseconds and is valid only if tx_pp parameter is specified. The default value is zero.
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
36dabcea |
| 24-Jun-2020 |
Michael Baum <michaelba@mellanox.com> |
net/mlx5: use anonymous Direct Verbs allocator argument
The mlx5_dev_spawn function defines an struct mlx5dv_ctx_allocators type variable several hundred rows after it starts, with the only use it b
net/mlx5: use anonymous Direct Verbs allocator argument
The mlx5_dev_spawn function defines an struct mlx5dv_ctx_allocators type variable several hundred rows after it starts, with the only use it being passed as a parameter to the mlx5_glue->dv_set_context_attr function. However, according to DPDK Coding Style Guidelines, variables should be declared at the start of a block of code rather than in the middle. Therefore, to improve the Coding Style, the variable is passed directly to the function without declaring it before.
Signed-off-by: Michael Baum <michaelba@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
420bbdae |
| 23-Jun-2020 |
Viacheslav Ovsiienko <viacheslavo@mellanox.com> |
net/mlx5: fix host physical function representor naming
The new kernel adds the names like "pf0" for Host PCI physical function representor on Bluefield SmartNIC hosts. This patch provides correct H
net/mlx5: fix host physical function representor naming
The new kernel adds the names like "pf0" for Host PCI physical function representor on Bluefield SmartNIC hosts. This patch provides correct HPF representor recognition over the kernel versions 5.7 and laters.
The following port naming formats are supported:
- missing physical port name (no sysfs/netlink key) at all, master is assumed
- decimal digits (for example "12"), representor is assumed, the value is the index of attached VF
- "p" followed by decimal digits, for example "p2", master is assumed
- "pf" followed by PF index, for example "pf0", Host PF representor is assumed on SmartNIC systems.
- "pf" followed by PF index concatenated with "vf" followed by VF index, for example "pf0vf1", representor is assumed. If index of VF is "-1" it is a special case of Host PF representor, this representor must be indexed in devargs as 65535, for example representor=[0-3,65535] will allow representors for VF0, VF1, VF2, VF3 and for host PF.
Fixes: 79aa430721b1 ("common/mlx5: split common file under Linux directory") Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
391b8bcc |
| 19-Jun-2020 |
Ophir Munk <ophirmu@mellanox.com> |
common/mlx5: move some getter functions from net driver
Getter functions such as: 'mlx5_os_get_ctx_device_name', 'mlx5_os_get_ctx_device_path', 'mlx5_os_get_dev_device_name', 'mlx5_os_get_umem_id' a
common/mlx5: move some getter functions from net driver
Getter functions such as: 'mlx5_os_get_ctx_device_name', 'mlx5_os_get_ctx_device_path', 'mlx5_os_get_dev_device_name', 'mlx5_os_get_umem_id' are implemented under net directory. To enable additional devices (e.g. regex, vdpa) to access these getter functions they are moved under common directory.
As part of this commit string sizes DEV_SYSFS_NAME_MAX and DEV_SYSFS_PATH_MAX are increased by 1 to make sure that the destination string size in strncpy() function is bigger than the source string size. This update will avoid GCC version 8 error -Werror=stringop-truncation.
Signed-off-by: Ophir Munk <ophirmu@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
63783b01 |
| 17-Jun-2020 |
David Marchand <david.marchand@redhat.com> |
net/mlx5: remove redundant newline from logs
The DRV_LOG macro already appends a newline.
Fixes: 46287eacc1b1 ("net/mlx5: introduce hash list") Fixes: 860897d2895a ("net/mlx5: reorganize flow table
net/mlx5: remove redundant newline from logs
The DRV_LOG macro already appends a newline.
Fixes: 46287eacc1b1 ("net/mlx5: introduce hash list") Fixes: 860897d2895a ("net/mlx5: reorganize flow tables with hash list") Fixes: e484e4032332 ("net/mlx5: optimize tag traversal with hash list") Fixes: 6801116688fe ("net/mlx5: fix multiple flow table hash list") Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Xiaoyu Min <jackmin@mellanox.com>
show more ...
|
#
aec086c9 |
| 18-Jun-2020 |
Matan Azrad <matan@mellanox.com> |
common/mlx5: share kernel interface name getter
Some configuration of the mlx5 port are done by the kernel net device associated to the IB device represents the PCI device.
The DPDK mlx5 driver use
common/mlx5: share kernel interface name getter
Some configuration of the mlx5 port are done by the kernel net device associated to the IB device represents the PCI device.
The DPDK mlx5 driver uses Linux system calls, for example ioctl, in order to configure per port configurations requested by the DPDK user.
One of the basic knowledges required to access the correct kernel net device is its name.
Move function to get interface name from IB device path to the common library.
Signed-off-by: Matan Azrad <matan@mellanox.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
show more ...
|
#
4f96d913 |
| 16-Jun-2020 |
Ophir Munk <ophirmu@mellanox.com> |
net/mlx5/linux: add memory region callbacks to Verbs
Create a set of verbs callbacks in 'struct mlx5_verbs_ops' and add MR operations to it (file net/mlx5/linux/mlx5_verbs.c).
Signed-off-by: Ophir
net/mlx5/linux: add memory region callbacks to Verbs
Create a set of verbs callbacks in 'struct mlx5_verbs_ops' and add MR operations to it (file net/mlx5/linux/mlx5_verbs.c).
Signed-off-by: Ophir Munk <ophirmu@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|
#
d5ed8aa9 |
| 16-Jun-2020 |
Ophir Munk <ophirmu@mellanox.com> |
net/mlx5: add memory region callbacks in per-device cache
Prior to this commit MR operations were verbs based and hard coded under common/mlx5/linux directory. This commit enables upper layers (e.g.
net/mlx5: add memory region callbacks in per-device cache
Prior to this commit MR operations were verbs based and hard coded under common/mlx5/linux directory. This commit enables upper layers (e.g. net/mlx5) to determine which MR operations to use. For example the net layer could set devx based MR operations in non-Linux environments. The reg_mr and dereg_mr callbacks are added to the global per-device MR cache 'struct mlx5_mr_share_cache'.
Signed-off-by: Ophir Munk <ophirmu@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
show more ...
|