1 .. SPDX-License-Identifier: BSD-3-Clause
2 Copyright(C) 2019 Marvell International Ltd.
4 OCTEON TX2 Poll Mode driver
5 ===========================
7 The OCTEON TX2 ETHDEV PMD (**librte_pmd_octeontx2**) provides poll mode ethdev
8 driver support for the inbuilt network device found in **Marvell OCTEON TX2**
9 SoC family as well as for their virtual functions (VF) in SR-IOV context.
11 More information can be found at `Marvell Official Website
12 <https://www.marvell.com/embedded-processors/infrastructure-processors>`_.
17 Features of the OCTEON TX2 Ethdev PMD are:
19 - Packet type information
24 - Multiple queues for TX and RX
25 - Receiver Side Scaling (RSS)
27 - Multicast MAC filtering
29 - Inner and Outer Checksum offload
30 - VLAN/QinQ stripping and insertion
31 - Port hardware statistics
32 - Link state information
35 - Scatter-Gather IO support
36 - Vector Poll mode driver
37 - Debug utilities - Context dump and error interrupt support
38 - IEEE1588 timestamping
39 - HW offloaded `ethdev Rx queue` to `eventdev event queue` packet injection
40 - Support Rx interrupt
45 See :doc:`../platform/octeontx2` for setup information.
47 Compile time Config Options
48 ---------------------------
50 The following options may be modified in the ``config`` file.
52 - ``CONFIG_RTE_LIBRTE_OCTEONTX2_PMD`` (default ``y``)
54 Toggle compilation of the ``librte_pmd_octeontx2`` driver.
56 Driver compilation and testing
57 ------------------------------
59 Refer to the document :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
62 To compile the OCTEON TX2 PMD for Linux arm64 gcc,
63 use arm64-octeontx2-linux-gcc as target.
67 Follow instructions available in the document
68 :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
73 .. code-block:: console
75 ./build/app/testpmd -c 0x300 -w 0002:02:00.0 -- --portmask=0x1 --nb-cores=1 --port-topology=loop --rxq=1 --txq=1
76 EAL: Detected 24 lcore(s)
77 EAL: Detected 1 NUMA nodes
78 EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
79 EAL: No available hugepages reported in hugepages-2048kB
80 EAL: Probing VFIO support...
81 EAL: VFIO support initialized
82 EAL: PCI device 0002:02:00.0 on NUMA socket 0
83 EAL: probe driver: 177d:a063 net_octeontx2
84 EAL: using IOMMU type 1 (Type 1)
85 testpmd: create a new mbuf pool <mbuf_pool_socket_0>: n=267456, size=2176, socket=0
86 testpmd: preferred mempool ops selected: octeontx2_npa
87 Configuring Port 0 (socket 0)
88 PMD: Port 0: Link Up - speed 40000 Mbps - full-duplex
90 Port 0: link state change event
91 Port 0: 36:10:66:88:7A:57
92 Checking link statuses...
94 No commandline core given, start packet forwarding
95 io packet forwarding - ports=1 - cores=1 - streams=1 - NUMA support enabled, MP allocation mode: native
96 Logical Core 9 (socket 0) forwards packets on 1 streams:
97 RX P=0/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
99 io packet forwarding packets/burst=32
100 nb forwarding cores=1 - nb forwarding ports=1
101 port 0: RX queue number: 1 Tx queue number: 1
102 Rx offloads=0x0 Tx offloads=0x10000
104 RX desc=512 - RX free threshold=0
105 RX threshold registers: pthresh=0 hthresh=0 wthresh=0
108 TX desc=512 - TX free threshold=0
109 TX threshold registers: pthresh=0 hthresh=0 wthresh=0
110 TX offloads=0x10000 - TX RS bit threshold=0
113 Runtime Config Options
114 ----------------------
116 - ``HW offload ptype parsing disable`` (default ``0``)
118 Packet type parsing is HW offloaded by default and this feature may be toggled
119 using ``ptype_disable`` ``devargs`` parameter.
121 - ``Rx&Tx scalar mode enable`` (default ``0``)
123 Ethdev supports both scalar and vector mode, it may be selected at runtime
124 using ``scalar_enable`` ``devargs`` parameter.
126 - ``RSS reta size`` (default ``64``)
128 RSS redirection table size may be configured during runtime using ``reta_size``
129 ``devargs`` parameter.
133 -w 0002:02:00.0,reta_size=256
135 With the above configuration, reta table of size 256 is populated.
137 - ``Flow priority levels`` (default ``3``)
139 RTE Flow priority levels can be configured during runtime using
140 ``flow_max_priority`` ``devargs`` parameter.
144 -w 0002:02:00.0,flow_max_priority=10
146 With the above configuration, priority level was set to 10 (0-9). Max
147 priority level supported is 32.
149 - ``Reserve Flow entries`` (default ``8``)
151 RTE flow entries can be pre allocated and the size of pre allocation can be
152 selected runtime using ``flow_prealloc_size`` ``devargs`` parameter.
156 -w 0002:02:00.0,flow_prealloc_size=4
158 With the above configuration, pre alloc size was set to 4. Max pre alloc
159 size supported is 32.
161 - ``Max SQB buffer count`` (default ``512``)
163 Send queue descriptor buffer count may be limited during runtime using
164 ``max_sqb_count`` ``devargs`` parameter.
168 -w 0002:02:00.0,max_sqb_count=64
170 With the above configuration, each send queue's decscriptor buffer count is
171 limited to a maximum of 64 buffers.
173 - ``switch header enable`` (default ``none``)
175 A port can be configured to a specific switch header type by using
176 ``switch_header`` ``devargs`` parameter.
180 -w 0002:02:00.0,switch_header="higig2"
182 With the above configuration, higig2 will be enabled on that port and the
183 traffic on this port should be higig2 traffic only. Supported switch header
184 types are "higig2" and "dsa".
188 Above devarg parameters are configurable per device, user needs to pass the
189 parameters to all the PCIe devices if application requires to configure on
190 all the ethdev ports.
195 ``mempool_octeontx2`` external mempool handler dependency
196 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
198 The OCTEON TX2 SoC family NIC has inbuilt HW assisted external mempool manager.
199 ``net_octeontx2`` pmd only works with ``mempool_octeontx2`` mempool handler
200 as it is performance wise most effective way for packet allocation and Tx buffer
201 recycling on OCTEON TX2 SoC platform.
206 The OCTEON TX2 SoC family NICs strip the CRC for every packet being received by
207 the host interface irrespective of the offload configuration.
209 Multicast MAC filtering
210 ~~~~~~~~~~~~~~~~~~~~~~~
212 ``net_octeontx2`` pmd supports multicast mac filtering feature only on physical
215 SDP interface support
216 ~~~~~~~~~~~~~~~~~~~~~
217 OCTEON TX2 SDP interface support is limited to PF device, No VF support.
222 .. _table_octeontx2_ethdev_debug_options:
224 .. table:: OCTEON TX2 ethdev debug options
226 +---+------------+-------------------------------------------------------+
227 | # | Component | EAL log command |
228 +===+============+=======================================================+
229 | 1 | NIX | --log-level='pmd\.net.octeontx2,8' |
230 +---+------------+-------------------------------------------------------+
231 | 2 | NPC | --log-level='pmd\.net.octeontx2\.flow,8' |
232 +---+------------+-------------------------------------------------------+
237 The OCTEON TX2 SoC family NIC has support for the following patterns and
242 .. _table_octeontx2_supported_flow_item_types:
244 .. table:: Item types
246 +----+--------------------------------+
248 +====+================================+
249 | 1 | RTE_FLOW_ITEM_TYPE_ETH |
250 +----+--------------------------------+
251 | 2 | RTE_FLOW_ITEM_TYPE_VLAN |
252 +----+--------------------------------+
253 | 3 | RTE_FLOW_ITEM_TYPE_E_TAG |
254 +----+--------------------------------+
255 | 4 | RTE_FLOW_ITEM_TYPE_IPV4 |
256 +----+--------------------------------+
257 | 5 | RTE_FLOW_ITEM_TYPE_IPV6 |
258 +----+--------------------------------+
259 | 6 | RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4|
260 +----+--------------------------------+
261 | 7 | RTE_FLOW_ITEM_TYPE_MPLS |
262 +----+--------------------------------+
263 | 8 | RTE_FLOW_ITEM_TYPE_ICMP |
264 +----+--------------------------------+
265 | 9 | RTE_FLOW_ITEM_TYPE_UDP |
266 +----+--------------------------------+
267 | 10 | RTE_FLOW_ITEM_TYPE_TCP |
268 +----+--------------------------------+
269 | 11 | RTE_FLOW_ITEM_TYPE_SCTP |
270 +----+--------------------------------+
271 | 12 | RTE_FLOW_ITEM_TYPE_ESP |
272 +----+--------------------------------+
273 | 13 | RTE_FLOW_ITEM_TYPE_GRE |
274 +----+--------------------------------+
275 | 14 | RTE_FLOW_ITEM_TYPE_NVGRE |
276 +----+--------------------------------+
277 | 15 | RTE_FLOW_ITEM_TYPE_VXLAN |
278 +----+--------------------------------+
279 | 16 | RTE_FLOW_ITEM_TYPE_GTPC |
280 +----+--------------------------------+
281 | 17 | RTE_FLOW_ITEM_TYPE_GTPU |
282 +----+--------------------------------+
283 | 18 | RTE_FLOW_ITEM_TYPE_GENEVE |
284 +----+--------------------------------+
285 | 19 | RTE_FLOW_ITEM_TYPE_VXLAN_GPE |
286 +----+--------------------------------+
287 | 20 | RTE_FLOW_ITEM_TYPE_IPV6_EXT |
288 +----+--------------------------------+
289 | 21 | RTE_FLOW_ITEM_TYPE_VOID |
290 +----+--------------------------------+
291 | 22 | RTE_FLOW_ITEM_TYPE_ANY |
292 +----+--------------------------------+
293 | 23 | RTE_FLOW_ITEM_TYPE_GRE_KEY |
294 +----+--------------------------------+
295 | 24 | RTE_FLOW_ITEM_TYPE_HIGIG2 |
296 +----+--------------------------------+
300 ``RTE_FLOW_ITEM_TYPE_GRE_KEY`` works only when checksum and routing
301 bits in the GRE header are equal to 0.
305 .. _table_octeontx2_supported_ingress_action_types:
307 .. table:: Ingress action types
309 +----+--------------------------------+
311 +====+================================+
312 | 1 | RTE_FLOW_ACTION_TYPE_VOID |
313 +----+--------------------------------+
314 | 2 | RTE_FLOW_ACTION_TYPE_MARK |
315 +----+--------------------------------+
316 | 3 | RTE_FLOW_ACTION_TYPE_FLAG |
317 +----+--------------------------------+
318 | 4 | RTE_FLOW_ACTION_TYPE_COUNT |
319 +----+--------------------------------+
320 | 5 | RTE_FLOW_ACTION_TYPE_DROP |
321 +----+--------------------------------+
322 | 6 | RTE_FLOW_ACTION_TYPE_QUEUE |
323 +----+--------------------------------+
324 | 7 | RTE_FLOW_ACTION_TYPE_RSS |
325 +----+--------------------------------+
326 | 8 | RTE_FLOW_ACTION_TYPE_SECURITY |
327 +----+--------------------------------+
328 | 9 | RTE_FLOW_ACTION_TYPE_PF |
329 +----+--------------------------------+
330 | 10 | RTE_FLOW_ACTION_TYPE_VF |
331 +----+--------------------------------+
333 .. _table_octeontx2_supported_egress_action_types:
335 .. table:: Egress action types
337 +----+--------------------------------+
339 +====+================================+
340 | 1 | RTE_FLOW_ACTION_TYPE_COUNT |
341 +----+--------------------------------+
342 | 2 | RTE_FLOW_ACTION_TYPE_DROP |
343 +----+--------------------------------+