[ovs-git] [openvswitch/ovs] f05d6d: ofproto-dpif-xlate: Fix continuations with OF inst...

Ben Pfaff noreply at github.com
Thu Jul 22 19:31:25 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: f05d6d623e7054e65f3a8f24e2dfbf8f120764ed
      https://github.com/openvswitch/ovs/commit/f05d6d623e7054e65f3a8f24e2dfbf8f120764ed
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M ofproto/ofproto-dpif-xlate.c
    M tests/nsh.at
    M tests/ofproto-dpif.at

  Log Message:
  -----------
  ofproto-dpif-xlate: Fix continuations with OF instructions in OF1.1+.

Open vSwitch supports OpenFlow "instructions", which were introduced in
OpenFlow 1.1 and act like restricted kinds of actions that can only
appear in a particular order and particular circumstances.  OVS did
not support two of these instructions, "write_metadata" and
"goto_table", properly in the case where they appeared in a flow that
needed to be frozen for continuations.

Both of these instructions had the problem that they couldn't be
properly serialized into the stream of actions, because they're not
actions.  This commit fixes that problem in freeze_unroll_actions()
by converting them into equivalent actions for serialization.

goto_table had the additional problem that it was being serialized to
the frozen stream even after it had been executed.  This was already
properly handled in do_xlate_actions() for resubmit, which is almost
equivalent to goto_table, so this commit applies the same fix to
goto_table.  (The commit removes an assertion from the goto_table
implementation, but there wasn't any real value in that assertion and
I thought the code looked cleaner without it.)

This commit adds tests that would have found these bugs.  This includes
adding a variant of each continuation test that uses OF1.3 for
monitor/resume (which is necessary to trigger these bugs) plus specific
tests for continuations with goto_table and write_metadata.  It also
improves the continuation test infrastructure to add more detail on
the problem if a test fails.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Reported-by: Grayson Wu <wgrayson at vmware.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/213
Discussed-at: https://mail.openvswitch.org/pipermail/ovs-dev/2021-July/386166.html
Acked-by: Ilya Maximets <i.maximets at ovn.org>




More information about the git mailing list