]> git.proxmox.com Git - mirror_ovs.git/commit - lib/learning-switch.c
ofp-flow: Reduce memory consumption for ofputil_flow_mod, using minimatch.
authorBen Pfaff <blp@ovn.org>
Tue, 20 Mar 2018 05:01:47 +0000 (22:01 -0700)
committerBen Pfaff <blp@ovn.org>
Sat, 31 Mar 2018 18:33:28 +0000 (11:33 -0700)
commit6a6b7060655ed30a5e3307c3a6f26ffb77a2b5be
treeb536a8d97dc9c9482eb4ed937282659feab8fd5d
parent1dc1ec247e2a7fe126f9c8232a3d42521a8d8291
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>
13 files changed:
AUTHORS.rst
include/openvswitch/ofp-flow.h
lib/learn.c
lib/learning-switch.c
lib/ofp-bundle.c
lib/ofp-flow.c
ofproto/ofproto-dpif-xlate.c
ofproto/ofproto-dpif.c
ofproto/ofproto-dpif.h
ofproto/ofproto-provider.h
ofproto/ofproto.c
ovn/controller/ofctrl.c
utilities/ovs-ofctl.c