mirror of
https://github.com/openvswitch/ovs
synced 2025-10-23 14:57:06 +00:00
dpif-netdev: Implement the API functions to allow multiple handler
threads read upcall. This commit implements the API functions to allow multiple handler threads read upcall. Also, this commit removes the handling priority of DPIF_UC_MISS over DPIF_UC_ACTION. So, both misses will be put to the same queue. The decision is based on the fact that a lot has changed since the age when flow setup rate is most treasured and starving all actions in the presence of any flow misses doesn't seem like a sound balancing solution. Thusly the current implementation will be put in testing and investigation for better balancing solution will continue if there is an issue. Also note, the introduction and use of flow_hash_5tuple() will put missed ICMP packets from same source but with different type/code to different handler queues. This may cause reordering of these packets. For now, we do not count this as a problem. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
19
lib/flow.c
19
lib/flow.c
@@ -818,6 +818,25 @@ flow_wildcards_set_reg_mask(struct flow_wildcards *wc, int idx, uint32_t mask)
|
||||
wc->masks.regs[idx] = mask;
|
||||
}
|
||||
|
||||
/* Calculates the 5-tuple hash from the given flow. */
|
||||
uint32_t
|
||||
flow_hash_5tuple(const struct flow *flow, uint32_t basis)
|
||||
{
|
||||
uint32_t hash = 0;
|
||||
|
||||
if (!flow) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
hash = mhash_add(hash, (OVS_FORCE unsigned int) flow->nw_src);
|
||||
hash = mhash_add(basis, (OVS_FORCE unsigned int) flow->nw_dst);
|
||||
hash = mhash_add(hash, ((OVS_FORCE unsigned int) flow->tp_src << 16)
|
||||
| (OVS_FORCE unsigned int) flow->tp_dst);
|
||||
hash = mhash_add(hash, flow->nw_proto);
|
||||
|
||||
return mhash_finish(hash, 13);
|
||||
}
|
||||
|
||||
/* Hashes 'flow' based on its L2 through L4 protocol information. */
|
||||
uint32_t
|
||||
flow_hash_symmetric_l4(const struct flow *flow, uint32_t basis)
|
||||
|
||||
Reference in New Issue
Block a user