Commit 2384127e authored by Davide Caratti's avatar Davide Caratti Committed by Jakub Kicinski

net/sched: act_tunnel_key: add support for "don't fragment"

extend "act_tunnel_key" to allow specifying TUNNEL_DONT_FRAGMENT.
Suggested-by: default avatarIlya Maximets <i.maximets@ovn.org>
Reviewed-by: default avatarPedro Tammela <pctammela@mojatatu.com>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarDavide Caratti <dcaratti@redhat.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 46e9acb7
...@@ -34,6 +34,7 @@ enum { ...@@ -34,6 +34,7 @@ enum {
*/ */
TCA_TUNNEL_KEY_ENC_TOS, /* u8 */ TCA_TUNNEL_KEY_ENC_TOS, /* u8 */
TCA_TUNNEL_KEY_ENC_TTL, /* u8 */ TCA_TUNNEL_KEY_ENC_TTL, /* u8 */
TCA_TUNNEL_KEY_NO_FRAG, /* flag */
__TCA_TUNNEL_KEY_MAX, __TCA_TUNNEL_KEY_MAX,
}; };
......
...@@ -420,6 +420,9 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla, ...@@ -420,6 +420,9 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,
nla_get_u8(tb[TCA_TUNNEL_KEY_NO_CSUM])) nla_get_u8(tb[TCA_TUNNEL_KEY_NO_CSUM]))
flags &= ~TUNNEL_CSUM; flags &= ~TUNNEL_CSUM;
if (nla_get_flag(tb[TCA_TUNNEL_KEY_NO_FRAG]))
flags |= TUNNEL_DONT_FRAGMENT;
if (tb[TCA_TUNNEL_KEY_ENC_DST_PORT]) if (tb[TCA_TUNNEL_KEY_ENC_DST_PORT])
dst_port = nla_get_be16(tb[TCA_TUNNEL_KEY_ENC_DST_PORT]); dst_port = nla_get_be16(tb[TCA_TUNNEL_KEY_ENC_DST_PORT]);
...@@ -747,6 +750,8 @@ static int tunnel_key_dump(struct sk_buff *skb, struct tc_action *a, ...@@ -747,6 +750,8 @@ static int tunnel_key_dump(struct sk_buff *skb, struct tc_action *a,
key->tp_dst)) || key->tp_dst)) ||
nla_put_u8(skb, TCA_TUNNEL_KEY_NO_CSUM, nla_put_u8(skb, TCA_TUNNEL_KEY_NO_CSUM,
!(key->tun_flags & TUNNEL_CSUM)) || !(key->tun_flags & TUNNEL_CSUM)) ||
((key->tun_flags & TUNNEL_DONT_FRAGMENT) &&
nla_put_flag(skb, TCA_TUNNEL_KEY_NO_FRAG)) ||
tunnel_key_opts_dump(skb, info)) tunnel_key_opts_dump(skb, info))
goto nla_put_failure; goto nla_put_failure;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment