X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_mbuf%2Frte_mbuf_ptype.h;h=17a2dd357665a41a95c2dc98ca551847528e5815;hb=7194e9ee66d6f229862e9293fed358061fb93daf;hp=f19c56c553a4ffc334cf1d2e487140e3a6447209;hpb=288541c8ff9eecccdb173a9b07a9aa6849d804f0;p=dpdk.git diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h index f19c56c553..17a2dd3576 100644 --- a/lib/librte_mbuf/rte_mbuf_ptype.h +++ b/lib/librte_mbuf/rte_mbuf_ptype.h @@ -1,35 +1,6 @@ -/*- - * BSD LICENSE - * - * Copyright(c) 2010-2016 Intel Corporation. - * Copyright 2014-2016 6WIND S.A. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2016 Intel Corporation. + * Copyright 2014-2016 6WIND S.A. */ #ifndef _RTE_MBUF_PTYPE_H_ @@ -91,6 +62,9 @@ * RTE_PTYPE_INNER_L4_UDP. */ +#include +#include + #ifdef __cplusplus extern "C" { #endif @@ -149,6 +123,27 @@ extern "C" { * <'ether type'=[0x88A8]> */ #define RTE_PTYPE_L2_ETHER_QINQ 0x00000007 +/** + * PPPOE packet type. + * + * Packet format: + * <'ether type'=[0x8863|0x8864]> + */ +#define RTE_PTYPE_L2_ETHER_PPPOE 0x00000008 +/** + * FCoE packet type. + * + * Packet format: + * <'ether type'=[0x8906]> + */ +#define RTE_PTYPE_L2_ETHER_FCOE 0x00000009 +/** + * MPLS packet type. + * + * Packet format: + * <'ether type'=[0x8847|0x8848]> + */ +#define RTE_PTYPE_L2_ETHER_MPLS 0x0000000a /** * Mask of layer 2 packet types. * It is used for outer packet for tunneling cases. @@ -227,7 +222,7 @@ extern "C" { * * Packet format: * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=6, 'MF'=0> + * | 'version'=4, 'protocol'=6, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=6> @@ -239,7 +234,7 @@ extern "C" { * * Packet format: * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=17, 'MF'=0> + * | 'version'=4, 'protocol'=17, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=17> @@ -258,6 +253,9 @@ extern "C" { * <'ether type'=0x0800 * | 'version'=4, 'MF'=1> * or, + * <'ether type'=0x0800 + * | 'version'=4, 'frag_offset'!=0> + * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=44> */ @@ -268,7 +266,7 @@ extern "C" { * * Packet format: * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=132, 'MF'=0> + * | 'version'=4, 'protocol'=132, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=132> @@ -280,7 +278,7 @@ extern "C" { * * Packet format: * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=1, 'MF'=0> + * | 'version'=4, 'protocol'=1, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=1> @@ -296,12 +294,20 @@ extern "C" { * * Packet format: * <'ether type'=0x0800 - * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0> + * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'!=[6|17|44|132|1]> */ #define RTE_PTYPE_L4_NONFRAG 0x00000600 +/** + * IGMP (Internet Group Management Protocol) packet type. + * + * Packet format: + * <'ether type'=0x0800 + * | 'version'=4, 'protocol'=2, 'MF'=0, 'frag_offset'=0> + */ +#define RTE_PTYPE_L4_IGMP 0x00000700 /** * Mask of layer 4 packet types. * It is used for outer packet for tunneling cases. @@ -335,11 +341,11 @@ extern "C" { * Packet format: * <'ether type'=0x0800 * | 'version'=4, 'protocol'=17 - * | 'destination port'=4798> + * | 'destination port'=4789> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=17 - * | 'destination port'=4798> + * | 'destination port'=4789> */ #define RTE_PTYPE_TUNNEL_VXLAN 0x00003000 /** @@ -376,6 +382,115 @@ extern "C" { * capability. */ #define RTE_PTYPE_TUNNEL_GRENAT 0x00006000 +/** + * GTP-C (GPRS Tunnelling Protocol) control tunneling packet type. + * Packet format: + * <'ether type'=0x0800 + * | 'version'=4, 'protocol'=17 + * | 'destination port'=2123> + * or, + * <'ether type'=0x86DD + * | 'version'=6, 'next header'=17 + * | 'destination port'=2123> + * or, + * <'ether type'=0x0800 + * | 'version'=4, 'protocol'=17 + * | 'source port'=2123> + * or, + * <'ether type'=0x86DD + * | 'version'=6, 'next header'=17 + * | 'source port'=2123> + */ +#define RTE_PTYPE_TUNNEL_GTPC 0x00007000 +/** + * GTP-U (GPRS Tunnelling Protocol) user data tunneling packet type. + * Packet format: + * <'ether type'=0x0800 + * | 'version'=4, 'protocol'=17 + * | 'destination port'=2152> + * or, + * <'ether type'=0x86DD + * | 'version'=6, 'next header'=17 + * | 'destination port'=2152> + */ +#define RTE_PTYPE_TUNNEL_GTPU 0x00008000 +/** + * ESP (IP Encapsulating Security Payload) tunneling packet type. + * + * Packet format: + * <'ether type'=0x0800 + * | 'version'=4, 'protocol'=51> + * or, + * <'ether type'=0x86DD + * | 'version'=6, 'next header'=51> + */ +#define RTE_PTYPE_TUNNEL_ESP 0x00009000 +/** + * L2TP (Layer 2 Tunneling Protocol) tunneling packet type. + * + * Packet format: + * <'ether type'=0x0800 + * | 'version'=4, 'protocol'=17> + * | 'destination port'=1701> + * or, + * <'ether type'=0x86DD + * | 'version'=6, 'next header'=17 + * | 'destination port'=1701> + * or, + * <'ether type'=0x0800 + * | 'version'=4, 'protocol'=115> + * or, + * <'ether type'=0x86DD + * | 'version'=6, 'protocol'=115> + */ +#define RTE_PTYPE_TUNNEL_L2TP 0x0000a000 +/** + * VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type. + * + * Packet format: + * <'ether type'=0x0800 + * | 'version'=4, 'protocol'=17 + * | 'destination port'=4790> + * or, + * <'ether type'=0x86DD + * | 'version'=6, 'next header'=17 + * | 'destination port'=4790> + */ +#define RTE_PTYPE_TUNNEL_VXLAN_GPE 0x0000b000 +/** + * MPLS-in-GRE tunneling packet type (RFC 4023). + * + * Packet format: + * <'ether type'=0x0800 + * | 'version'=4, 'protocol'=47 + * | 'protocol'=0x8847> + * or, + * <'ether type'=0x0800 + * | 'version'=4, 'protocol'=47 + * | 'protocol'=0x8848> + * or, + * <'ether type'=0x86DD + * | 'version'=6, 'protocol'=47 + * | 'protocol'=0x8847> + * or, + * <'ether type'=0x86DD + * | 'version'=6, 'next header'=47 + * | 'protocol'=0x8848> + */ +#define RTE_PTYPE_TUNNEL_MPLS_IN_GRE 0x0000c000 +/** + * MPLS-in-UDP tunneling packet type (RFC 7510). + * + * Packet format: + * <'ether type'=0x0800 + * | 'version'=4, 'protocol'=17 + * | 'destination port'=6635> + * or, + * <'ether type'=0x86DD + * | 'version'=6, 'next header'=17 + * | 'destination port'=6635> + */ +#define RTE_PTYPE_TUNNEL_MPLS_IN_UDP 0x0000d000 /** * Mask of tunneling packet types. */ @@ -473,7 +588,7 @@ extern "C" { * * Packet format (inner only): * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=6, 'MF'=0> + * | 'version'=4, 'protocol'=6, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=6> @@ -485,7 +600,7 @@ extern "C" { * * Packet format (inner only): * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=17, 'MF'=0> + * | 'version'=4, 'protocol'=17, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=17> @@ -499,6 +614,9 @@ extern "C" { * <'ether type'=0x0800 * | 'version'=4, 'MF'=1> * or, + * <'ether type'=0x0800 + * | 'version'=4, 'frag_offset'!=0> + * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=44> */ @@ -509,7 +627,7 @@ extern "C" { * * Packet format (inner only): * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=132, 'MF'=0> + * | 'version'=4, 'protocol'=132, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=132> @@ -521,7 +639,7 @@ extern "C" { * * Packet format (inner only): * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=1, 'MF'=0> + * | 'version'=4, 'protocol'=1, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=1> @@ -534,7 +652,7 @@ extern "C" { * * Packet format (inner only): * <'ether type'=0x0800 - * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0> + * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'!=[6|17|44|132|1]> @@ -557,9 +675,9 @@ extern "C" { #define RTE_ETH_IS_IPV4_HDR(ptype) ((ptype) & RTE_PTYPE_L3_IPV4) /** - * Check if the (outer) L3 header is IPv4. To avoid comparing IPv4 types one by - * one, bit 6 is selected to be used for IPv4 only. Then checking bit 6 can - * determine if it is an IPV4 packet. + * Check if the (outer) L3 header is IPv6. To avoid comparing IPv6 types one by + * one, bit 6 is selected to be used for IPv6 only. Then checking bit 6 can + * determine if it is an IPV6 packet. */ #define RTE_ETH_IS_IPV6_HDR(ptype) ((ptype) & RTE_PTYPE_L3_IPV6)