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