[ovs-git] [openvswitch/ovs] 9554b0: ofp-actions: Fix variable length meta-flow OXMs.

GitHub noreply at github.com
Fri Feb 3 21:35:50 UTC 2017


  Branch: refs/heads/branch-2.7
  Home:   https://github.com/openvswitch/ovs
  Commit: 9554b03d6ab7d720b272863215c36b0e14d93ed0
      https://github.com/openvswitch/ovs/commit/9554b03d6ab7d720b272863215c36b0e14d93ed0
  Author: Yi-Hung Wei <yihung.wei at gmail.com>
  Date:   2017-02-03 (Fri, 03 Feb 2017)

  Changed paths:
    M build-aux/extract-ofp-actions
    M build-aux/extract-ofp-fields
    M include/openvswitch/meta-flow.h
    M include/openvswitch/ofp-actions.h
    M include/openvswitch/ofp-errors.h
    M include/openvswitch/ofp-util.h
    M lib/meta-flow.c
    M lib/nx-match.c
    M lib/nx-match.h
    M lib/ofp-actions.c
    M lib/ofp-print.c
    M lib/ofp-util.c
    M ofproto/ofproto-provider.h
    M ofproto/ofproto.c
    M ovn/controller/pinctrl.c
    M tests/ofproto.at
    M utilities/ovs-ofctl.c

  Log Message:
  -----------
  ofp-actions: Fix variable length meta-flow OXMs.

Previously, if a flow action that involves a tunnel metadata meta-flow
field is dumped from vswitchd, the replied field length in the OXM header
is filled with the maximum possible field length, instead of the length
configured in the tunnel TLV mapping table. To solve this issue, this patch
introduces the following changes.

In order to maintain the correct length of variable length mf_fields (i.e.
tun_metadata), this patch creates a per-switch based map (struct vl_mff_map)
that hosts the variable length mf_fields. This map is updated when a
controller adds/deletes tlv-mapping entries to/from a switch. Although the
per-swtch based vl_mff_map only hosts tun_metadata for now, it is able to
support new variable length mf_fields in the future.

With this commit, when a switch decodes a flow action with mf_field, the switch
firstly looks up the global mf_fields map to identify the mf_field type. For
the variable length mf_fields, the switch uses the vl_mff_map to get the
configured mf_field entries. By lookig up vl_mff_map, the switch can check
if the added flow action access beyond the configured size of a variable
length mf_field, and the switch reports an ofperr if the controller adds a flow
with unmapped variable length mf_field. Later on, when a controller request
flows from the switch, with the per-switch based mf_fields, the switch will
encode the OXM header with correct length for variable length mf_fields.

To use the vl_mff_map for decoding flow actions, extract-ofp-actions is
updated to pass the vl_mff_map to the required action decoding functions.
Also, a new error code is introduced to identify a flow with an invalid
variable length mf_field. Moreover, a testcase is added to prevent future
regressions.

Committer notes:
 - Factor out common code
 - Style fixups
 - Rename OFPERR_NXFMFC_INVALID_VL_MFF -> OFPERR_NXFMFC_INVALID_TLV_FIELD

VMWare-BZ: #1768370
Reported-by: Harold Lim <haroldl at vmware.com>
Suggested-by: Joe Stringer <joe at ovn.org>
Suggested-by: Jarno Rajahalme <jarno at ovn.org>
Signed-off-by: Yi-Hung Wei <yihung.wei at gmail.com>
Signed-off-by: Joe Stringer <joe at ovn.org>




More information about the git mailing list