openvswitch: Remove egress_tun_info.
authorPravin B Shelar <pshelar@nicira.com>
Sun, 30 Aug 2015 00:44:06 +0000 (17:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 30 Aug 2015 02:07:15 +0000 (19:07 -0700)
tun info is passed using skb-dst pointer. Now we have
converted all vports to netdev based implementation so
Now we can remove redundant pointer to tun-info from OVS_CB.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/openvswitch/actions.c
net/openvswitch/datapath.c
net/openvswitch/datapath.h
net/openvswitch/vport-geneve.c
net/openvswitch/vport-gre.c
net/openvswitch/vport-vxlan.c
net/openvswitch/vport.c
net/openvswitch/vport.h

index 4487543806bbe15c742b0a491a700c5503d9cfed..090d9e3a460c22d6269cdb85b8eed6b1fe6d3aab 100644 (file)
@@ -896,10 +896,6 @@ static int execute_set_action(struct sk_buff *skb,
                skb_dst_drop(skb);
                dst_hold((struct dst_entry *)tun->tun_dst);
                skb_dst_set(skb, (struct dst_entry *)tun->tun_dst);
-
-               /* FIXME: Remove when all vports have been converted */
-               OVS_CB(skb)->egress_tun_info = &tun->tun_dst->u.tun_info;
-
                return 0;
        }
 
@@ -1159,7 +1155,6 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
        int err;
 
        this_cpu_inc(exec_actions_level);
-       OVS_CB(skb)->egress_tun_info = NULL;
        err = do_execute_actions(dp, skb, key,
                                 acts->actions, acts->actions_len);
 
index ec0f8d9cee731118b4fe136106e5c6e6b07edc63..60c2ab8e6bc3013b167646b13b6fd57c4bc1d25e 100644 (file)
@@ -610,7 +610,6 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
                goto err_flow_free;
 
        rcu_assign_pointer(flow->sf_acts, acts);
-       OVS_CB(packet)->egress_tun_info = NULL;
        packet->priority = flow->key.phy.priority;
        packet->mark = flow->key.phy.skb_mark;
 
index 4e785ab889732bf5619f3eeb1e83782e427e96e5..da15fd3f3c3403a6b6ff8076ed0556c6c3c085d2 100644 (file)
@@ -94,15 +94,12 @@ struct datapath {
 
 /**
  * struct ovs_skb_cb - OVS data in skb CB
- * @egress_tun_key: Tunnel information about this packet on egress path.
- * NULL if the packet is not being tunneled.
  * @input_vport: The original vport packet came in on. This value is cached
  * when a packet is received by OVS.
  * @mru: The maximum received fragement size; 0 if the packet is not
  * fragmented.
  */
 struct ovs_skb_cb {
-       struct ip_tunnel_info  *egress_tun_info;
        struct vport            *input_vport;
        u16                     mru;
 };
index fa37c95f733947d06d04cec217995be8ca79196b..24c56e56feddb0d5a329c636ab8d07baf65edf9c 100644 (file)
@@ -62,8 +62,7 @@ static int geneve_get_egress_tun_info(struct vport *vport, struct sk_buff *skb,
 
        return ovs_tunnel_get_egress_info(egress_tun_info,
                                          ovs_dp_get_net(vport->dp),
-                                         OVS_CB(skb)->egress_tun_info,
-                                         IPPROTO_UDP, skb->mark, sport, dport);
+                                         skb, IPPROTO_UDP, sport, dport);
 }
 
 static struct vport *geneve_tnl_create(const struct vport_parms *parms)
index 871801d2ac23e82a26f09f22e13e71797dc9a603..36c39843607ef5c0ebc27bf82a31dfb607896c4b 100644 (file)
@@ -89,8 +89,7 @@ static int gre_get_egress_tun_info(struct vport *vport, struct sk_buff *skb,
 {
        return ovs_tunnel_get_egress_info(egress_tun_info,
                                          ovs_dp_get_net(vport->dp),
-                                         OVS_CB(skb)->egress_tun_info,
-                                         IPPROTO_GRE, skb->mark, 0, 0);
+                                         skb, IPPROTO_GRE, 0, 0);
 }
 
 static struct vport_ops ovs_gre_vport_ops = {
index 1e8b00a23a239c1fa456c614738a3c55ed211a5e..ed7b23f443ec9885a960bee27b5ed40016b2b1c2 100644 (file)
@@ -160,8 +160,7 @@ static int vxlan_get_egress_tun_info(struct vport *vport, struct sk_buff *skb,
        src_port = udp_flow_src_port(net, skb, 0, 0, true);
 
        return ovs_tunnel_get_egress_info(egress_tun_info, net,
-                                         OVS_CB(skb)->egress_tun_info,
-                                         IPPROTO_UDP, skb->mark,
+                                         skb, IPPROTO_UDP,
                                          src_port, dst_port);
 }
 
index 40164037928e7e8a28a98a9ca7f48c51cdefe343..e658439a0bdd7dc9f09ea9873934798b5415f24c 100644 (file)
@@ -483,7 +483,6 @@ void ovs_vport_receive(struct vport *vport, struct sk_buff *skb,
        u64_stats_update_end(&stats->syncp);
 
        OVS_CB(skb)->input_vport = vport;
-       OVS_CB(skb)->egress_tun_info = NULL;
        OVS_CB(skb)->mru = 0;
        /* Extract flow from 'skb' into 'key'. */
        error = ovs_flow_key_extract(tun_info, skb, &key);
@@ -575,13 +574,14 @@ EXPORT_SYMBOL_GPL(ovs_vport_deferred_free);
 
 int ovs_tunnel_get_egress_info(struct ip_tunnel_info *egress_tun_info,
                               struct net *net,
-                              const struct ip_tunnel_info *tun_info,
+                              struct sk_buff *skb,
                               u8 ipproto,
-                              u32 skb_mark,
                               __be16 tp_src,
                               __be16 tp_dst)
 {
+       const struct ip_tunnel_info *tun_info = skb_tunnel_info(skb);
        const struct ip_tunnel_key *tun_key;
+       u32 skb_mark = skb->mark;
        struct rtable *rt;
        struct flowi4 fl;
 
index 2f352446b6a8f952a1626eeb8cf639883dbac15d..a36aef22af7fe53c919df8db50277d7c3eac7e1b 100644 (file)
@@ -61,9 +61,8 @@ int ovs_vport_send(struct vport *, struct sk_buff *);
 
 int ovs_tunnel_get_egress_info(struct ip_tunnel_info *egress_tun_info,
                               struct net *net,
-                              const struct ip_tunnel_info *tun_info,
+                              struct sk_buff *,
                               u8 ipproto,
-                              u32 skb_mark,
                               __be16 tp_src,
                               __be16 tp_dst);
 int ovs_vport_get_egress_tun_info(struct vport *vport, struct sk_buff *skb,