Lines Matching full:trace

79 static bool ioam6_validate_trace_hdr(struct ioam6_trace_hdr *trace)  in ioam6_validate_trace_hdr()  argument
83 if (!trace->type_be32 || !trace->remlen || in ioam6_validate_trace_hdr()
84 trace->remlen > IOAM6_TRACE_DATA_SIZE_MAX / 4 || in ioam6_validate_trace_hdr()
85 trace->type.bit12 | trace->type.bit13 | trace->type.bit14 | in ioam6_validate_trace_hdr()
86 trace->type.bit15 | trace->type.bit16 | trace->type.bit17 | in ioam6_validate_trace_hdr()
87 trace->type.bit18 | trace->type.bit19 | trace->type.bit20 | in ioam6_validate_trace_hdr()
88 trace->type.bit21) in ioam6_validate_trace_hdr()
91 trace->nodelen = 0; in ioam6_validate_trace_hdr()
92 fields = be32_to_cpu(trace->type_be32); in ioam6_validate_trace_hdr()
94 trace->nodelen += hweight32(fields & IOAM6_MASK_SHORT_FIELDS) in ioam6_validate_trace_hdr()
96 trace->nodelen += hweight32(fields & IOAM6_MASK_WIDE_FIELDS) in ioam6_validate_trace_hdr()
109 struct ioam6_trace_hdr *trace; in ioam6_build_state() local
152 NL_SET_ERR_MSG(extack, "missing trace"); in ioam6_build_state()
156 trace = nla_data(tb[IOAM6_IPTUNNEL_TRACE]); in ioam6_build_state()
157 if (!ioam6_validate_trace_hdr(trace)) { in ioam6_build_state()
159 "invalid trace validation"); in ioam6_build_state()
163 len_aligned = ALIGN(trace->remlen * 4, 8); in ioam6_build_state()
188 tuninfo->ioamh.opt_len = sizeof(tuninfo->ioamh) - 2 + sizeof(*trace) in ioam6_build_state()
189 + trace->remlen * 4; in ioam6_build_state()
191 memcpy(&tuninfo->traceh, trace, sizeof(*trace)); in ioam6_build_state()
193 if (len_aligned - trace->remlen * 4) { in ioam6_build_state()
194 tuninfo->traceh.data[trace->remlen * 4] = IPV6_TLV_PADN; in ioam6_build_state()
195 tuninfo->traceh.data[trace->remlen * 4 + 1] = 2; in ioam6_build_state()
208 struct ioam6_trace_hdr *trace; in ioam6_do_fill() local
211 trace = (struct ioam6_trace_hdr *)(skb_transport_header(skb) in ioam6_do_fill()
215 ns = ioam6_namespace(net, trace->namespace_id); in ioam6_do_fill()
217 ioam6_fill_trace_data(skb, ns, trace, false); in ioam6_do_fill()