[ovs-git] [openvswitch/ovs] 1f7270: match: Add 'tun_md' member to struct minimatch.

GitHub noreply at github.com
Sat Mar 31 18:52:24 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 1f7270d737c7fc1b2cd49bc34048198f0201201b
      https://github.com/openvswitch/ovs/commit/1f7270d737c7fc1b2cd49bc34048198f0201201b
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-03-31 (Sat, 31 Mar 2018)

  Changed paths:
    M include/openvswitch/match.h
    M include/openvswitch/tun-metadata.h
    M lib/match.c
    M lib/tun-metadata.c

  Log Message:
  -----------
  match: Add 'tun_md' member to struct minimatch.

struct match has had a 'tun_md' member for a long time, but struct
minimatch has never had one.  This doesn't matter for the purposes for
which minimatch is currently used, but it means that a minimatch is not
completely substitutable for a match and therefore blocks some new uses.
This patch adds the member.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Reviewed-by: Yifeng Sun <pkusunyifeng at gmail.com>
Reviewed-by: Armando Migliaccio <armamig at gmail.com>


  Commit: f825fdd4ff99fda707fb3b73596bf7d6bc7a1389
      https://github.com/openvswitch/ovs/commit/f825fdd4ff99fda707fb3b73596bf7d6bc7a1389
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-03-31 (Sat, 31 Mar 2018)

  Changed paths:
    M lib/classifier.c
    M lib/dpif-netdev.c
    M lib/flow.c
    M lib/flow.h

  Log Message:
  -----------
  flow: Improve type-safety of MINIFLOW_GET_TYPE.

Until mow, this macro has blindly read the passed-in type's size, but
that's unnecessarily risky.  This commit changes it to verify that the
passed-in type is the same size as the field and, on GCC and Clang, that
the types are compatible.  It also adds a version that does not check,
for the one case where (currently) we deliberately read the wrong size,
and updates a few uses to use more precise field names.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Reviewed-by: Yifeng Sun <pkusunyifeng at gmail.com>
Reviewed-by: Armando Migliaccio <armamig at gmail.com>


  Commit: 1dc1ec247e2a7fe126f9c8232a3d42521a8d8291
      https://github.com/openvswitch/ovs/commit/1dc1ec247e2a7fe126f9c8232a3d42521a8d8291
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-03-31 (Sat, 31 Mar 2018)

  Changed paths:
    M include/openvswitch/match.h
    M lib/classifier.c
    M lib/classifier.h
    M lib/flow.h
    M lib/match.c

  Log Message:
  -----------
  flow, match, classifier: Add new functions for miniflow and minimatch.

The miniflow and minimatch APIs lack several of the features of the flow
and match APIs.  This commit adds a few of the missing functions.

These functions will be used for the first time in an upcoming commit.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Reviewed-by: Yifeng Sun <pkusunyifeng at gmail.com>
Reviewed-by: Armando Migliaccio <armamig at gmail.com>


  Commit: 6a6b7060655ed30a5e3307c3a6f26ffb77a2b5be
      https://github.com/openvswitch/ovs/commit/6a6b7060655ed30a5e3307c3a6f26ffb77a2b5be
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-03-31 (Sat, 31 Mar 2018)

  Changed paths:
    M AUTHORS.rst
    M include/openvswitch/ofp-flow.h
    M lib/learn.c
    M lib/learning-switch.c
    M lib/ofp-bundle.c
    M lib/ofp-flow.c
    M ofproto/ofproto-dpif-xlate.c
    M ofproto/ofproto-dpif.c
    M ofproto/ofproto-dpif.h
    M ofproto/ofproto-provider.h
    M ofproto/ofproto.c
    M ovn/controller/ofctrl.c
    M utilities/ovs-ofctl.c

  Log Message:
  -----------
  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 at digitalocean.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Reviewed-by: Armando Migliaccio <armamig at gmail.com>
Tested-by: Armando Migliaccio <armamig at gmail.com>
Reviewed-by: Jan Scheurich <jan.scheurich at ericsson.com>
Tested-by: Jan Scheurich <jan.scheurich at ericsson.com>
Tested-by: Yifeng Sun <pkusunyifeng at gmail.com>
Reviewed-by: Yifeng Sun <pkusunyifeng at gmail.com>


Compare: https://github.com/openvswitch/ovs/compare/3829cad68a7e...6a6b7060655e


More information about the git mailing list