Lines Matching refs:p
24 struct tcf_mpls_params *p, bool set_bos) in tcf_mpls_get_lse() argument
31 if (p->tcfm_label != ACT_MPLS_LABEL_NOT_SET) { in tcf_mpls_get_lse()
33 new_lse |= p->tcfm_label << MPLS_LS_LABEL_SHIFT; in tcf_mpls_get_lse()
35 if (p->tcfm_ttl) { in tcf_mpls_get_lse()
37 new_lse |= p->tcfm_ttl << MPLS_LS_TTL_SHIFT; in tcf_mpls_get_lse()
39 if (p->tcfm_tc != ACT_MPLS_TC_NOT_SET) { in tcf_mpls_get_lse()
41 new_lse |= p->tcfm_tc << MPLS_LS_TC_SHIFT; in tcf_mpls_get_lse()
43 if (p->tcfm_bos != ACT_MPLS_BOS_NOT_SET) { in tcf_mpls_get_lse()
45 new_lse |= p->tcfm_bos << MPLS_LS_S_SHIFT; in tcf_mpls_get_lse()
58 struct tcf_mpls_params *p; in tcf_mpls_act() local
77 p = rcu_dereference_bh(m->mpls_p); in tcf_mpls_act()
79 switch (p->tcfm_action) { in tcf_mpls_act()
81 if (skb_mpls_pop(skb, p->tcfm_proto, mac_len, in tcf_mpls_act()
86 new_lse = tcf_mpls_get_lse(NULL, p, !eth_p_mpls(skb_protocol(skb, true))); in tcf_mpls_act()
87 if (skb_mpls_push(skb, new_lse, p->tcfm_proto, mac_len, in tcf_mpls_act()
102 new_lse = tcf_mpls_get_lse(NULL, p, mac_len || in tcf_mpls_act()
105 if (skb_mpls_push(skb, new_lse, p->tcfm_proto, 0, false)) in tcf_mpls_act()
112 new_lse = tcf_mpls_get_lse(mpls_hdr(skb), p, false); in tcf_mpls_act()
169 struct tcf_mpls_params *p; in tcf_mpls_init() local
284 p = kzalloc(sizeof(*p), GFP_KERNEL); in tcf_mpls_init()
285 if (!p) { in tcf_mpls_init()
290 p->tcfm_action = parm->m_action; in tcf_mpls_init()
291 p->tcfm_label = tb[TCA_MPLS_LABEL] ? nla_get_u32(tb[TCA_MPLS_LABEL]) : in tcf_mpls_init()
293 p->tcfm_tc = tb[TCA_MPLS_TC] ? nla_get_u8(tb[TCA_MPLS_TC]) : in tcf_mpls_init()
295 p->tcfm_ttl = tb[TCA_MPLS_TTL] ? nla_get_u8(tb[TCA_MPLS_TTL]) : in tcf_mpls_init()
297 p->tcfm_bos = tb[TCA_MPLS_BOS] ? nla_get_u8(tb[TCA_MPLS_BOS]) : in tcf_mpls_init()
299 p->tcfm_proto = tb[TCA_MPLS_PROTO] ? nla_get_be16(tb[TCA_MPLS_PROTO]) : in tcf_mpls_init()
304 p = rcu_replace_pointer(m->mpls_p, p, lockdep_is_held(&m->tcf_lock)); in tcf_mpls_init()
309 if (p) in tcf_mpls_init()
310 kfree_rcu(p, rcu); in tcf_mpls_init()
324 struct tcf_mpls_params *p; in tcf_mpls_cleanup() local
326 p = rcu_dereference_protected(m->mpls_p, 1); in tcf_mpls_cleanup()
327 if (p) in tcf_mpls_cleanup()
328 kfree_rcu(p, rcu); in tcf_mpls_cleanup()
336 struct tcf_mpls_params *p; in tcf_mpls_dump() local
346 p = rcu_dereference_protected(m->mpls_p, lockdep_is_held(&m->tcf_lock)); in tcf_mpls_dump()
347 opt.m_action = p->tcfm_action; in tcf_mpls_dump()
352 if (p->tcfm_label != ACT_MPLS_LABEL_NOT_SET && in tcf_mpls_dump()
353 nla_put_u32(skb, TCA_MPLS_LABEL, p->tcfm_label)) in tcf_mpls_dump()
356 if (p->tcfm_tc != ACT_MPLS_TC_NOT_SET && in tcf_mpls_dump()
357 nla_put_u8(skb, TCA_MPLS_TC, p->tcfm_tc)) in tcf_mpls_dump()
360 if (p->tcfm_ttl && nla_put_u8(skb, TCA_MPLS_TTL, p->tcfm_ttl)) in tcf_mpls_dump()
363 if (p->tcfm_bos != ACT_MPLS_BOS_NOT_SET && in tcf_mpls_dump()
364 nla_put_u8(skb, TCA_MPLS_BOS, p->tcfm_bos)) in tcf_mpls_dump()
367 if (nla_put_be16(skb, TCA_MPLS_PROTO, p->tcfm_proto)) in tcf_mpls_dump()