summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-provider.h
diff options
context:
space:
mode:
authorAndy Zhou <azhou@ovn.org>2017-03-30 15:37:27 -0700
committerAndy Zhou <azhou@ovn.org>2017-04-28 14:00:58 -0700
commitba8cff36bbe8465d203af79036a917de38613dd3 (patch)
tree2eae999e5dc0083128a3a04e62e5599b9a9703e0 /ofproto/ofproto-provider.h
parentadfe7a0b57ef80394a45f792e4f27cd1bde10ab6 (diff)
downloadopenvswitch-ba8cff36bbe8465d203af79036a917de38613dd3.tar.gz
ofproto: Store meters using hmap
Currently, meters are stored in a fixed pointer array. It is not very efficient since the controller, at least in theory, can pick any meter id (up to the limits to uint32_t), not necessarily within the lower end of a region, or in close range to each other. In particular, OFPM_SLOWPATH and OFPM_CONTROLLER meters are specified at the high region. Switching to using hmap. Ofproto layer does not restrict the number of meters that controller can add, nor does it care about the value of meter_id. Datapth limits the number of meters ofproto layer can support at run time. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Diffstat (limited to 'ofproto/ofproto-provider.h')
-rw-r--r--ofproto/ofproto-provider.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
index b7b12cdfd..000326d7f 100644
--- a/ofproto/ofproto-provider.h
+++ b/ofproto/ofproto-provider.h
@@ -109,12 +109,9 @@ struct ofproto {
/* List of expirable flows, in all flow tables. */
struct ovs_list expirable OVS_GUARDED_BY(ofproto_mutex);
- /* Meter table.
- * OpenFlow meters start at 1. To avoid confusion we leave the first
- * pointer in the array un-used, and index directly with the OpenFlow
- * meter_id. */
+ /* Meter table. */
struct ofputil_meter_features meter_features;
- struct meter **meters; /* 'meter_features.max_meter' + 1 pointers. */
+ struct hmap meters; /* uint32_t indexed 'struct meter *'. */
/* OpenFlow connections. */
struct connmgr *connmgr;