dpif-netdev: Correctly update 'key' in emc_processing().
authorDaniele Di Proietto <diproiettod@vmware.com>
Wed, 3 Feb 2016 04:38:11 +0000 (20:38 -0800)
committerDaniele Di Proietto <diproiettod@vmware.com>
Wed, 3 Feb 2016 18:54:56 +0000 (10:54 -0800)
The 'key' pointer must point at the first unused element in the key
array.

Fixes: b89c678b7a26 ("dpif-netdev: optmizing emc_processing()")
CC: Andy Zhou <azhou@ovn.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Andy Zhou <azhou@nicira.com>
lib/dpif-netdev.c

index 6e76bc2..f233b61 100644 (file)
@@ -3357,7 +3357,10 @@ emc_processing(struct dp_netdev_pmd_thread *pmd, struct dp_packet **packets,
             /* Exact match cache missed. Group missed packets together at
              * the beginning of the 'packets' array.  */
             packets[n_missed] = packet;
-            key = &keys[n_missed++];
+            /* 'key[n_missed]' contains the key of the current packet and it
+             * must be returned to the caller. The next key should be extracted
+             * to 'keys[n_missed + 1]'. */
+            key = &keys[++n_missed];
         }
     }