mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
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: 04f48a68c4
("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>
This commit is contained in:
committed by
Joe Stringer
parent
3cddeff01c
commit
5c7c16d896
@@ -954,12 +954,14 @@ enum ofperr ofpacts_pull_openflow_actions(struct ofpbuf *openflow,
|
||||
unsigned int actions_len,
|
||||
enum ofp_version version,
|
||||
const struct vl_mff_map *,
|
||||
uint64_t *ofpacts_tlv_bitmap,
|
||||
struct ofpbuf *ofpacts);
|
||||
enum ofperr
|
||||
ofpacts_pull_openflow_instructions(struct ofpbuf *openflow,
|
||||
unsigned int instructions_len,
|
||||
enum ofp_version version,
|
||||
const struct vl_mff_map *vl_mff_map,
|
||||
uint64_t *ofpacts_tlv_bitmap,
|
||||
struct ofpbuf *ofpacts);
|
||||
enum ofperr ofpacts_check(struct ofpact[], size_t ofpacts_len,
|
||||
struct match *, ofp_port_t max_ports,
|
||||
|
Reference in New Issue
Block a user