mirror of
https://github.com/openvswitch/ovs
synced 2025-09-03 15:55:19 +00:00
datapath: Shorten flow tunneling flags.
The names for the flags used by flow based tunneling are pretty long. This shortens them a little by removing the word FLOW, which is a distinction that won't be meaningful in the near future. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Kyle Mestery <kmestery@cisco.com>
This commit is contained in:
@@ -1034,7 +1034,7 @@ int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp,
|
|||||||
|
|
||||||
if (!tun_key->ipv4_dst)
|
if (!tun_key->ipv4_dst)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (!(tun_key->tun_flags & OVS_FLOW_TNL_F_KEY))
|
if (!(tun_key->tun_flags & OVS_TNL_F_KEY))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
tun_id = nla_get_be64(a[OVS_KEY_ATTR_TUN_ID]);
|
tun_id = nla_get_be64(a[OVS_KEY_ATTR_TUN_ID]);
|
||||||
@@ -1223,23 +1223,23 @@ int ovs_flow_metadata_from_nlattrs(struct sw_flow *flow, int key_len, const stru
|
|||||||
tun_id = nla_get_be64(nla);
|
tun_id = nla_get_be64(nla);
|
||||||
|
|
||||||
if (tun_key->ipv4_dst) {
|
if (tun_key->ipv4_dst) {
|
||||||
if (!(tun_key->tun_flags & OVS_FLOW_TNL_F_KEY))
|
if (!(tun_key->tun_flags & OVS_TNL_F_KEY))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (tun_key->tun_id != tun_id)
|
if (tun_key->tun_id != tun_id)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tun_key->tun_id = tun_id;
|
tun_key->tun_id = tun_id;
|
||||||
tun_key->tun_flags |= OVS_FLOW_TNL_F_KEY;
|
tun_key->tun_flags |= OVS_TNL_F_KEY;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OVS_KEY_ATTR_IPV4_TUNNEL:
|
case OVS_KEY_ATTR_IPV4_TUNNEL:
|
||||||
if (tun_key->tun_flags & OVS_FLOW_TNL_F_KEY) {
|
if (tun_key->tun_flags & OVS_TNL_F_KEY) {
|
||||||
tun_id = tun_key->tun_id;
|
tun_id = tun_key->tun_id;
|
||||||
|
|
||||||
memcpy(tun_key, nla_data(nla), sizeof(*tun_key));
|
memcpy(tun_key, nla_data(nla), sizeof(*tun_key));
|
||||||
if (!(tun_key->tun_flags & OVS_FLOW_TNL_F_KEY))
|
if (!(tun_key->tun_flags & OVS_TNL_F_KEY))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (tun_key->tun_id != tun_id)
|
if (tun_key->tun_id != tun_id)
|
||||||
@@ -1285,7 +1285,7 @@ int ovs_flow_to_nlattrs(const struct sw_flow_key *swkey, struct sk_buff *skb)
|
|||||||
tun_key = nla_data(nla);
|
tun_key = nla_data(nla);
|
||||||
memcpy(tun_key, &swkey->phy.tun.tun_key, sizeof(*tun_key));
|
memcpy(tun_key, &swkey->phy.tun.tun_key, sizeof(*tun_key));
|
||||||
}
|
}
|
||||||
if ((swkey->phy.tun.tun_key.tun_flags & OVS_FLOW_TNL_F_KEY) &&
|
if ((swkey->phy.tun.tun_key.tun_flags & OVS_TNL_F_KEY) &&
|
||||||
nla_put_be64(skb, OVS_KEY_ATTR_TUN_ID, swkey->phy.tun.tun_key.tun_id))
|
nla_put_be64(skb, OVS_KEY_ATTR_TUN_ID, swkey->phy.tun.tun_key.tun_id))
|
||||||
goto nla_put_failure;
|
goto nla_put_failure;
|
||||||
|
|
||||||
|
@@ -636,7 +636,7 @@ static bool check_mtu(struct sk_buff *skb,
|
|||||||
if (OVS_CB(skb)->tun_key->ipv4_dst) {
|
if (OVS_CB(skb)->tun_key->ipv4_dst) {
|
||||||
df_inherit = false;
|
df_inherit = false;
|
||||||
pmtud = false;
|
pmtud = false;
|
||||||
frag_off = OVS_CB(skb)->tun_key->tun_flags & OVS_FLOW_TNL_F_DONT_FRAGMENT ?
|
frag_off = OVS_CB(skb)->tun_key->tun_flags & OVS_TNL_F_DONT_FRAGMENT ?
|
||||||
htons(IP_DF) : 0;
|
htons(IP_DF) : 0;
|
||||||
} else {
|
} else {
|
||||||
df_inherit = mutable->flags & TNL_F_DF_INHERIT;
|
df_inherit = mutable->flags & TNL_F_DF_INHERIT;
|
||||||
|
@@ -162,9 +162,9 @@ static void get_capwap_param(const struct tnl_mutable_config *mutable,
|
|||||||
if (tun_key->ipv4_dst) {
|
if (tun_key->ipv4_dst) {
|
||||||
*flags = 0;
|
*flags = 0;
|
||||||
|
|
||||||
if (tun_key->tun_flags & OVS_FLOW_TNL_F_KEY)
|
if (tun_key->tun_flags & OVS_TNL_F_KEY)
|
||||||
*flags = TNL_F_OUT_KEY_ACTION;
|
*flags = TNL_F_OUT_KEY_ACTION;
|
||||||
if (tun_key->tun_flags & OVS_FLOW_TNL_F_CSUM)
|
if (tun_key->tun_flags & OVS_TNL_F_CSUM)
|
||||||
*flags |= TNL_F_CSUM;
|
*flags |= TNL_F_CSUM;
|
||||||
*out_key = tun_key->tun_id;
|
*out_key = tun_key->tun_id;
|
||||||
} else {
|
} else {
|
||||||
@@ -359,7 +359,7 @@ static int capwap_rcv(struct sock *sk, struct sk_buff *skb)
|
|||||||
!(mutable->flags & TNL_F_IN_KEY_MATCH))
|
!(mutable->flags & TNL_F_IN_KEY_MATCH))
|
||||||
key_present = false;
|
key_present = false;
|
||||||
|
|
||||||
tnl_tun_key_init(&tun_key, iph, key, key_present ? OVS_FLOW_TNL_F_KEY : 0);
|
tnl_tun_key_init(&tun_key, iph, key, key_present ? OVS_TNL_F_KEY : 0);
|
||||||
OVS_CB(skb)->tun_key = &tun_key;
|
OVS_CB(skb)->tun_key = &tun_key;
|
||||||
|
|
||||||
ovs_tnl_rcv(vport, skb);
|
ovs_tnl_rcv(vport, skb);
|
||||||
|
@@ -52,9 +52,9 @@ static void get_gre_param(const struct tnl_mutable_config *mutable,
|
|||||||
if (tun_key->ipv4_dst) {
|
if (tun_key->ipv4_dst) {
|
||||||
*flags = 0;
|
*flags = 0;
|
||||||
|
|
||||||
if (tun_key->tun_flags & OVS_FLOW_TNL_F_KEY)
|
if (tun_key->tun_flags & OVS_TNL_F_KEY)
|
||||||
*flags = TNL_F_OUT_KEY_ACTION;
|
*flags = TNL_F_OUT_KEY_ACTION;
|
||||||
if (tun_key->tun_flags & OVS_FLOW_TNL_F_CSUM)
|
if (tun_key->tun_flags & OVS_TNL_F_CSUM)
|
||||||
*flags |= TNL_F_CSUM;
|
*flags |= TNL_F_CSUM;
|
||||||
*tunnel_type = TNL_T_PROTO_GRE;
|
*tunnel_type = TNL_T_PROTO_GRE;
|
||||||
*out_key = tun_key->tun_id;
|
*out_key = tun_key->tun_id;
|
||||||
@@ -384,13 +384,13 @@ static u32 gre_flags_to_tunnel_flags(const struct tnl_mutable_config *mutable,
|
|||||||
|
|
||||||
if (gre_flags & GRE_KEY) {
|
if (gre_flags & GRE_KEY) {
|
||||||
if (mutable->key.daddr && (mutable->flags & TNL_F_IN_KEY_MATCH))
|
if (mutable->key.daddr && (mutable->flags & TNL_F_IN_KEY_MATCH))
|
||||||
tunnel_flags = OVS_FLOW_TNL_F_KEY;
|
tunnel_flags = OVS_TNL_F_KEY;
|
||||||
else if (!mutable->key.daddr)
|
else if (!mutable->key.daddr)
|
||||||
tunnel_flags = OVS_FLOW_TNL_F_KEY;
|
tunnel_flags = OVS_TNL_F_KEY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gre_flags & GRE_CSUM)
|
if (gre_flags & GRE_CSUM)
|
||||||
tunnel_flags |= OVS_FLOW_TNL_F_CSUM;
|
tunnel_flags |= OVS_TNL_F_CSUM;
|
||||||
|
|
||||||
return tunnel_flags;
|
return tunnel_flags;
|
||||||
}
|
}
|
||||||
|
@@ -364,9 +364,9 @@ struct ovs_key_nd {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Values for ovs_key_ipv4_tunnel->tun_flags */
|
/* Values for ovs_key_ipv4_tunnel->tun_flags */
|
||||||
#define OVS_FLOW_TNL_F_DONT_FRAGMENT (1 << 0)
|
#define OVS_TNL_F_DONT_FRAGMENT (1 << 0)
|
||||||
#define OVS_FLOW_TNL_F_CSUM (1 << 1)
|
#define OVS_TNL_F_CSUM (1 << 1)
|
||||||
#define OVS_FLOW_TNL_F_KEY (1 << 2)
|
#define OVS_TNL_F_KEY (1 << 2)
|
||||||
|
|
||||||
struct ovs_key_ipv4_tunnel {
|
struct ovs_key_ipv4_tunnel {
|
||||||
__be64 tun_id;
|
__be64 tun_id;
|
||||||
|
Reference in New Issue
Block a user