Format tunnel IDs consistently.
[sliver-openvswitch.git] / datapath / tunnel.c
index 77f976f..e666a91 100644 (file)
@@ -68,7 +68,7 @@
 #define CACHE_DATA_ALIGN 16
 
 /* Protected by RCU. */
-static struct tbl *port_table;
+static struct tbl *port_table __read_mostly;
 
 static void cache_cleaner(struct work_struct *work);
 DECLARE_DELAYED_WORK(cache_cleaner_wq, cache_cleaner);
@@ -78,10 +78,10 @@ DECLARE_DELAYED_WORK(cache_cleaner_wq, cache_cleaner);
  * synchronization because we could have just as easily read the value before
  * the port change happened.
  */
-static unsigned int key_local_remote_ports;
-static unsigned int key_remote_ports;
-static unsigned int local_remote_ports;
-static unsigned int remote_ports;
+static unsigned int key_local_remote_ports __read_mostly;
+static unsigned int key_remote_ports __read_mostly;
+static unsigned int local_remote_ports __read_mostly;
+static unsigned int remote_ports __read_mostly;
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
 #define rt_dst(rt) (rt->dst)
@@ -1099,6 +1099,7 @@ static int send_frags(struct sk_buff *skb,
                int frag_len = skb->len - mutable->tunnel_hlen;
 
                skb->next = NULL;
+               memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
 
                err = ip_local_out(skb);
                if (likely(net_xmit_eval(err) == 0))
@@ -1247,10 +1248,6 @@ int tnl_send(struct vport *vport, struct sk_buff *skb)
                                skb_dst_set(skb, unattached_dst);
                                unattached_dst = NULL;
                        }
-
-
-                       memset(&IPCB(skb)->opt, 0, sizeof(IPCB(skb)->opt));
-                       IPCB(skb)->flags = 0;
                }
                skb_set_transport_header(skb, skb_network_offset(skb) + sizeof(struct iphdr));
 
@@ -1269,11 +1266,10 @@ int tnl_send(struct vport *vport, struct sk_buff *skb)
                        struct vport *cache_vport = internal_dev_get_vport(rt_dst(rt).dev);
 
                        skb->protocol = htons(ETH_P_IP);
-
                        iph->tot_len = htons(skb->len - skb_network_offset(skb));
                        ip_send_check(iph);
 
-                       if (likely(cache_vport)) {
+                       if (cache_vport) {
                                OVS_CB(skb)->flow = cache->flow;
                                compute_ip_summed(skb, true);
                                vport_receive(cache_vport, skb);