Lines Matching refs:ilwt

115 	struct ioam6_lwt *ilwt;  in ioam6_build_state()  local
173 lwt = lwtunnel_state_alloc(sizeof(*ilwt) + len_aligned); in ioam6_build_state()
177 ilwt = ioam6_lwt_state(lwt); in ioam6_build_state()
178 err = dst_cache_init(&ilwt->cache, GFP_ATOMIC); in ioam6_build_state()
182 atomic_set(&ilwt->pkt_cnt, 0); in ioam6_build_state()
183 ilwt->freq.k = freq_k; in ioam6_build_state()
184 ilwt->freq.n = freq_n; in ioam6_build_state()
186 ilwt->mode = mode; in ioam6_build_state()
189 ilwt->has_tunsrc = false; in ioam6_build_state()
191 ilwt->has_tunsrc = true; in ioam6_build_state()
192 ilwt->tunsrc = nla_get_in6_addr(tb[IOAM6_IPTUNNEL_SRC]); in ioam6_build_state()
194 if (ipv6_addr_any(&ilwt->tunsrc)) { in ioam6_build_state()
203 ilwt->tundst = nla_get_in6_addr(tb[IOAM6_IPTUNNEL_DST]); in ioam6_build_state()
205 if (ipv6_addr_any(&ilwt->tundst)) { in ioam6_build_state()
235 dst_cache_destroy(&ilwt->cache); in ioam6_build_state()
341 struct ioam6_lwt *ilwt; in ioam6_output() local
348 ilwt = ioam6_lwt_state(dst->lwtstate); in ioam6_output()
351 pkt_cnt = atomic_fetch_inc(&ilwt->pkt_cnt); in ioam6_output()
352 if (pkt_cnt % ilwt->freq.n >= ilwt->freq.k) in ioam6_output()
357 switch (ilwt->mode) { in ioam6_output()
364 err = ioam6_do_inline(net, skb, &ilwt->tuninfo); in ioam6_output()
372 err = ioam6_do_encap(net, skb, &ilwt->tuninfo, in ioam6_output()
373 ilwt->has_tunsrc, &ilwt->tunsrc, in ioam6_output()
374 &ilwt->tundst); in ioam6_output()
398 dst = dst_cache_get(&ilwt->cache); in ioam6_output()
420 dst_cache_set_ip6(&ilwt->cache, dst, &fl6.saddr); in ioam6_output()
444 struct ioam6_lwt *ilwt = ioam6_lwt_state(lwtstate); in ioam6_fill_encap_info() local
447 err = nla_put_u32(skb, IOAM6_IPTUNNEL_FREQ_K, ilwt->freq.k); in ioam6_fill_encap_info()
451 err = nla_put_u32(skb, IOAM6_IPTUNNEL_FREQ_N, ilwt->freq.n); in ioam6_fill_encap_info()
455 err = nla_put_u8(skb, IOAM6_IPTUNNEL_MODE, ilwt->mode); in ioam6_fill_encap_info()
459 if (ilwt->mode != IOAM6_IPTUNNEL_MODE_INLINE) { in ioam6_fill_encap_info()
460 if (ilwt->has_tunsrc) { in ioam6_fill_encap_info()
462 &ilwt->tunsrc); in ioam6_fill_encap_info()
467 err = nla_put_in6_addr(skb, IOAM6_IPTUNNEL_DST, &ilwt->tundst); in ioam6_fill_encap_info()
472 err = nla_put(skb, IOAM6_IPTUNNEL_TRACE, sizeof(ilwt->tuninfo.traceh), in ioam6_fill_encap_info()
473 &ilwt->tuninfo.traceh); in ioam6_fill_encap_info()
480 struct ioam6_lwt *ilwt = ioam6_lwt_state(lwtstate); in ioam6_encap_nlsize() local
483 nlsize = nla_total_size(sizeof(ilwt->freq.k)) + in ioam6_encap_nlsize()
484 nla_total_size(sizeof(ilwt->freq.n)) + in ioam6_encap_nlsize()
485 nla_total_size(sizeof(ilwt->mode)) + in ioam6_encap_nlsize()
486 nla_total_size(sizeof(ilwt->tuninfo.traceh)); in ioam6_encap_nlsize()
488 if (ilwt->mode != IOAM6_IPTUNNEL_MODE_INLINE) { in ioam6_encap_nlsize()
489 if (ilwt->has_tunsrc) in ioam6_encap_nlsize()
490 nlsize += nla_total_size(sizeof(ilwt->tunsrc)); in ioam6_encap_nlsize()
492 nlsize += nla_total_size(sizeof(ilwt->tundst)); in ioam6_encap_nlsize()