1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019 Intel Corporation
5 #ifndef _RTE_PMD_ICE_H_
6 #define _RTE_PMD_ICE_H_
10 #include <rte_ethdev.h>
25 struct proto_xtr_flds {
78 #define PROTO_XTR_MAGIC_ID 0xCE
83 init_proto_xtr_flds(struct rte_mbuf *mb)
88 static inline struct proto_xtr_flds *
89 get_proto_xtr_flds(struct rte_mbuf *mb)
91 RTE_BUILD_BUG_ON(sizeof(struct proto_xtr_flds) > sizeof(mb->udata64));
93 return (struct proto_xtr_flds *)&mb->udata64;
97 dump_proto_xtr_flds(struct rte_mbuf *mb)
99 struct proto_xtr_flds *xtr = get_proto_xtr_flds(mb);
101 if (xtr->magic != PROTO_XTR_MAGIC_ID || xtr->type == PROTO_XTR_NONE)
104 printf(" - Protocol Extraction:[0x%04x:0x%04x],",
105 xtr->u.raw.data0, xtr->u.raw.data1);
107 if (xtr->type == PROTO_XTR_VLAN)
108 printf("vlan,stag=%u:%u:%u,ctag=%u:%u:%u ",
109 xtr->u.vlan.stag_pcp,
110 xtr->u.vlan.stag_dei,
111 xtr->u.vlan.stag_vid,
112 xtr->u.vlan.ctag_pcp,
113 xtr->u.vlan.ctag_dei,
114 xtr->u.vlan.ctag_vid);
115 else if (xtr->type == PROTO_XTR_IPV4)
116 printf("ipv4,ver=%u,hdrlen=%u,tos=%u,ttl=%u,proto=%u ",
121 xtr->u.ipv4.protocol);
122 else if (xtr->type == PROTO_XTR_IPV6)
123 printf("ipv6,ver=%u,tc=%u,flow_hi4=0x%x,nexthdr=%u,hoplimit=%u ",
128 xtr->u.ipv6.hoplimit);
129 else if (xtr->type == PROTO_XTR_IPV6_FLOW)
130 printf("ipv6_flow,ver=%u,tc=%u,flow=0x%x%04x ",
131 xtr->u.ipv6_flow.version,
133 xtr->u.ipv6_flow.flowhi4,
134 xtr->u.ipv6_flow.flowlo16);
135 else if (xtr->type == PROTO_XTR_TCP)
136 printf("tcp,doff=%u,flags=%s%s%s%s%s%s%s%s ",
138 xtr->u.tcp.cwr ? "C" : "",
139 xtr->u.tcp.ece ? "E" : "",
140 xtr->u.tcp.urg ? "U" : "",
141 xtr->u.tcp.ack ? "A" : "",
142 xtr->u.tcp.psh ? "P" : "",
143 xtr->u.tcp.rst ? "R" : "",
144 xtr->u.tcp.syn ? "S" : "",
145 xtr->u.tcp.fin ? "F" : "");
152 #endif /* _RTE_PMD_ICE_H_ */