7ea003c6514acc610c5fa391d0511cb2adb51f10
[dpdk.git] / doc / guides / nics / mvneta.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2018 Marvell International Ltd.
3     Copyright(c) 2018 Semihalf.
4     All rights reserved.
5
6 MVNETA Poll Mode Driver
7 =======================
8
9 The MVNETA PMD (librte_pmd_mvneta) provides poll mode driver support
10 for the Marvell NETA 1/2.5 Gbps adapter.
11
12 Detailed information about SoCs that use PPv2 can be obtained here:
13
14 * https://www.marvell.com/embedded-processors/armada-3700/
15
16 .. Note::
17
18    Due to external dependencies, this driver is disabled by default. It must
19    be enabled manually by setting relevant configuration option manually.
20    Please refer to `Config File Options`_ section for further details.
21
22
23 Features
24 --------
25
26 Features of the MVNETA PMD are:
27
28 - Start/stop
29 - tx/rx_queue_setup
30 - tx/rx_burst
31 - Speed capabilities
32 - Jumbo frame
33 - CRC offload
34 - L3 checksum offload
35 - L4 checksum offload
36 - Packet type parsing
37
38
39 Limitations
40 -----------
41
42 - Flushing vlans added for filtering is not possible due to MUSDK missing
43   functionality. Current workaround is to reset board so that NETA has a
44   chance to start in a sane state.
45
46 Prerequisites
47 -------------
48
49 - Custom Linux Kernel sources
50
51   .. code-block:: console
52
53      git clone https://github.com/MarvellEmbeddedProcessors/linux-marvell.git -b linux-4.4.120-armada-18.09
54
55
56 - MUSDK (Marvell User-Space SDK) sources
57
58   .. code-block:: console
59
60      git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell.git -b musdk-armada-18.09
61
62   MUSDK is a light-weight library that provides direct access to Marvell's
63   NETA. Alternatively prebuilt MUSDK library can be
64   requested from `Marvell Extranet <https://extranet.marvell.com>`_. Once
65   approval has been granted, library can be found by typing ``musdk`` in
66   the search box.
67
68   MUSDK must be configured with the following features:
69
70   .. code-block:: console
71
72      --enable-pp2=no --enable-neta
73
74 - DPDK environment
75
76   Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup
77   DPDK environment.
78
79 Pre-Installation Configuration
80 ------------------------------
81
82 Config File Options
83 ~~~~~~~~~~~~~~~~~~~
84
85 The following options can be modified in the ``config`` file.
86
87 - ``CONFIG_RTE_LIBRTE_MVNETA_PMD`` (default ``n``)
88
89     Toggle compilation of the librte_pmd_mvneta driver.
90
91 Runtime options
92 ~~~~~~~~~~~~~~~
93
94 The following ``devargs`` options can be enabled at runtime. They must
95 be passed as part of EAL arguments.
96
97 - ``iface`` (mandatory, with no default value)
98
99   The name of port (owned by MUSDK) that should be enabled in DPDK.
100   This options can be repeated resulting in a list of ports to be
101   enabled.  For instance below will enable ``eth0`` and ``eth1`` ports.
102
103 .. code-block:: console
104
105    ./testpmd --vdev=net_mvneta,iface=eth0,iface=eth1 \
106     -c 3 -- -i --p 3 -a
107
108
109 Building DPDK
110 -------------
111
112 Driver needs precompiled MUSDK library during compilation.
113
114 .. code-block:: console
115
116    export CROSS_COMPILE=<toolchain>/bin/aarch64-linux-gnu-
117    ./bootstrap
118    ./configure --host=aarch64-linux-gnu --enable-pp2=no --enable-neta
119    make install
120
121 MUSDK will be installed to `usr/local` under current directory.
122 For the detailed build instructions please consult ``doc/musdk_get_started.txt``.
123
124 Before the DPDK build process the environmental variable ``LIBMUSDK_PATH`` with
125 the path to the MUSDK installation directory needs to be exported.
126
127 .. code-block:: console
128
129    export LIBMUSDK_PATH=<musdk>/usr/local
130    export CROSS=aarch64-linux-gnu-
131    make config T=arm64-armv8a-linuxapp-gcc
132    sed -ri 's,(MVNETA_PMD=)n,\1y,' build/.config
133    make
134
135 Usage Example
136 -------------
137
138 MVNETA PMD requires extra out of tree kernel modules to function properly.
139 `musdk_uio` and `mv_neta_uio` sources are part of the MUSDK. Please consult
140 ``doc/musdk_get_started.txt`` for the detailed build instructions.
141
142 .. code-block:: console
143
144    insmod musdk_uio.ko
145    insmod mv_neta_uio.ko
146
147 Additionally interfaces used by DPDK application need to be put up:
148
149 .. code-block:: console
150
151    ip link set eth0 up
152    ip link set eth1 up
153
154 In order to run testpmd example application following command can be used:
155
156 .. code-block:: console
157
158    ./testpmd --vdev=net_mvneta,iface=eth0,iface=eth1 -c 3 -- \
159      -i --p 3 -a --txd 256 --rxd 128 --rxq=1 --txq=1  --nb-cores=1
160
161
162 In order to run l2fwd example application following command can be used:
163
164 .. code-block:: console
165
166    ./l2fwd --vdev=net_mvneta,iface=eth0,iface=eth1 -c 3 -- -T 1 -p 3