2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

flow: Wildcard UDP ports when using SYMMETRIC_L4 hash for select groups.

UDP source and destination ports are not used to derive the hash index
used for selecting the bucket in case of SYMMETRIC_L4 hash based select
groups. However, they are un-wildcarded in the megaflow entry match criteria.
This results in distinct megaflow entry being created for each pair of UDP
source and destination ports unnecessarily and causes significant performance
deterioration when the megaflow cache limit is reached.

This patch wildcards UDP ports when using select group with SYMMETRIC_L4
hash function.

Signed-off-by: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com>
CC: Jan Scheurich <jan.scheurich@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Vishal Deep Ajmera
2019-07-10 19:02:30 +05:30
committed by Ben Pfaff
parent 605535f9ad
commit cbbab70127

View File

@@ -2478,7 +2478,12 @@ flow_mask_hash_fields(const struct flow *flow, struct flow_wildcards *wc,
}
if (is_ip_any(flow)) {
memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto);
flow_unwildcard_tp_ports(flow, wc);
/* Unwildcard port only for non-UDP packets as udp port
* numbers are not used in hash calculations.
*/
if (flow->nw_proto != IPPROTO_UDP) {
flow_unwildcard_tp_ports(flow, wc);
}
}
for (i = 0; i < FLOW_MAX_VLAN_HEADERS; i++) {
wc->masks.vlans[i].tci |= htons(VLAN_VID_MASK | VLAN_CFI);