2 Copyright(c) 2017 Marvell International Ltd.
3 Copyright(c) 2017 Semihalf.
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
10 * Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 * Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in
14 the documentation and/or other materials provided with the
16 * Neither the name of the copyright holder nor the names of its
17 contributors may be used to endorse or promote products derived
18 from this software without specific prior written permission.
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 .. _mrvl_poll_mode_driver:
35 ======================
37 The MRVL PMD (librte_pmd_mrvl) provides poll mode driver support
38 for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter.
40 Detailed information about SoCs that use PPv2 can be obtained here:
42 * https://www.marvell.com/embedded-processors/armada-70xx/
43 * https://www.marvell.com/embedded-processors/armada-80xx/
47 Due to external dependencies, this driver is disabled by default. It must
48 be enabled manually by setting relevant configuration option manually.
49 Please refer to `Config File Options`_ section for further details.
55 Features of the MRVL PMD are:
65 - Multicast MAC filter
79 - Number of lcores is limited to 9 by MUSDK internal design. If more lcores
80 need to be allocated, locking will have to be considered. Number of available
81 lcores can be changed via ``MRVL_MUSDK_HIFS_RESERVED`` define in
82 ``mrvl_ethdev.c`` source file.
84 - Flushing vlans added for filtering is not possible due to MUSDK missing
85 functionality. Current workaround is to reset board so that PPv2 has a
86 chance to start in a sane state.
92 - Custom Linux Kernel sources
94 .. code-block:: console
96 git clone https://github.com/MarvellEmbeddedProcessors/linux-marvell.git -b linux-4.4.52-armada-17.10
98 - Out of tree `mvpp2x_sysfs` kernel module sources
100 .. code-block:: console
102 git clone https://github.com/MarvellEmbeddedProcessors/mvpp2x-marvell.git -b mvpp2x-armada-17.10
104 - MUSDK (Marvell User-Space SDK) sources
106 .. code-block:: console
108 git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell.git -b musdk-armada-17.10
110 MUSDK is a light-weight library that provides direct access to Marvell's
111 PPv2 (Packet Processor v2). Alternatively prebuilt MUSDK library can be
112 requested from `Marvell Extranet <https://extranet.marvell.com>`_. Once
113 approval has been granted, library can be found by typing ``musdk`` in
116 MUSDK must be configured with the following features:
118 .. code-block:: console
120 --enable-bpool-dma=64
124 Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup
131 The following options can be modified in the ``config`` file.
133 - ``CONFIG_RTE_LIBRTE_MRVL_PMD`` (default ``n``)
135 Toggle compilation of the librte_pmd_mrvl driver.
141 QoS configuration is done through external configuration file. Path to the
142 file must be given as `cfg` in driver's vdev parameter list.
147 .. code-block:: console
149 [port <portnum> default]
150 default_tc = <default_tc>
151 mapping_priority = <mapping_priority>
153 [port <portnum> tc <traffic_class>]
154 rxq = <rx_queue_list>
158 [port <portnum> tc <traffic_class>]
159 rxq = <rx_queue_list>
165 - ``<portnum>``: DPDK Port number (0..n).
167 - ``<default_tc>``: Default traffic class (e.g. 0)
169 - ``<mapping_priority>``: QoS priority for mapping (`ip`, `vlan`, `ip/vlan` or `vlan/ip`).
171 - ``<traffic_class>``: Traffic Class to be configured.
173 - ``<rx_queue_list>``: List of DPDK RX queues (e.g. 0 1 3-4)
175 - ``<pcp_list>``: List of PCP values to handle in particular TC (e.g. 0 1 3-4 7).
177 - ``<dscp_list>``: List of DSCP values to handle in particular TC (e.g. 0-12 32-48 63).
179 Setting PCP/DSCP values for the default TC is not required. All PCP/DSCP
180 values not assigned explicitly to particular TC will be handled by the
183 Configuration file example
184 ^^^^^^^^^^^^^^^^^^^^^^^^^^
186 .. code-block:: console
215 .. code-block:: console
217 ./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2,cfg=/home/user/mrvl.conf \
218 -c 7 -- -i -a --disable-hw-vlan-strip --rxq=2
224 Driver needs precompiled MUSDK library during compilation.
226 .. code-block:: console
228 export CROSS_COMPILE=<toolchain>/bin/aarch64-linux-gnu-
230 ./configure --host=aarch64-linux-gnu --enable-bpool-dma=64
233 MUSDK will be installed to `usr/local` under current directory.
234 For the detailed build instructions please consult ``doc/musdk_get_started.txt``.
236 Before the DPDK build process the environmental variable ``LIBMUSDK_PATH`` with
237 the path to the MUSDK installation directory needs to be exported.
239 .. code-block:: console
241 export LIBMUSDK_PATH=<musdk>/usr/local
242 export CROSS=aarch64-linux-gnu-
243 make config T=arm64-armv8a-linuxapp-gcc
244 sed -ri 's,(MRVL_PMD=)n,\1y,' build/.config
250 MRVL PMD requires extra out of tree kernel modules to function properly.
251 `musdk_uio` and `mv_pp_uio` sources are part of the MUSDK. Please consult
252 ``doc/musdk_get_started.txt`` for the detailed build instructions.
253 For `mvpp2x_sysfs` please consult ``Documentation/pp22_sysfs.txt`` for the
254 detailed build instructions.
256 .. code-block:: console
260 insmod mvpp2x_sysfs.ko
262 Additionally interfaces used by DPDK application need to be put up:
264 .. code-block:: console
269 In order to run testpmd example application following command can be used:
271 .. code-block:: console
273 ./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2 -c 7 -- \
274 --burst=128 --txd=2048 --rxd=1024 --rxq=2 --txq=2 --nb-cores=2 \
275 -i -a --disable-hw-vlan-strip --rss-udp