]> git.proxmox.com Git - mirror_ovs.git/commitdiff
datapath: Initialize OVS_CB in ovs_vport_receive()
authorPravin B Shelar <pshelar@nicira.com>
Thu, 26 Jun 2014 22:15:00 +0000 (15:15 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Fri, 27 Jun 2014 16:55:55 +0000 (09:55 -0700)
On packet recv OVS CB is initialized in multiple function.
Following patch moves all these initialization to
ovs_vport_receive().
This patch also save a check in execute actions.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/actions.c
datapath/datapath.c
datapath/datapath.h
datapath/vport.c

index cb26ad59280aedd322c21663779ddde4197e7ad3..1f12f55ba9cce062c53d596546a36f762ffac261 100644 (file)
@@ -811,9 +811,6 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb, bool recirc)
                goto out_loop;
        }
 
-       if (!recirc)
-               ovs_skb_init_inner_protocol(skb);
-
        OVS_CB(skb)->tun_info = NULL;
        error = do_execute_actions(dp, skb, acts->actions, acts->actions_len);
 
index 4ec908e4bb47d9118806f0fbffaec920a13c6cd2..e504fee2ccf74ddec475549c594d5b7d397bc297 100644 (file)
@@ -285,15 +285,13 @@ out:
 }
 
 /* Must be called with rcu_read_lock. */
-void ovs_dp_process_received_packet(struct vport *p, struct sk_buff *skb)
+void ovs_dp_process_received_packet(struct sk_buff *skb)
 {
        int error;
        struct sw_flow_key key;
 
-       OVS_CB(skb)->input_vport = p;
-
        /* Extract flow from 'skb' into 'key'. */
-       error = ovs_flow_extract(skb, p->port_no, &key);
+       error = ovs_flow_extract(skb, OVS_CB(skb)->input_vport->port_no, &key);
        if (unlikely(error)) {
                kfree_skb(skb);
                return;
index fcd8e861e8365dbf473ba05c9db2a292fb561ce9..d6dee50ad22da3cac6c2b28f132fc7a751677dd0 100644 (file)
@@ -189,7 +189,7 @@ extern struct notifier_block ovs_dp_device_notifier;
 extern struct genl_family dp_vport_genl_family;
 extern struct genl_multicast_group ovs_dp_vport_multicast_group;
 
-void ovs_dp_process_received_packet(struct vport *, struct sk_buff *);
+void ovs_dp_process_received_packet(struct sk_buff *);
 void ovs_dp_process_packet_with_key(struct sk_buff *,
                                    struct sw_flow_key *pkt_key, bool recirc);
 void ovs_dp_detach_port(struct vport *);
index 02ccc89105093799b6b7319dac9698676eaf6136..897f2219ad06cab51d4c7a10f0683a320014c8a3 100644 (file)
@@ -32,6 +32,7 @@
 #include <net/net_namespace.h>
 
 #include "datapath.h"
+#include "gso.h"
 #include "vport.h"
 #include "vport-internal_dev.h"
 
@@ -478,8 +479,10 @@ void ovs_vport_receive(struct vport *vport, struct sk_buff *skb,
        stats->rx_bytes += skb->len;
        u64_stats_update_end(&stats->syncp);
 
+       ovs_skb_init_inner_protocol(skb);
        OVS_CB(skb)->tun_info = tun_info;
-       ovs_dp_process_received_packet(vport, skb);
+       OVS_CB(skb)->input_vport = vport;
+       ovs_dp_process_received_packet(skb);
 }
 
 /**