4 * Copyright (C) Cavium Inc. 2017. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
16 * * Neither the name of Cavium networks nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #ifndef __OCTEONTX_PKI_VAR_H__
34 #define __OCTEONTX_PKI_VAR_H__
36 #include <rte_byteorder.h>
38 #define OCTTX_PACKET_WQE_SKIP 128
39 #define OCTTX_PACKET_FIRST_SKIP_MAXREGVAL 496
40 #define OCTTX_PACKET_FIRST_SKIP_MAXLEN 512
41 #define OCTTX_PACKET_FIRST_SKIP_ADJUST(x) \
42 (RTE_MIN(x, OCTTX_PACKET_FIRST_SKIP_MAXREGVAL))
43 #define OCTTX_PACKET_FIRST_SKIP_SUM(p) \
44 (OCTTX_PACKET_WQE_SKIP \
45 + rte_pktmbuf_priv_size(p) \
46 + RTE_PKTMBUF_HEADROOM)
47 #define OCTTX_PACKET_FIRST_SKIP(p) \
48 OCTTX_PACKET_FIRST_SKIP_ADJUST(OCTTX_PACKET_FIRST_SKIP_SUM(p))
49 #define OCTTX_PACKET_LATER_SKIP 128
52 typedef union octtx_wqe_s {
56 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
106 uint64_t addr; /* Byte addr of start-of-pkt */
170 uint64_t err_lev : 3;
171 uint64_t op_code : 8;
175 uint64_t addr; /* Byte addr of start-of-pkt */
191 } __rte_packed octtx_wqe_t;
193 enum occtx_pki_ltype_e {
194 OCCTX_PKI_LTYPE_NONE = 0,
195 OCCTX_PKI_LTYPE_ENET = 1,
196 OCCTX_PKI_LTYPE_VLAN = 2,
197 OCCTX_PKI_LTYPE_SNAP_PAYLD = 5,
198 OCCTX_PKI_LTYPE_ARP = 6,
199 OCCTX_PKI_LTYPE_RARP = 7,
200 OCCTX_PKI_LTYPE_IP4 = 8,
201 OCCTX_PKI_LTYPE_IP4_OPT = 9,
202 OCCTX_PKI_LTYPE_IP6 = 0xa,
203 OCCTX_PKI_LTYPE_IP6_OPT = 0xb,
204 OCCTX_PKI_LTYPE_IPSEC_ESP = 0xc,
205 OCCTX_PKI_LTYPE_IPFRAG = 0xd,
206 OCCTX_PKI_LTYPE_IPCOMP = 0xe,
207 OCCTX_PKI_LTYPE_TCP = 0x10,
208 OCCTX_PKI_LTYPE_UDP = 0x11,
209 OCCTX_PKI_LTYPE_SCTP = 0x12,
210 OCCTX_PKI_LTYPE_UDP_VXLAN = 0x13,
211 OCCTX_PKI_LTYPE_GRE = 0x14,
212 OCCTX_PKI_LTYPE_NVGRE = 0x15,
213 OCCTX_PKI_LTYPE_GTP = 0x16,
214 OCCTX_PKI_LTYPE_UDP_GENEVE = 0x17,
215 OCCTX_PKI_LTYPE_SW28 = 0x1c,
216 OCCTX_PKI_LTYPE_SW29 = 0x1d,
217 OCCTX_PKI_LTYPE_SW30 = 0x1e,
218 OCCTX_PKI_LTYPE_SW31 = 0x1f,
223 LC_NONE = OCCTX_PKI_LTYPE_NONE,
224 LC_IPV4 = OCCTX_PKI_LTYPE_IP4,
225 LC_IPV4_OPT = OCCTX_PKI_LTYPE_IP4_OPT,
226 LC_IPV6 = OCCTX_PKI_LTYPE_IP6,
227 LC_IPV6_OPT = OCCTX_PKI_LTYPE_IP6_OPT,
231 LE_NONE = OCCTX_PKI_LTYPE_NONE,
235 LF_NONE = OCCTX_PKI_LTYPE_NONE,
236 LF_IPSEC_ESP = OCCTX_PKI_LTYPE_IPSEC_ESP,
237 LF_IPFRAG = OCCTX_PKI_LTYPE_IPFRAG,
238 LF_IPCOMP = OCCTX_PKI_LTYPE_IPCOMP,
239 LF_TCP = OCCTX_PKI_LTYPE_TCP,
240 LF_UDP = OCCTX_PKI_LTYPE_UDP,
241 LF_GRE = OCCTX_PKI_LTYPE_GRE,
242 LF_UDP_GENEVE = OCCTX_PKI_LTYPE_UDP_GENEVE,
243 LF_UDP_VXLAN = OCCTX_PKI_LTYPE_UDP_VXLAN,
244 LF_NVGRE = OCCTX_PKI_LTYPE_NVGRE,
246 #endif /* __OCTEONTX_PKI_VAR_H__ */