datapath: Shorten flow tunneling flags.
authorJesse Gross <jesse@nicira.com>
Tue, 6 Nov 2012 20:45:19 +0000 (12:45 -0800)
committerJesse Gross <jesse@nicira.com>
Wed, 7 Nov 2012 07:27:55 +0000 (23:27 -0800)
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>
datapath/flow.c
datapath/tunnel.c
datapath/vport-capwap.c
datapath/vport-gre.c
include/linux/openvswitch.h

index f33760a..fdfe3e9 100644 (file)
@@ -1034,7 +1034,7 @@ int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp,
 
                if (!tun_key->ipv4_dst)
                        return -EINVAL;
-               if (!(tun_key->tun_flags & OVS_FLOW_TNL_F_KEY))
+               if (!(tun_key->tun_flags & OVS_TNL_F_KEY))
                        return -EINVAL;
 
                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);
 
                                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;
                                        if (tun_key->tun_id != tun_id)
                                                return -EINVAL;
                                        break;
                                }
                                tun_key->tun_id = tun_id;
-                               tun_key->tun_flags |= OVS_FLOW_TNL_F_KEY;
+                               tun_key->tun_flags |= OVS_TNL_F_KEY;
 
                                break;
 
                        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;
 
                                        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;
 
                                        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);
                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))
                goto nla_put_failure;
 
index efc8b1c..fb4854a 100644 (file)
@@ -636,7 +636,7 @@ static bool check_mtu(struct sk_buff *skb,
        if (OVS_CB(skb)->tun_key->ipv4_dst) {
                df_inherit = 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;
        } else {
                df_inherit = mutable->flags & TNL_F_DF_INHERIT;
index b4c3b49..f26d3ff 100644 (file)
@@ -162,9 +162,9 @@ static void get_capwap_param(const struct tnl_mutable_config *mutable,
        if (tun_key->ipv4_dst) {
                *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;
-               if (tun_key->tun_flags & OVS_FLOW_TNL_F_CSUM)
+               if (tun_key->tun_flags & OVS_TNL_F_CSUM)
                        *flags |= TNL_F_CSUM;
                *out_key = tun_key->tun_id;
        } else {
@@ -359,7 +359,7 @@ static int capwap_rcv(struct sock *sk, struct sk_buff *skb)
                         !(mutable->flags & TNL_F_IN_KEY_MATCH))
                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_tnl_rcv(vport, skb);
index d378ccb..45e38b0 100644 (file)
@@ -52,9 +52,9 @@ static void get_gre_param(const struct tnl_mutable_config *mutable,
        if (tun_key->ipv4_dst) {
                *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;
-               if (tun_key->tun_flags & OVS_FLOW_TNL_F_CSUM)
+               if (tun_key->tun_flags & OVS_TNL_F_CSUM)
                        *flags |= TNL_F_CSUM;
                *tunnel_type = TNL_T_PROTO_GRE;
                *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 (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)
-                       tunnel_flags = OVS_FLOW_TNL_F_KEY;
+                       tunnel_flags = OVS_TNL_F_KEY;
        }
 
        if (gre_flags & GRE_CSUM)
-               tunnel_flags |= OVS_FLOW_TNL_F_CSUM;
+               tunnel_flags |= OVS_TNL_F_CSUM;
 
        return tunnel_flags;
 }
index e3e4191..c4823d9 100644 (file)
@@ -364,9 +364,9 @@ struct ovs_key_nd {
 };
 
 /* Values for ovs_key_ipv4_tunnel->tun_flags */
-#define OVS_FLOW_TNL_F_DONT_FRAGMENT (1 << 0)
-#define OVS_FLOW_TNL_F_CSUM (1 << 1)
-#define OVS_FLOW_TNL_F_KEY (1 << 2)
+#define OVS_TNL_F_DONT_FRAGMENT (1 << 0)
+#define OVS_TNL_F_CSUM (1 << 1)
+#define OVS_TNL_F_KEY (1 << 2)
 
 struct ovs_key_ipv4_tunnel {
        __be64 tun_id;