mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
conntrack: Use a cmap to store zone limits.
Change the data structure from hmap to cmap for zone limits. As they are shared amongst multiple conntrack users, multiple readers want to check the current zone limit state before progressing in their processing. Using a CMAP allows doing lookups without taking the global 'ct_lock', thus reducing contention. Signed-off-by: Gaetan Rivet <grive@u256.net> Reviewed-by: Eli Britstein <elibr@nvidia.com> Signed-off-by: Paolo Valerio <pvalerio@redhat.com> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
committed by
Ilya Maximets
parent
cfba951585
commit
6edc278c85
@@ -9258,7 +9258,8 @@ dpif_netdev_ct_get_limits(struct dpif *dpif,
|
||||
czl = zone_limit_get(dp->conntrack, zone_limit->zone);
|
||||
if (czl.zone == zone_limit->zone || czl.zone == DEFAULT_ZONE) {
|
||||
ct_dpif_push_zone_limit(zone_limits_reply, zone_limit->zone,
|
||||
czl.limit, czl.count);
|
||||
czl.limit,
|
||||
atomic_count_get(&czl.count));
|
||||
} else {
|
||||
return EINVAL;
|
||||
}
|
||||
@@ -9268,7 +9269,7 @@ dpif_netdev_ct_get_limits(struct dpif *dpif,
|
||||
czl = zone_limit_get(dp->conntrack, z);
|
||||
if (czl.zone == z) {
|
||||
ct_dpif_push_zone_limit(zone_limits_reply, z, czl.limit,
|
||||
czl.count);
|
||||
atomic_count_get(&czl.count));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user