On Mon, Aug 22, 2016 at 5:38 PM, Amir Vadai <a...@vadai.me> wrote: > This action could be used before redirecting packets to a shared tunnel > device, or when redirecting packets arriving from a such a device
nit, add period > The action will release the metadata created by the tunnel device > (decap), or set the metadata with the specified values for encap > operation. Jiri B. -- SB pointer to the code > +static int tcf_iptunnel(struct sk_buff *skb, const struct tc_action *a, > + struct tcf_result *res) > +{ > + struct tcf_iptunnel *t = to_iptunnel(a); > + int action; > + > + spin_lock(&t->tcf_lock); > + tcf_lastuse_update(&t->tcf_tm); > + bstats_update(&t->tcf_bstats, skb); > + action = t->tcf_action; > + > + switch (t->tcft_action) { > + case TCA_IPTUNNEL_ACT_DECAP: > + skb_dst_set_noref(skb, NULL); > + break; > + case TCA_IPTUNNEL_ACT_ENCAP: > + skb_dst_set_noref(skb, &t->tcft_enc_metadata->dst); Jiri B > I understand the motivation for the decap action. However, what would Jiri B > happen if someone does not include it? The MD set by the (say) vxlan device will not be "consumed" (cleared) and would be keep travelling with the SKB > + > + break; > + default: > + BUG(); no, please, scream if you want to go beyond warning but don't kill and don't die > + } > + > + spin_unlock(&t->tcf_lock); > + return action; > +}