pinsched: Avoid uninitialized variable warning.
[openvswitch] / datapath / datapath.c
index 7a70163a0a35912505a55afa05f0cfafb5625d82..55d3c67c50535388e60df26f19ceb0219893df44 100644 (file)
@@ -501,6 +501,7 @@ void dp_process_received_packet(struct vport *p, struct sk_buff *skb)
                OVS_CB(skb)->flow = flow_cast(flow_node);
        }
 
+       stats_counter_off = offsetof(struct dp_stats_percpu, n_hit);
        flow_used(OVS_CB(skb)->flow, skb);
 
        acts = rcu_dereference(OVS_CB(skb)->flow->sf_acts);
@@ -511,13 +512,13 @@ void dp_process_received_packet(struct vport *p, struct sk_buff *skb)
                loop->looping = true;
        if (unlikely(loop->looping)) {
                loop_suppress(dp, acts);
+               kfree_skb(skb);
                goto out_loop;
        }
 
        /* Execute actions. */
        execute_actions(dp, skb, &OVS_CB(skb)->flow->key, acts->actions,
                        acts->actions_len);
-       stats_counter_off = offsetof(struct dp_stats_percpu, n_hit);
 
        /* Check whether sub-actions looped too much. */
        if (unlikely(loop->looping))
@@ -544,7 +545,7 @@ out:
 /* Append each packet in 'skb' list to 'queue'.  There will be only one packet
  * unless we broke up a GSO packet. */
 static int queue_control_packets(struct sk_buff *skb, struct sk_buff_head *queue,
-                                int queue_no, u32 arg)
+                                int queue_no, u64 arg)
 {
        struct sk_buff *nskb;
        int port_no;
@@ -569,7 +570,6 @@ static int queue_control_packets(struct sk_buff *skb, struct sk_buff_head *queue
                header->type = queue_no;
                header->length = skb->len;
                header->port = port_no;
-               header->reserved = 0;
                header->arg = arg;
                skb_queue_tail(queue, skb);
 
@@ -587,7 +587,7 @@ err_kfree_skbs:
 }
 
 int dp_output_control(struct datapath *dp, struct sk_buff *skb, int queue_no,
-                     u32 arg)
+                     u64 arg)
 {
        struct dp_stats_percpu *stats;
        struct sk_buff_head *queue;
@@ -610,16 +610,12 @@ int dp_output_control(struct datapath *dp, struct sk_buff *skb, int queue_no,
         * userspace may try to stuff a 64kB packet into a 1500-byte MTU. */
        if (skb_is_gso(skb)) {
                struct sk_buff *nskb = skb_gso_segment(skb, NETIF_F_SG | NETIF_F_HW_CSUM);
-               if (nskb) {
-                       kfree_skb(skb);
-                       skb = nskb;
-                       if (unlikely(IS_ERR(skb))) {
-                               err = PTR_ERR(skb);
-                               goto err;
-                       }
-               } else {
-                       /* XXX This case might not be possible.  It's hard to
-                        * tell from the skb_gso_segment() code and comment. */
+               
+               kfree_skb(skb);
+               skb = nskb;
+               if (IS_ERR(skb)) {
+                       err = PTR_ERR(skb);
+                       goto err;
                }
        }
 
@@ -666,7 +662,7 @@ static int validate_actions(const struct nlattr *actions, u32 actions_len)
         nla_for_each_attr(a, actions, actions_len, rem) {
                 static const u32 action_lens[ODPAT_MAX + 1] = {
                         [ODPAT_OUTPUT] = 4,
-                        [ODPAT_CONTROLLER] = 4,
+                        [ODPAT_CONTROLLER] = 8,
                         [ODPAT_SET_DL_TCI] = 2,
                         [ODPAT_STRIP_VLAN] = 0,
                         [ODPAT_SET_DL_SRC] = ETH_ALEN,
@@ -676,7 +672,7 @@ static int validate_actions(const struct nlattr *actions, u32 actions_len)
                         [ODPAT_SET_NW_TOS] = 1,
                         [ODPAT_SET_TP_SRC] = 2,
                         [ODPAT_SET_TP_DST] = 2,
-                        [ODPAT_SET_TUNNEL] = 4,
+                        [ODPAT_SET_TUNNEL] = 8,
                         [ODPAT_SET_PRIORITY] = 4,
                         [ODPAT_POP_PRIORITY] = 0,
                         [ODPAT_DROP_SPOOFED_ARP] = 0,