5f4559cad7069c84d5648036e07f9bb83756cfe8
[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 - Speed capabilities
31 - Jumbo frame
32 - CRC offload
33
34
35 Limitations
36 -----------
37
38 - Flushing vlans added for filtering is not possible due to MUSDK missing
39   functionality. Current workaround is to reset board so that NETA has a
40   chance to start in a sane state.
41
42 Prerequisites
43 -------------
44
45 - Custom Linux Kernel sources
46
47   .. code-block:: console
48
49      git clone https://github.com/MarvellEmbeddedProcessors/linux-marvell.git -b linux-4.4.120-armada-18.09
50
51
52 - MUSDK (Marvell User-Space SDK) sources
53
54   .. code-block:: console
55
56      git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell.git -b musdk-armada-18.09
57
58   MUSDK is a light-weight library that provides direct access to Marvell's
59   NETA. Alternatively prebuilt MUSDK library can be
60   requested from `Marvell Extranet <https://extranet.marvell.com>`_. Once
61   approval has been granted, library can be found by typing ``musdk`` in
62   the search box.
63
64   MUSDK must be configured with the following features:
65
66   .. code-block:: console
67
68      --enable-pp2=no --enable-neta
69
70 - DPDK environment
71
72   Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup
73   DPDK environment.
74
75 Pre-Installation Configuration
76 ------------------------------
77
78 Config File Options
79 ~~~~~~~~~~~~~~~~~~~
80
81 The following options can be modified in the ``config`` file.
82
83 - ``CONFIG_RTE_LIBRTE_MVNETA_PMD`` (default ``n``)
84
85     Toggle compilation of the librte_pmd_mvneta driver.
86
87 Runtime options
88 ~~~~~~~~~~~~~~~
89
90 The following ``devargs`` options can be enabled at runtime. They must
91 be passed as part of EAL arguments.
92
93 - ``iface`` (mandatory, with no default value)
94
95   The name of port (owned by MUSDK) that should be enabled in DPDK.
96   This options can be repeated resulting in a list of ports to be
97   enabled.  For instance below will enable ``eth0`` and ``eth1`` ports.
98
99 .. code-block:: console
100
101    ./testpmd --vdev=net_mvneta,iface=eth0,iface=eth1 \
102     -c 3 -- -i --p 3 -a
103
104
105 Building DPDK
106 -------------
107
108 Driver needs precompiled MUSDK library during compilation.
109
110 .. code-block:: console
111
112    export CROSS_COMPILE=<toolchain>/bin/aarch64-linux-gnu-
113    ./bootstrap
114    ./configure --host=aarch64-linux-gnu --enable-pp2=no --enable-neta
115    make install
116
117 MUSDK will be installed to `usr/local` under current directory.
118 For the detailed build instructions please consult ``doc/musdk_get_started.txt``.
119
120 Before the DPDK build process the environmental variable ``LIBMUSDK_PATH`` with
121 the path to the MUSDK installation directory needs to be exported.
122
123 .. code-block:: console
124
125    export LIBMUSDK_PATH=<musdk>/usr/local
126    export CROSS=aarch64-linux-gnu-
127    make config T=arm64-armv8a-linuxapp-gcc
128    sed -ri 's,(MVNETA_PMD=)n,\1y,' build/.config
129    make
130
131 Usage Example
132 -------------
133
134 MVNETA PMD requires extra out of tree kernel modules to function properly.
135 `musdk_uio` and `mv_neta_uio` sources are part of the MUSDK. Please consult
136 ``doc/musdk_get_started.txt`` for the detailed build instructions.
137
138 .. code-block:: console
139
140    insmod musdk_uio.ko
141    insmod mv_neta_uio.ko
142
143 Additionally interfaces used by DPDK application need to be put up:
144
145 .. code-block:: console
146
147    ip link set eth0 up
148    ip link set eth1 up
149
150 In order to run testpmd example application following command can be used:
151
152 .. code-block:: console
153
154    ./testpmd --vdev=net_mvneta,iface=eth0,iface=eth1 -c 3 -- \
155      -i --p 3 -a --txd 256 --rxd 128 --rxq=1 --txq=1  --nb-cores=1
156
157
158 In order to run l2fwd example application following command can be used:
159
160 .. code-block:: console
161
162    ./l2fwd --vdev=net_mvneta,iface=eth0,iface=eth1 -c 3 -- -T 1 -p 3