Skip to content

Commit

Permalink
dpif-netdev: Correctly update 'key' in emc_processing().
Browse files Browse the repository at this point in the history
The 'key' pointer must point at the first unused element in the key
array.

Fixes: b89c678 ("dpif-netdev: optmizing emc_processing()")
CC: Andy Zhou <[email protected]>
Signed-off-by: Daniele Di Proietto <[email protected]>
Acked-by: Andy Zhou <[email protected]>
  • Loading branch information
ddiproietto committed Feb 3, 2016
1 parent 88779d6 commit 400486f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/dpif-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}

Expand Down

0 comments on commit 400486f

Please sign in to comment.