xref: /dpdk/doc/guides/vdpadevs/mlx5.rst (revision cb0da841649ee317e44faacbc4063caa26008366)
195276abaSMatan Azrad..  SPDX-License-Identifier: BSD-3-Clause
295276abaSMatan Azrad    Copyright 2019 Mellanox Technologies, Ltd
395276abaSMatan Azrad
4ee76bddcSThomas Monjalon.. include:: <isonum.txt>
5ee76bddcSThomas Monjalon
60f91f952SThomas MonjalonNVIDIA MLX5 vDPA Driver
70f91f952SThomas Monjalon=======================
80f91f952SThomas Monjalon
90f91f952SThomas Monjalon.. note::
100f91f952SThomas Monjalon
110f91f952SThomas Monjalon   NVIDIA acquired Mellanox Technologies in 2020.
120f91f952SThomas Monjalon   The DPDK documentation and code might still include instances
130f91f952SThomas Monjalon   of or references to Mellanox trademarks (like BlueField and ConnectX)
140f91f952SThomas Monjalon   that are now NVIDIA trademarks.
1595276abaSMatan Azrad
16a3ade5e3SMichael BaumThe mlx5 vDPA (vhost data path acceleration) driver library
177b61f14eSRaslan Darawsheh(**librte_vdpa_mlx5**) provides support for **NVIDIA ConnectX-6**,
187b61f14eSRaslan Darawsheh**NVIDIA ConnectX-6 Dx**, **NVIDIA ConnectX-6 Lx**, **NVIDIA ConnectX7**,
19*cb0da841SRaslan Darawsheh**NVIDIA BlueField**, **NVIDIA BlueField-2** and **NVIDIA BlueField-3** families
20*cb0da841SRaslan Darawshehof 10/25/40/50/100/200 Gb/s adapters as well as their virtual functions (VF) in
2195276abaSMatan AzradSR-IOV context.
2295276abaSMatan Azrad
2395276abaSMatan Azrad.. note::
2495276abaSMatan Azrad
25dde524d3SCiara Power   This driver is enabled automatically when using "meson" build system which
2695276abaSMatan Azrad   will detect dependencies.
2795276abaSMatan Azrad
28a3ade5e3SMichael BaumSee :doc:`../../platform/mlx5` guide for design details,
29a3ade5e3SMichael Baumand which PMDs can be combined with vDPA PMD.
3095276abaSMatan Azrad
3195276abaSMatan AzradSupported NICs
3295276abaSMatan Azrad--------------
3395276abaSMatan Azrad
347b61f14eSRaslan Darawsheh* NVIDIA\ |reg| ConnectX\ |reg|-6 200G MCX654106A-HCAT (2x200G)
357b61f14eSRaslan Darawsheh* NVIDIA\ |reg| ConnectX\ |reg|-6 Dx EN 25G MCX621102AN-ADAT (2x25G)
367b61f14eSRaslan Darawsheh* NVIDIA\ |reg| ConnectX\ |reg|-6 Dx EN 100G MCX623106AN-CDAT (2x100G)
377b61f14eSRaslan Darawsheh* NVIDIA\ |reg| ConnectX\ |reg|-6 Dx EN 200G MCX623105AN-VDAT (1x200G)
387b61f14eSRaslan Darawsheh* NVIDIA\ |reg| ConnectX\ |reg|-6 Lx EN 25G MCX631102AN-ADAT (2x25G)
397b61f14eSRaslan Darawsheh* NVIDIA\ |reg| ConnectX\ |reg|-7 200G CX713106AE-HEA_QP1_Ax (2x200G)
407b61f14eSRaslan Darawsheh* NVIDIA\ |reg| BlueField SmartNIC 25G MBF1M332A-ASCAT (2x25G)
417b61f14eSRaslan Darawsheh* NVIDIA\ |reg| BlueField |reg|-2 SmartNIC MT41686 - MBF2H332A-AEEOT_A1 (2x25G)
42*cb0da841SRaslan Darawsheh* NVIDIA\ |reg| BlueField\ |reg|-3 200GbE 900-9D3B6-00CV-AAB_Ax
4395276abaSMatan Azrad
4495276abaSMatan AzradPrerequisites
4595276abaSMatan Azrad-------------
4695276abaSMatan Azrad
470f91f952SThomas Monjalon- NVIDIA MLNX_OFED version: **5.0**
48a3ade5e3SMichael Baum  See :ref:`mlx5 common prerequisites <mlx5_linux_prerequisites>` for more details.
4995276abaSMatan Azrad
5095276abaSMatan AzradRun-time configuration
5195276abaSMatan Azrad~~~~~~~~~~~~~~~~~~~~~~
5295276abaSMatan Azrad
53edc6391eSMatan AzradDriver options
54edc6391eSMatan Azrad^^^^^^^^^^^^^^
55edc6391eSMatan Azrad
56a3ade5e3SMichael BaumPlease refer to :ref:`mlx5 common options <mlx5_common_driver_options>`
57a3ade5e3SMichael Baumfor an additional list of options shared with other mlx5 drivers.
5895276abaSMatan Azrad
59edc6391eSMatan Azrad- ``event_mode`` parameter [int]
60edc6391eSMatan Azrad
61edc6391eSMatan Azrad  - 0, Completion queue scheduling will be managed by a timer thread which
62edc6391eSMatan Azrad    automatically adjusts its delays to the coming traffic rate.
63edc6391eSMatan Azrad
64edc6391eSMatan Azrad  - 1, Completion queue scheduling will be managed by a timer thread with fixed
65edc6391eSMatan Azrad    delay time.
66edc6391eSMatan Azrad
67edc6391eSMatan Azrad  - 2, Completion queue scheduling will be managed by interrupts. Each CQ burst
68edc6391eSMatan Azrad    arms the CQ in order to get an interrupt event in the next traffic burst.
69edc6391eSMatan Azrad
7005421ec9SXueming Li  - Default mode is 1.
71edc6391eSMatan Azrad
72edc6391eSMatan Azrad- ``event_us`` parameter [int]
73edc6391eSMatan Azrad
74edc6391eSMatan Azrad  Per mode micro-seconds parameter - relevant only for event mode 0 and 1:
75edc6391eSMatan Azrad
76edc6391eSMatan Azrad  - 0, A nonzero value to set timer step in micro-seconds. The timer thread
77edc6391eSMatan Azrad    dynamic delay change steps according to this value. Default value is 1us.
78edc6391eSMatan Azrad
796956a48cSXueming Li  - 1, A value to set fixed timer delay in micro-seconds. Default value is 0us.
80edc6391eSMatan Azrad
81edc6391eSMatan Azrad- ``no_traffic_time`` parameter [int]
82edc6391eSMatan Azrad
8399f9d799SMatan Azrad  A nonzero value defines the traffic off time, in polling cycle time units,
8499f9d799SMatan Azrad  that moves the driver to no-traffic mode. In this mode the polling is stopped
8599f9d799SMatan Azrad  and interrupts are configured to the device in order to notify traffic for the
8699f9d799SMatan Azrad  driver. Default value is 16.
870474419bSXueming Li
885cf3fd3aSXueming Li- ``event_core`` parameter [int]
895cf3fd3aSXueming Li
903aed7bbdSMatan Azrad  The CPU core number of the timer thread, default: EAL main lcore.
913aed7bbdSMatan Azrad
923aed7bbdSMatan Azrad.. note::
933aed7bbdSMatan Azrad
943aed7bbdSMatan Azrad   This core can be shared among different mlx5 vDPA devices as `event_core`
953aed7bbdSMatan Azrad   but using it also for other tasks may affect the performance and the latency
963aed7bbdSMatan Azrad   of the mlx5 vDPA devices.
975cf3fd3aSXueming Li
9867b07093SLi Zhang- ``max_conf_threads`` parameter [int]
9967b07093SLi Zhang
10067b07093SLi Zhang  Allow the driver to use internal threads to obtain fast configuration.
10167b07093SLi Zhang  All the threads will be open on the same core of the event completion queue scheduling thread.
10267b07093SLi Zhang
10367b07093SLi Zhang  - 0, default, don't use internal threads for configuration.
10467b07093SLi Zhang
10567b07093SLi Zhang  - 1 - 256, number of internal threads in addition to the caller thread (8 is suggested).
10667b07093SLi Zhang    This value, if not 0, should be the same for all the devices;
10767b07093SLi Zhang    the first probing will take it with the ``event_core``
10867b07093SLi Zhang    for all the multi-thread configurations in the driver.
10967b07093SLi Zhang
1101f93bee4SXueming Li- ``hw_latency_mode`` parameter [int]
1111f93bee4SXueming Li
1121f93bee4SXueming Li  The completion queue moderation mode:
1131f93bee4SXueming Li
1141f93bee4SXueming Li  - 0, HW default.
1151f93bee4SXueming Li
1161f93bee4SXueming Li  - 1, Latency is counted from the first packet completion report.
1171f93bee4SXueming Li
1181f93bee4SXueming Li  - 2, Latency is counted from the last packet completion.
1191f93bee4SXueming Li
1201f93bee4SXueming Li- ``hw_max_latency_us`` parameter [int]
1211f93bee4SXueming Li
1221f93bee4SXueming Li  - 1 - 4095, The maximum time in microseconds that packet completion report
1231f93bee4SXueming Li    can be delayed.
1241f93bee4SXueming Li
1251f93bee4SXueming Li  - 0, HW default.
1261f93bee4SXueming Li
1271f93bee4SXueming Li- ``hw_max_pending_comp`` parameter [int]
1281f93bee4SXueming Li
1291f93bee4SXueming Li  - 1 - 65535, The maximum number of pending packets completions in an HW queue.
1301f93bee4SXueming Li
1311f93bee4SXueming Li  - 0, HW default.
1321f93bee4SXueming Li
13342a8fc7dSYajun Wu- ``queue_size`` parameter [int]
13442a8fc7dSYajun Wu
13542a8fc7dSYajun Wu  - 1 - 1024, Virtio queue depth for pre-creating queue resource to speed up
13642a8fc7dSYajun Wu    first time queue creation. Set it together with ``queues`` parameter.
13742a8fc7dSYajun Wu
13842a8fc7dSYajun Wu  - 0, default value, no pre-create virtq resource.
13942a8fc7dSYajun Wu
14042a8fc7dSYajun Wu- ``queues`` parameter [int]
14142a8fc7dSYajun Wu
14242a8fc7dSYajun Wu  - 1 - 128, Maximum number of virtio queue pair (including 1 Rx queue and 1 Tx queue)
14342a8fc7dSYajun Wu    for pre-creating queue resource to speed up first time queue creation.
14442a8fc7dSYajun Wu    Set it together with ``queue_size`` parameter.
14542a8fc7dSYajun Wu
14642a8fc7dSYajun Wu  - 0, default value, no pre-create virtq resource.
1471f93bee4SXueming Li
1480474419bSXueming LiError handling
1490474419bSXueming Li^^^^^^^^^^^^^^
1500474419bSXueming Li
1510474419bSXueming LiUpon potential hardware errors, mlx5 PMD try to recover, give up if failed 3
1520474419bSXueming Litimes in 3 seconds, virtq will be put in disable state. User should check log
1530474419bSXueming Lito get error information, or query vdpa statistics counter to know error type
1540474419bSXueming Liand count report.
155476048d5SXueming Li
156476048d5SXueming LiStatistics
157476048d5SXueming Li^^^^^^^^^^
158476048d5SXueming Li
159476048d5SXueming LiThe device statistics counter persists in reconfiguration until the device gets
160476048d5SXueming Liremoved. User can reset counters by calling function rte_vdpa_reset_stats().
161