diff options
author | Ben Pfaff <blp@ovn.org> | 2018-03-19 22:01:47 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-03-31 11:33:28 -0700 |
commit | 6a6b7060655ed30a5e3307c3a6f26ffb77a2b5be (patch) | |
tree | b536a8d97dc9c9482eb4ed937282659feab8fd5d /ofproto/ofproto-provider.h | |
parent | 1dc1ec247e2a7fe126f9c8232a3d42521a8d8291 (diff) | |
download | openvswitch-6a6b7060655ed30a5e3307c3a6f26ffb77a2b5be.tar.gz |
ofp-flow: Reduce memory consumption for ofputil_flow_mod, using minimatch.
Until now, struct ofputil_flow_mod, which represents an OpenFlow flow table
modification request, has incorporated a struct match, which made the
overall ofputil_flow_mod about 2.5 kB. This is OK for a small number of
flows, but absurdly inflates memory requirements when there are hundreds of
thousands of flows. This commit fixes the problem by changing struct match
to struct minimatch inside ofputil_flow_mod, which reduces its size to
about 100 bytes plus the actual size of the flow match (usually a few dozen
bytes).
This affects memory usage of ovs-ofctl (when it adds a large number of
flows) more than ovs-vswitchd.
Reported-by: Michael Ben-Ami <mbenami@digitalocean.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Armando Migliaccio <armamig@gmail.com>
Tested-by: Armando Migliaccio <armamig@gmail.com>
Reviewed-by: Jan Scheurich <jan.scheurich@ericsson.com>
Tested-by: Jan Scheurich <jan.scheurich@ericsson.com>
Tested-by: Yifeng Sun <pkusunyifeng@gmail.com>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Diffstat (limited to 'ofproto/ofproto-provider.h')
-rw-r--r-- | ofproto/ofproto-provider.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h index 92d4622b3..d636fb35c 100644 --- a/ofproto/ofproto-provider.h +++ b/ofproto/ofproto-provider.h @@ -1199,7 +1199,7 @@ struct ofproto_class { * * If this function is NULL then table 0 is always chosen. */ enum ofperr (*rule_choose_table)(const struct ofproto *ofproto, - const struct match *match, + const struct minimatch *match, uint8_t *table_idp); /* Life-cycle functions for a "struct rule". |