DPDK 21.11.9
rte_pmd_iavf.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019 Intel Corporation
3 */
4
5#ifndef _RTE_PMD_IAVF_H_
6#define _RTE_PMD_IAVF_H_
7
17#include <stdio.h>
18#include <rte_mbuf.h>
19#include <rte_mbuf_dyn.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
29 uint32_t metadata;
30
31 struct {
32 uint16_t data0;
33 uint16_t data1;
34 } raw;
35
36 struct {
37 uint16_t stag_vid:12,
38 stag_dei:1,
39 stag_pcp:3;
40 uint16_t ctag_vid:12,
41 ctag_dei:1,
42 ctag_pcp:3;
43 } vlan;
44
45 struct {
46 uint16_t protocol:8,
47 ttl:8;
48 uint16_t tos:8,
49 ihl:4,
50 version:4;
51 } ipv4;
52
53 struct {
54 uint16_t hoplimit:8,
55 nexthdr:8;
56 uint16_t flowhi4:4,
57 tc:8,
58 version:4;
59 } ipv6;
60
61 struct {
62 uint16_t flowlo16;
63 uint16_t flowhi4:4,
64 tc:8,
65 version:4;
66 } ipv6_flow;
67
68 struct {
69 uint16_t fin:1,
70 syn:1,
71 rst:1,
72 psh:1,
73 ack:1,
74 urg:1,
75 ece:1,
76 cwr:1,
77 res1:4,
78 doff:4;
79 uint16_t rsvd;
80 } tcp;
81
82 uint32_t ip_ofs;
83};
84
85/* Offset of mbuf dynamic field for flexible descriptor's extraction data */
86extern int rte_pmd_ifd_dynfield_proto_xtr_metadata_offs;
87
88/* Mask of mbuf dynamic flags for flexible descriptor's extraction type */
89extern uint64_t rte_pmd_ifd_dynflag_proto_xtr_vlan_mask;
90extern uint64_t rte_pmd_ifd_dynflag_proto_xtr_ipv4_mask;
91extern uint64_t rte_pmd_ifd_dynflag_proto_xtr_ipv6_mask;
92extern uint64_t rte_pmd_ifd_dynflag_proto_xtr_ipv6_flow_mask;
93extern uint64_t rte_pmd_ifd_dynflag_proto_xtr_tcp_mask;
94extern uint64_t rte_pmd_ifd_dynflag_proto_xtr_ip_offset_mask;
95extern uint64_t rte_pmd_ifd_dynflag_proto_xtr_ipsec_crypto_said_mask;
96
100#define RTE_PMD_IFD_DYNF_PROTO_XTR_METADATA(m) \
101 RTE_MBUF_DYNFIELD((m), \
102 rte_pmd_ifd_dynfield_proto_xtr_metadata_offs, \
103 uint32_t *)
104
109#define RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_VLAN \
110 (rte_pmd_ifd_dynflag_proto_xtr_vlan_mask)
111
116#define RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IPV4 \
117 (rte_pmd_ifd_dynflag_proto_xtr_ipv4_mask)
118
123#define RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IPV6 \
124 (rte_pmd_ifd_dynflag_proto_xtr_ipv6_mask)
125
130#define RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IPV6_FLOW \
131 (rte_pmd_ifd_dynflag_proto_xtr_ipv6_flow_mask)
132
137#define RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_TCP \
138 (rte_pmd_ifd_dynflag_proto_xtr_tcp_mask)
139
144#define RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET \
145 (rte_pmd_ifd_dynflag_proto_xtr_ip_offset_mask)
146
154__rte_experimental
155static __rte_always_inline int
157{
158 return rte_pmd_ifd_dynfield_proto_xtr_metadata_offs != -1;
159}
160
169__rte_experimental
170static __rte_always_inline uint32_t
172{
174}
175
182__rte_experimental
183static inline void
185{
187
189 return;
190
192
194 printf(" - Flexible descriptor's Metadata: [0x%04x:0x%04x],"
195 "vlan,stag=%u:%u:%u,ctag=%u:%u:%u",
196 data.raw.data0, data.raw.data1,
197 data.vlan.stag_pcp,
198 data.vlan.stag_dei,
199 data.vlan.stag_vid,
200 data.vlan.ctag_pcp,
201 data.vlan.ctag_dei,
202 data.vlan.ctag_vid);
204 printf(" - Flexible descriptor's Metadata: [0x%04x:0x%04x],"
205 "ipv4,ver=%u,hdrlen=%u,tos=%u,ttl=%u,proto=%u",
206 data.raw.data0, data.raw.data1,
207 data.ipv4.version,
208 data.ipv4.ihl,
209 data.ipv4.tos,
210 data.ipv4.ttl,
211 data.ipv4.protocol);
213 printf(" - Flexible descriptor's Metadata: [0x%04x:0x%04x],"
214 "ipv6,ver=%u,tc=%u,flow_hi4=0x%x,nexthdr=%u,hoplimit=%u",
215 data.raw.data0, data.raw.data1,
216 data.ipv6.version,
217 data.ipv6.tc,
218 data.ipv6.flowhi4,
219 data.ipv6.nexthdr,
220 data.ipv6.hoplimit);
222 printf(" - Flexible descriptor's Metadata: [0x%04x:0x%04x],"
223 "ipv6_flow,ver=%u,tc=%u,flow=0x%x%04x",
224 data.raw.data0, data.raw.data1,
225 data.ipv6_flow.version,
226 data.ipv6_flow.tc,
227 data.ipv6_flow.flowhi4,
228 data.ipv6_flow.flowlo16);
230 printf(" - Flexible descriptor's Metadata: [0x%04x:0x%04x],"
231 "tcp,doff=%u,flags=%s%s%s%s%s%s%s%s",
232 data.raw.data0, data.raw.data1,
233 data.tcp.doff,
234 data.tcp.cwr ? "C" : "",
235 data.tcp.ece ? "E" : "",
236 data.tcp.urg ? "U" : "",
237 data.tcp.ack ? "A" : "",
238 data.tcp.psh ? "P" : "",
239 data.tcp.rst ? "R" : "",
240 data.tcp.syn ? "S" : "",
241 data.tcp.fin ? "F" : "");
243 printf(" - Flexible descriptor's Extraction: ip_offset=%u",
244 data.ip_ofs);
245}
246
247#ifdef __cplusplus
248}
249#endif
250
251#endif /* _RTE_PMD_IAVF_H_ */
#define __rte_always_inline
Definition: rte_common.h:233
static __rte_experimental void rte_pmd_ifd_dump_proto_xtr_metadata(struct rte_mbuf *m)
Definition: rte_pmd_iavf.h:184
#define RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_VLAN
Definition: rte_pmd_iavf.h:109
#define RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IP_OFFSET
Definition: rte_pmd_iavf.h:144
#define RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IPV4
Definition: rte_pmd_iavf.h:116
static __rte_experimental __rte_always_inline uint32_t rte_pmd_ifd_dynf_proto_xtr_metadata_get(struct rte_mbuf *m)
Definition: rte_pmd_iavf.h:171
#define RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_TCP
Definition: rte_pmd_iavf.h:137
#define RTE_PMD_IFD_DYNF_PROTO_XTR_METADATA(m)
Definition: rte_pmd_iavf.h:100
#define RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IPV6_FLOW
Definition: rte_pmd_iavf.h:130
#define RTE_IAVF_PKT_RX_DYNF_PROTO_XTR_IPV6
Definition: rte_pmd_iavf.h:123
static __rte_experimental __rte_always_inline int rte_pmd_ifd_dynf_proto_xtr_metadata_avail(void)
Definition: rte_pmd_iavf.h:156
uint64_t ol_flags