aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/octeontx/base/octeontx_pki_var.h
blob: c793b655a4ec66fdb8d1f06679c250fb27a2f362 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(c) 2017 Cavium, Inc
 */

#ifndef __OCTEONTX_PKI_VAR_H__
#define __OCTEONTX_PKI_VAR_H__

#include <rte_byteorder.h>

#define OCTTX_PACKET_WQE_SKIP		128
#define OCTTX_PACKET_FIRST_SKIP		240
#define OCTTX_PACKET_LATER_SKIP		128

/* WQE descriptor */
typedef union octtx_wqe_s {
	uint64_t	w[6];

	struct {
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
		struct {
			uint64_t	pknd : 6;
			uint64_t	rsvd0 : 10;
			uint64_t	style : 8;
			uint64_t	bufs : 8;
			uint64_t	chan : 12;
			uint64_t	apad : 3;
			uint64_t	rsvd1 : 1;
			uint64_t	aura : 12;
			uint64_t	rsvd2 : 4;
		} w0;

		struct {
			uint64_t	tag :	32;
			uint64_t	tt :	2;
			uint64_t	grp :	10;
			uint64_t	rsvd0 : 2;
			uint64_t	rsvd1 : 2;
			uint64_t	len :	16;
		} w1;

		struct {
			uint64_t	op_code : 8;
			uint64_t	err_lev : 3;
			uint64_t	raw	: 1;
			uint64_t	l2m	: 1;
			uint64_t	l2b	: 1;
			uint64_t	l3m	: 1;
			uint64_t	l3b	: 1;
			uint64_t	l3fr	: 1;
			uint64_t	pf1	: 1;
			uint64_t	pf2	: 1;
			uint64_t	pf3	: 1;
			uint64_t	pf4	: 1;
			uint64_t	sh	: 1;
			uint64_t	vs	: 1;
			uint64_t	vv	: 1;
			uint64_t	rsvd0	: 8;
			uint64_t	lae	: 1;
			uint64_t	lbty	: 5;
			uint64_t	lcty	: 5;
			uint64_t	ldty	: 5;
			uint64_t	lety	: 5;
			uint64_t	lfty	: 5;
			uint64_t	lgty	: 5;
			uint64_t	sw	: 1;
		} w2;

		struct {
			uint64_t	addr;	/* Byte addr of start-of-pkt */
		} w3;

		struct {
			uint64_t	laptr : 8;
			uint64_t	lbptr : 8;
			uint64_t	lcptr : 8;
			uint64_t	ldprt : 8;
			uint64_t	leptr : 8;
			uint64_t	lfptr : 8;
			uint64_t	lgptr : 8;
			uint64_t	vlptr : 8;
		} w4;

		struct {
			uint64_t	rsvd0 : 47;
			uint64_t	dwd : 1;
			uint64_t	size : 16;
		} w5;
#else
		struct {
			uint64_t	rsvd2 : 4;
			uint64_t	aura : 12;
			uint64_t	rsvd1 : 1;
			uint64_t	apad : 3;
			uint64_t	chan : 12;
			uint64_t	bufs : 8;
			uint64_t	style : 8;
			uint64_t	rsvd0 : 10;
			uint64_t	pknd : 6;
		} w0;

		struct {
			uint64_t	len :   16;
			uint64_t	rsvd1 : 2;
			uint64_t	rsvd0 : 2;
			uint64_t	grp :   10;
			uint64_t	tt :    2;
			uint64_t	tag :   32;
		} w1;

		struct {
			uint64_t	sw	: 1;
			uint64_t	lgty	: 5;
			uint64_t	lfty	: 5;
			uint64_t	lety	: 5;
			uint64_t	ldty	: 5;
			uint64_t	lcty	: 5;
			uint64_t	lbty	: 5;
			uint64_t	lae	: 1;
			uint64_t	rsvd0	: 8;
			uint64_t	vv	: 1;
			uint64_t	vs	: 1;
			uint64_t	sh	: 1;
			uint64_t	pf4	: 1;
			uint64_t	pf3	: 1;
			uint64_t	pf2	: 1;
			uint64_t	pf1	: 1;
			uint64_t	l3fr	: 1;
			uint64_t	l3b	: 1;
			uint64_t	l3m	: 1;
			uint64_t	l2b	: 1;
			uint64_t	l2m	: 1;
			uint64_t	raw	: 1;
	uint64_t	err_lev : 3;
			uint64_t	op_code : 8;
		} w2;

		struct {
			uint64_t	addr;	/* Byte addr of start-of-pkt */
		} w3;

		struct {
			uint64_t	vlptr : 8;
			uint64_t	lgptr : 8;
			uint64_t	lfptr : 8;
			uint64_t	leptr : 8;
			uint64_t	ldprt : 8;
			uint64_t	lcptr : 8;
			uint64_t	lbptr : 8;
			uint64_t	laptr : 8;
		} w4;
#endif
	} s;

} __rte_packed octtx_wqe_t;

enum occtx_pki_ltype_e {
	OCCTX_PKI_LTYPE_NONE		= 0,
	OCCTX_PKI_LTYPE_ENET		= 1,
	OCCTX_PKI_LTYPE_VLAN		= 2,
	OCCTX_PKI_LTYPE_SNAP_PAYLD	= 5,
	OCCTX_PKI_LTYPE_ARP		= 6,
	OCCTX_PKI_LTYPE_RARP		= 7,
	OCCTX_PKI_LTYPE_IP4		= 8,
	OCCTX_PKI_LTYPE_IP4_OPT		= 9,
	OCCTX_PKI_LTYPE_IP6		= 0xa,
	OCCTX_PKI_LTYPE_IP6_OPT		= 0xb,
	OCCTX_PKI_LTYPE_IPSEC_ESP	= 0xc,
	OCCTX_PKI_LTYPE_IPFRAG		= 0xd,
	OCCTX_PKI_LTYPE_IPCOMP		= 0xe,
	OCCTX_PKI_LTYPE_TCP		= 0x10,
	OCCTX_PKI_LTYPE_UDP		= 0x11,
	OCCTX_PKI_LTYPE_SCTP		= 0x12,
	OCCTX_PKI_LTYPE_UDP_VXLAN	= 0x13,
	OCCTX_PKI_LTYPE_GRE		= 0x14,
	OCCTX_PKI_LTYPE_NVGRE		= 0x15,
	OCCTX_PKI_LTYPE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