]> git.proxmox.com Git - ceph.git/blob - ceph/src/dpdk/lib/librte_mbuf/rte_mbuf_ptype.h
bump version to 12.2.12-pve1
[ceph.git] / ceph / src / dpdk / lib / librte_mbuf / rte_mbuf_ptype.h
1 /*-
2 * BSD LICENSE
3 *
4 * Copyright(c) 2010-2016 Intel Corporation.
5 * Copyright 2014-2016 6WIND S.A.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
18 * * Neither the name of Intel Corporation nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35 #ifndef _RTE_MBUF_PTYPE_H_
36 #define _RTE_MBUF_PTYPE_H_
37
38 /**
39 * @file
40 * RTE Mbuf Packet Types
41 *
42 * This file contains declarations for features related to mbuf packet
43 * types. The packet type gives information about the data carried by the
44 * mbuf, and is stored in the mbuf in a 32 bits field.
45 *
46 * The 32 bits are divided into several fields to mark packet types. Note that
47 * each field is indexical.
48 * - Bit 3:0 is for L2 types.
49 * - Bit 7:4 is for L3 or outer L3 (for tunneling case) types.
50 * - Bit 11:8 is for L4 or outer L4 (for tunneling case) types.
51 * - Bit 15:12 is for tunnel types.
52 * - Bit 19:16 is for inner L2 types.
53 * - Bit 23:20 is for inner L3 types.
54 * - Bit 27:24 is for inner L4 types.
55 * - Bit 31:28 is reserved.
56 *
57 * To be compatible with Vector PMD, RTE_PTYPE_L3_IPV4, RTE_PTYPE_L3_IPV4_EXT,
58 * RTE_PTYPE_L3_IPV6, RTE_PTYPE_L3_IPV6_EXT, RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_UDP
59 * and RTE_PTYPE_L4_SCTP should be kept as below in a contiguous 7 bits.
60 *
61 * Note that L3 types values are selected for checking IPV4/IPV6 header from
62 * performance point of view. Reading annotations of RTE_ETH_IS_IPV4_HDR and
63 * RTE_ETH_IS_IPV6_HDR is needed for any future changes of L3 type values.
64 *
65 * Note that the packet types of the same packet recognized by different
66 * hardware may be different, as different hardware may have different
67 * capability of packet type recognition.
68 *
69 * examples:
70 * <'ether type'=0x0800
71 * | 'version'=4, 'protocol'=0x29
72 * | 'version'=6, 'next header'=0x3A
73 * | 'ICMPv6 header'>
74 * will be recognized on i40e hardware as packet type combination of,
75 * RTE_PTYPE_L2_ETHER |
76 * RTE_PTYPE_L3_IPV4_EXT_UNKNOWN |
77 * RTE_PTYPE_TUNNEL_IP |
78 * RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN |
79 * RTE_PTYPE_INNER_L4_ICMP.
80 *
81 * <'ether type'=0x86DD
82 * | 'version'=6, 'next header'=0x2F
83 * | 'GRE header'
84 * | 'version'=6, 'next header'=0x11
85 * | 'UDP header'>
86 * will be recognized on i40e hardware as packet type combination of,
87 * RTE_PTYPE_L2_ETHER |
88 * RTE_PTYPE_L3_IPV6_EXT_UNKNOWN |
89 * RTE_PTYPE_TUNNEL_GRENAT |
90 * RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN |
91 * RTE_PTYPE_INNER_L4_UDP.
92 */
93
94 #ifdef __cplusplus
95 extern "C" {
96 #endif
97
98 /**
99 * No packet type information.
100 */
101 #define RTE_PTYPE_UNKNOWN 0x00000000
102 /**
103 * Ethernet packet type.
104 * It is used for outer packet for tunneling cases.
105 *
106 * Packet format:
107 * <'ether type'=[0x0800|0x86DD]>
108 */
109 #define RTE_PTYPE_L2_ETHER 0x00000001
110 /**
111 * Ethernet packet type for time sync.
112 *
113 * Packet format:
114 * <'ether type'=0x88F7>
115 */
116 #define RTE_PTYPE_L2_ETHER_TIMESYNC 0x00000002
117 /**
118 * ARP (Address Resolution Protocol) packet type.
119 *
120 * Packet format:
121 * <'ether type'=0x0806>
122 */
123 #define RTE_PTYPE_L2_ETHER_ARP 0x00000003
124 /**
125 * LLDP (Link Layer Discovery Protocol) packet type.
126 *
127 * Packet format:
128 * <'ether type'=0x88CC>
129 */
130 #define RTE_PTYPE_L2_ETHER_LLDP 0x00000004
131 /**
132 * NSH (Network Service Header) packet type.
133 *
134 * Packet format:
135 * <'ether type'=0x894F>
136 */
137 #define RTE_PTYPE_L2_ETHER_NSH 0x00000005
138 /**
139 * VLAN packet type.
140 *
141 * Packet format:
142 * <'ether type'=[0x8100]>
143 */
144 #define RTE_PTYPE_L2_ETHER_VLAN 0x00000006
145 /**
146 * QinQ packet type.
147 *
148 * Packet format:
149 * <'ether type'=[0x88A8]>
150 */
151 #define RTE_PTYPE_L2_ETHER_QINQ 0x00000007
152 /**
153 * Mask of layer 2 packet types.
154 * It is used for outer packet for tunneling cases.
155 */
156 #define RTE_PTYPE_L2_MASK 0x0000000f
157 /**
158 * IP (Internet Protocol) version 4 packet type.
159 * It is used for outer packet for tunneling cases, and does not contain any
160 * header option.
161 *
162 * Packet format:
163 * <'ether type'=0x0800
164 * | 'version'=4, 'ihl'=5>
165 */
166 #define RTE_PTYPE_L3_IPV4 0x00000010
167 /**
168 * IP (Internet Protocol) version 4 packet type.
169 * It is used for outer packet for tunneling cases, and contains header
170 * options.
171 *
172 * Packet format:
173 * <'ether type'=0x0800
174 * | 'version'=4, 'ihl'=[6-15], 'options'>
175 */
176 #define RTE_PTYPE_L3_IPV4_EXT 0x00000030
177 /**
178 * IP (Internet Protocol) version 6 packet type.
179 * It is used for outer packet for tunneling cases, and does not contain any
180 * extension header.
181 *
182 * Packet format:
183 * <'ether type'=0x86DD
184 * | 'version'=6, 'next header'=0x3B>
185 */
186 #define RTE_PTYPE_L3_IPV6 0x00000040
187 /**
188 * IP (Internet Protocol) version 4 packet type.
189 * It is used for outer packet for tunneling cases, and may or maynot contain
190 * header options.
191 *
192 * Packet format:
193 * <'ether type'=0x0800
194 * | 'version'=4, 'ihl'=[5-15], <'options'>>
195 */
196 #define RTE_PTYPE_L3_IPV4_EXT_UNKNOWN 0x00000090
197 /**
198 * IP (Internet Protocol) version 6 packet type.
199 * It is used for outer packet for tunneling cases, and contains extension
200 * headers.
201 *
202 * Packet format:
203 * <'ether type'=0x86DD
204 * | 'version'=6, 'next header'=[0x0|0x2B|0x2C|0x32|0x33|0x3C|0x87],
205 * 'extension headers'>
206 */
207 #define RTE_PTYPE_L3_IPV6_EXT 0x000000c0
208 /**
209 * IP (Internet Protocol) version 6 packet type.
210 * It is used for outer packet for tunneling cases, and may or maynot contain
211 * extension headers.
212 *
213 * Packet format:
214 * <'ether type'=0x86DD
215 * | 'version'=6, 'next header'=[0x3B|0x0|0x2B|0x2C|0x32|0x33|0x3C|0x87],
216 * <'extension headers'>>
217 */
218 #define RTE_PTYPE_L3_IPV6_EXT_UNKNOWN 0x000000e0
219 /**
220 * Mask of layer 3 packet types.
221 * It is used for outer packet for tunneling cases.
222 */
223 #define RTE_PTYPE_L3_MASK 0x000000f0
224 /**
225 * TCP (Transmission Control Protocol) packet type.
226 * It is used for outer packet for tunneling cases.
227 *
228 * Packet format:
229 * <'ether type'=0x0800
230 * | 'version'=4, 'protocol'=6, 'MF'=0, 'frag_offset'=0>
231 * or,
232 * <'ether type'=0x86DD
233 * | 'version'=6, 'next header'=6>
234 */
235 #define RTE_PTYPE_L4_TCP 0x00000100
236 /**
237 * UDP (User Datagram Protocol) packet type.
238 * It is used for outer packet for tunneling cases.
239 *
240 * Packet format:
241 * <'ether type'=0x0800
242 * | 'version'=4, 'protocol'=17, 'MF'=0, 'frag_offset'=0>
243 * or,
244 * <'ether type'=0x86DD
245 * | 'version'=6, 'next header'=17>
246 */
247 #define RTE_PTYPE_L4_UDP 0x00000200
248 /**
249 * Fragmented IP (Internet Protocol) packet type.
250 * It is used for outer packet for tunneling cases.
251 *
252 * It refers to those packets of any IP types, which can be recognized as
253 * fragmented. A fragmented packet cannot be recognized as any other L4 types
254 * (RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_UDP, RTE_PTYPE_L4_SCTP, RTE_PTYPE_L4_ICMP,
255 * RTE_PTYPE_L4_NONFRAG).
256 *
257 * Packet format:
258 * <'ether type'=0x0800
259 * | 'version'=4, 'MF'=1>
260 * or,
261 * <'ether type'=0x0800
262 * | 'version'=4, 'frag_offset'!=0>
263 * or,
264 * <'ether type'=0x86DD
265 * | 'version'=6, 'next header'=44>
266 */
267 #define RTE_PTYPE_L4_FRAG 0x00000300
268 /**
269 * SCTP (Stream Control Transmission Protocol) packet type.
270 * It is used for outer packet for tunneling cases.
271 *
272 * Packet format:
273 * <'ether type'=0x0800
274 * | 'version'=4, 'protocol'=132, 'MF'=0, 'frag_offset'=0>
275 * or,
276 * <'ether type'=0x86DD
277 * | 'version'=6, 'next header'=132>
278 */
279 #define RTE_PTYPE_L4_SCTP 0x00000400
280 /**
281 * ICMP (Internet Control Message Protocol) packet type.
282 * It is used for outer packet for tunneling cases.
283 *
284 * Packet format:
285 * <'ether type'=0x0800
286 * | 'version'=4, 'protocol'=1, 'MF'=0, 'frag_offset'=0>
287 * or,
288 * <'ether type'=0x86DD
289 * | 'version'=6, 'next header'=1>
290 */
291 #define RTE_PTYPE_L4_ICMP 0x00000500
292 /**
293 * Non-fragmented IP (Internet Protocol) packet type.
294 * It is used for outer packet for tunneling cases.
295 *
296 * It refers to those packets of any IP types, while cannot be recognized as
297 * any of above L4 types (RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_UDP,
298 * RTE_PTYPE_L4_FRAG, RTE_PTYPE_L4_SCTP, RTE_PTYPE_L4_ICMP).
299 *
300 * Packet format:
301 * <'ether type'=0x0800
302 * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0, 'frag_offset'=0>
303 * or,
304 * <'ether type'=0x86DD
305 * | 'version'=6, 'next header'!=[6|17|44|132|1]>
306 */
307 #define RTE_PTYPE_L4_NONFRAG 0x00000600
308 /**
309 * Mask of layer 4 packet types.
310 * It is used for outer packet for tunneling cases.
311 */
312 #define RTE_PTYPE_L4_MASK 0x00000f00
313 /**
314 * IP (Internet Protocol) in IP (Internet Protocol) tunneling packet type.
315 *
316 * Packet format:
317 * <'ether type'=0x0800
318 * | 'version'=4, 'protocol'=[4|41]>
319 * or,
320 * <'ether type'=0x86DD
321 * | 'version'=6, 'next header'=[4|41]>
322 */
323 #define RTE_PTYPE_TUNNEL_IP 0x00001000
324 /**
325 * GRE (Generic Routing Encapsulation) tunneling packet type.
326 *
327 * Packet format:
328 * <'ether type'=0x0800
329 * | 'version'=4, 'protocol'=47>
330 * or,
331 * <'ether type'=0x86DD
332 * | 'version'=6, 'next header'=47>
333 */
334 #define RTE_PTYPE_TUNNEL_GRE 0x00002000
335 /**
336 * VXLAN (Virtual eXtensible Local Area Network) tunneling packet type.
337 *
338 * Packet format:
339 * <'ether type'=0x0800
340 * | 'version'=4, 'protocol'=17
341 * | 'destination port'=4798>
342 * or,
343 * <'ether type'=0x86DD
344 * | 'version'=6, 'next header'=17
345 * | 'destination port'=4798>
346 */
347 #define RTE_PTYPE_TUNNEL_VXLAN 0x00003000
348 /**
349 * NVGRE (Network Virtualization using Generic Routing Encapsulation) tunneling
350 * packet type.
351 *
352 * Packet format:
353 * <'ether type'=0x0800
354 * | 'version'=4, 'protocol'=47
355 * | 'protocol type'=0x6558>
356 * or,
357 * <'ether type'=0x86DD
358 * | 'version'=6, 'next header'=47
359 * | 'protocol type'=0x6558'>
360 */
361 #define RTE_PTYPE_TUNNEL_NVGRE 0x00004000
362 /**
363 * GENEVE (Generic Network Virtualization Encapsulation) tunneling packet type.
364 *
365 * Packet format:
366 * <'ether type'=0x0800
367 * | 'version'=4, 'protocol'=17
368 * | 'destination port'=6081>
369 * or,
370 * <'ether type'=0x86DD
371 * | 'version'=6, 'next header'=17
372 * | 'destination port'=6081>
373 */
374 #define RTE_PTYPE_TUNNEL_GENEVE 0x00005000
375 /**
376 * Tunneling packet type of Teredo, VXLAN (Virtual eXtensible Local Area
377 * Network) or GRE (Generic Routing Encapsulation) could be recognized as this
378 * packet type, if they can not be recognized independently as of hardware
379 * capability.
380 */
381 #define RTE_PTYPE_TUNNEL_GRENAT 0x00006000
382 /**
383 * Mask of tunneling packet types.
384 */
385 #define RTE_PTYPE_TUNNEL_MASK 0x0000f000
386 /**
387 * Ethernet packet type.
388 * It is used for inner packet type only.
389 *
390 * Packet format (inner only):
391 * <'ether type'=[0x800|0x86DD]>
392 */
393 #define RTE_PTYPE_INNER_L2_ETHER 0x00010000
394 /**
395 * Ethernet packet type with VLAN (Virtual Local Area Network) tag.
396 *
397 * Packet format (inner only):
398 * <'ether type'=[0x800|0x86DD], vlan=[1-4095]>
399 */
400 #define RTE_PTYPE_INNER_L2_ETHER_VLAN 0x00020000
401 /**
402 * QinQ packet type.
403 *
404 * Packet format:
405 * <'ether type'=[0x88A8]>
406 */
407 #define RTE_PTYPE_INNER_L2_ETHER_QINQ 0x00030000
408 /**
409 * Mask of inner layer 2 packet types.
410 */
411 #define RTE_PTYPE_INNER_L2_MASK 0x000f0000
412 /**
413 * IP (Internet Protocol) version 4 packet type.
414 * It is used for inner packet only, and does not contain any header option.
415 *
416 * Packet format (inner only):
417 * <'ether type'=0x0800
418 * | 'version'=4, 'ihl'=5>
419 */
420 #define RTE_PTYPE_INNER_L3_IPV4 0x00100000
421 /**
422 * IP (Internet Protocol) version 4 packet type.
423 * It is used for inner packet only, and contains header options.
424 *
425 * Packet format (inner only):
426 * <'ether type'=0x0800
427 * | 'version'=4, 'ihl'=[6-15], 'options'>
428 */
429 #define RTE_PTYPE_INNER_L3_IPV4_EXT 0x00200000
430 /**
431 * IP (Internet Protocol) version 6 packet type.
432 * It is used for inner packet only, and does not contain any extension header.
433 *
434 * Packet format (inner only):
435 * <'ether type'=0x86DD
436 * | 'version'=6, 'next header'=0x3B>
437 */
438 #define RTE_PTYPE_INNER_L3_IPV6 0x00300000
439 /**
440 * IP (Internet Protocol) version 4 packet type.
441 * It is used for inner packet only, and may or maynot contain header options.
442 *
443 * Packet format (inner only):
444 * <'ether type'=0x0800
445 * | 'version'=4, 'ihl'=[5-15], <'options'>>
446 */
447 #define RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN 0x00400000
448 /**
449 * IP (Internet Protocol) version 6 packet type.
450 * It is used for inner packet only, and contains extension headers.
451 *
452 * Packet format (inner only):
453 * <'ether type'=0x86DD
454 * | 'version'=6, 'next header'=[0x0|0x2B|0x2C|0x32|0x33|0x3C|0x87],
455 * 'extension headers'>
456 */
457 #define RTE_PTYPE_INNER_L3_IPV6_EXT 0x00500000
458 /**
459 * IP (Internet Protocol) version 6 packet type.
460 * It is used for inner packet only, and may or maynot contain extension
461 * headers.
462 *
463 * Packet format (inner only):
464 * <'ether type'=0x86DD
465 * | 'version'=6, 'next header'=[0x3B|0x0|0x2B|0x2C|0x32|0x33|0x3C|0x87],
466 * <'extension headers'>>
467 */
468 #define RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN 0x00600000
469 /**
470 * Mask of inner layer 3 packet types.
471 */
472 #define RTE_PTYPE_INNER_L3_MASK 0x00f00000
473 /**
474 * TCP (Transmission Control Protocol) packet type.
475 * It is used for inner packet only.
476 *
477 * Packet format (inner only):
478 * <'ether type'=0x0800
479 * | 'version'=4, 'protocol'=6, 'MF'=0, 'frag_offset'=0>
480 * or,
481 * <'ether type'=0x86DD
482 * | 'version'=6, 'next header'=6>
483 */
484 #define RTE_PTYPE_INNER_L4_TCP 0x01000000
485 /**
486 * UDP (User Datagram Protocol) packet type.
487 * It is used for inner packet only.
488 *
489 * Packet format (inner only):
490 * <'ether type'=0x0800
491 * | 'version'=4, 'protocol'=17, 'MF'=0, 'frag_offset'=0>
492 * or,
493 * <'ether type'=0x86DD
494 * | 'version'=6, 'next header'=17>
495 */
496 #define RTE_PTYPE_INNER_L4_UDP 0x02000000
497 /**
498 * Fragmented IP (Internet Protocol) packet type.
499 * It is used for inner packet only, and may or maynot have layer 4 packet.
500 *
501 * Packet format (inner only):
502 * <'ether type'=0x0800
503 * | 'version'=4, 'MF'=1>
504 * or,
505 * <'ether type'=0x0800
506 * | 'version'=4, 'frag_offset'!=0>
507 * or,
508 * <'ether type'=0x86DD
509 * | 'version'=6, 'next header'=44>
510 */
511 #define RTE_PTYPE_INNER_L4_FRAG 0x03000000
512 /**
513 * SCTP (Stream Control Transmission Protocol) packet type.
514 * It is used for inner packet only.
515 *
516 * Packet format (inner only):
517 * <'ether type'=0x0800
518 * | 'version'=4, 'protocol'=132, 'MF'=0, 'frag_offset'=0>
519 * or,
520 * <'ether type'=0x86DD
521 * | 'version'=6, 'next header'=132>
522 */
523 #define RTE_PTYPE_INNER_L4_SCTP 0x04000000
524 /**
525 * ICMP (Internet Control Message Protocol) packet type.
526 * It is used for inner packet only.
527 *
528 * Packet format (inner only):
529 * <'ether type'=0x0800
530 * | 'version'=4, 'protocol'=1, 'MF'=0, 'frag_offset'=0>
531 * or,
532 * <'ether type'=0x86DD
533 * | 'version'=6, 'next header'=1>
534 */
535 #define RTE_PTYPE_INNER_L4_ICMP 0x05000000
536 /**
537 * Non-fragmented IP (Internet Protocol) packet type.
538 * It is used for inner packet only, and may or maynot have other unknown layer
539 * 4 packet types.
540 *
541 * Packet format (inner only):
542 * <'ether type'=0x0800
543 * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0, 'frag_offset'=0>
544 * or,
545 * <'ether type'=0x86DD
546 * | 'version'=6, 'next header'!=[6|17|44|132|1]>
547 */
548 #define RTE_PTYPE_INNER_L4_NONFRAG 0x06000000
549 /**
550 * Mask of inner layer 4 packet types.
551 */
552 #define RTE_PTYPE_INNER_L4_MASK 0x0f000000
553 /**
554 * All valid layer masks.
555 */
556 #define RTE_PTYPE_ALL_MASK 0x0fffffff
557
558 /**
559 * Check if the (outer) L3 header is IPv4. To avoid comparing IPv4 types one by
560 * one, bit 4 is selected to be used for IPv4 only. Then checking bit 4 can
561 * determine if it is an IPV4 packet.
562 */
563 #define RTE_ETH_IS_IPV4_HDR(ptype) ((ptype) & RTE_PTYPE_L3_IPV4)
564
565 /**
566 * Check if the (outer) L3 header is IPv4. To avoid comparing IPv4 types one by
567 * one, bit 6 is selected to be used for IPv4 only. Then checking bit 6 can
568 * determine if it is an IPV4 packet.
569 */
570 #define RTE_ETH_IS_IPV6_HDR(ptype) ((ptype) & RTE_PTYPE_L3_IPV6)
571
572 /* Check if it is a tunneling packet */
573 #define RTE_ETH_IS_TUNNEL_PKT(ptype) ((ptype) & \
574 (RTE_PTYPE_TUNNEL_MASK | \
575 RTE_PTYPE_INNER_L2_MASK | \
576 RTE_PTYPE_INNER_L3_MASK | \
577 RTE_PTYPE_INNER_L4_MASK))
578
579 /**
580 * Get the name of the l2 packet type
581 *
582 * @param ptype
583 * The packet type value.
584 * @return
585 * A non-null string describing the packet type.
586 */
587 const char *rte_get_ptype_l2_name(uint32_t ptype);
588
589 /**
590 * Get the name of the l3 packet type
591 *
592 * @param ptype
593 * The packet type value.
594 * @return
595 * A non-null string describing the packet type.
596 */
597 const char *rte_get_ptype_l3_name(uint32_t ptype);
598
599 /**
600 * Get the name of the l4 packet type
601 *
602 * @param ptype
603 * The packet type value.
604 * @return
605 * A non-null string describing the packet type.
606 */
607 const char *rte_get_ptype_l4_name(uint32_t ptype);
608
609 /**
610 * Get the name of the tunnel packet type
611 *
612 * @param ptype
613 * The packet type value.
614 * @return
615 * A non-null string describing the packet type.
616 */
617 const char *rte_get_ptype_tunnel_name(uint32_t ptype);
618
619 /**
620 * Get the name of the inner_l2 packet type
621 *
622 * @param ptype
623 * The packet type value.
624 * @return
625 * A non-null string describing the packet type.
626 */
627 const char *rte_get_ptype_inner_l2_name(uint32_t ptype);
628
629 /**
630 * Get the name of the inner_l3 packet type
631 *
632 * @param ptype
633 * The packet type value.
634 * @return
635 * A non-null string describing the packet type.
636 */
637 const char *rte_get_ptype_inner_l3_name(uint32_t ptype);
638
639 /**
640 * Get the name of the inner_l4 packet type
641 *
642 * @param ptype
643 * The packet type value.
644 * @return
645 * A non-null string describing the packet type.
646 */
647 const char *rte_get_ptype_inner_l4_name(uint32_t ptype);
648
649 /**
650 * Write the packet type name into the buffer
651 *
652 * @param ptype
653 * The packet type value.
654 * @param buf
655 * The buffer where the string is written.
656 * @param buflen
657 * The length of the buffer.
658 * @return
659 * - 0 on success
660 * - (-1) if the buffer is too small
661 */
662 int rte_get_ptype_name(uint32_t ptype, char *buf, size_t buflen);
663
664 #ifdef __cplusplus
665 }
666 #endif
667
668 #endif /* _RTE_MBUF_PTYPE_H_ */