summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-03-19 22:01:47 -0700
committerBen Pfaff <blp@ovn.org>2018-03-31 11:33:28 -0700
commit6a6b7060655ed30a5e3307c3a6f26ffb77a2b5be (patch)
treeb536a8d97dc9c9482eb4ed937282659feab8fd5d /ofproto/ofproto-dpif.h
parent1dc1ec247e2a7fe126f9c8232a3d42521a8d8291 (diff)
downloadopenvswitch-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-dpif.h')
-rw-r--r--ofproto/ofproto-dpif.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ofproto/ofproto-dpif.h b/ofproto/ofproto-dpif.h
index 90432fa26..47bf7f9f0 100644
--- a/ofproto/ofproto-dpif.h
+++ b/ofproto/ofproto-dpif.h
@@ -335,7 +335,7 @@ struct ofport_dpif *ofp_port_to_ofport(const struct ofproto_dpif *,
ofp_port_t);
int ofproto_dpif_add_internal_flow(struct ofproto_dpif *,
- const struct match *, int priority,
+ struct match *, int priority,
uint16_t idle_timeout,
const struct ofpbuf *ofpacts,
struct rule **rulep);