summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@samsung.com>2018-07-25 19:09:31 +0300
committerIan Stokes <ian.stokes@intel.com>2018-08-08 22:06:21 +0100
commit18e08953cf3bdbc1f73a1b7349322259e6be2748 (patch)
tree157d95244da747926cfc7496842d79894bc57e49 /lib
parentc3cc694b93dd523176d2131a4b1b3b3170644638 (diff)
downloadopenvswitch-18e08953cf3bdbc1f73a1b7349322259e6be2748.tar.gz
dpif-netdev: Fix zero length keys insertion to EMC.
'key.len' should be calculated before inserting to EMC, otherwise resulting entry will match with any packet with the same hash. CC: Yipeng Wang <yipeng1.wang@intel.com> Fixes: 60d8ccae135f ("dpif-netdev: Add SMC cache after EMC cache") Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Yipeng Wang <yipeng1.wang@intel.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/dpif-netdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 26d07b39c..5ee8d0a4c 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -5801,9 +5801,9 @@ smc_lookup_batch(struct dp_netdev_pmd_thread *pmd,
if (OVS_LIKELY(dpcls_rule_matches_key(&flow->cr, &keys[i]) &&
flow->flow.in_port.odp_port == packet->md.in_port.odp_port)) {
/* SMC hit and emc miss, we insert into EMC */
- emc_probabilistic_insert(pmd, &keys[i], flow);
keys[i].len =
netdev_flow_key_size(miniflow_n_values(&keys[i].mf));
+ emc_probabilistic_insert(pmd, &keys[i], flow);
dp_netdev_queue_batches(packet, flow,
miniflow_get_tcp_flags(&keys[i].mf), batches, n_batches);
n_smc_hit++;