]> git.proxmox.com Git - mirror_ovs.git/commit - lib/ofp-actions.c
ofproto: Add ref counting for variable length mf_fields.
authorYi-Hung Wei <yihung.wei@gmail.com>
Mon, 13 Mar 2017 18:28:21 +0000 (11:28 -0700)
committerJoe Stringer <joe@ovn.org>
Wed, 15 Mar 2017 21:45:40 +0000 (14:45 -0700)
commit5c7c16d896137382783818ebd65af2ff89fc6919
tree3c682b45c1dfe76192e2316ea01341d108aa9982
parent3cddeff01cad5cf61904fed0dcd02e71dacfe3b8
ofproto: Add ref counting for variable length mf_fields.

Currently, a controller may potentially trigger a segmentation fault if it
accidentally removes a TLV mapping that is still used by an active flow.
To resolve this issue, in this patch, we maintain reference counting for each
dynamically allocated variable length mf_fields, so that vswitchd can use this
information to properly remove a TLV mapping, and to return an error if the
controller tries to remove a TLV mapping that is still used by any active flow.

To keep track of the usage of tun_metadata for each flow, two 'uint64_t'
bitmaps are introduce for the flow match and flow action respectively. We use
'uint64_t' as a bitmap since the 64 geneve TLV tunnel metadata are the only
available variable length mf_fields for now. We shall adopt general bitmap when
more variable length mf_fields are introduced. The bitmaps are configured
during the flow decoding process, and vswitchd use these bitmaps to increase or
decrease the ref counting when the flow is created or deleted.

VMWare-BZ: #1768370
Fixes: 04f48a68c428 ("ofp-actions: Fix variable length meta-flow OXMs.")
Suggested-by: Jarno Rajahalme <jarno@ovn.org>
Suggested-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
14 files changed:
build-aux/extract-ofp-actions
include/openvswitch/ofp-actions.h
include/openvswitch/ofp-errors.h
include/openvswitch/ofp-util.h
lib/learn.c
lib/meta-flow.c
lib/ofp-actions.c
lib/ofp-util.c
lib/vl-mff-map.h
ofproto/ofproto-provider.h
ofproto/ofproto.c
ovn/controller/pinctrl.c
tests/tunnel.at
utilities/ovs-ofctl.c