[ovs-git] [openvswitch/ovs] 350507: dpif-netdev: Fix flow modification after failure.

elibritstein noreply at github.com
Mon Aug 2 19:52:43 UTC 2021


  Branch: refs/heads/branch-2.13
  Home:   https://github.com/openvswitch/ovs
  Commit: 350507b1633ee8fa50f42bcd7f26881cf995cb2e
      https://github.com/openvswitch/ovs/commit/350507b1633ee8fa50f42bcd7f26881cf995cb2e
  Author: Eli Britstein <elibr at nvidia.com>
  Date:   2021-08-02 (Mon, 02 Aug 2021)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Fix flow modification after failure.

dp_netdev_flow_offload_main thread is asynchronous, by the cited commit.
There might be a case where there are modification requests of the same
flow submitted before handled. Then, if the first handling fails, the
rule for the flow is deleted, and the mark is freed. Then, the following
one should not be handled as a modification, but rather as an "add".

Fixes: 02bb2824e51d ("dpif-netdev: do hw flow offload in a thread")
Signed-off-by: Eli Britstein <elibr at nvidia.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: f7e3b47e09af7aa77c922fdb70ff0bb39551671b
      https://github.com/openvswitch/ovs/commit/f7e3b47e09af7aa77c922fdb70ff0bb39551671b
  Author: Eli Britstein <elibr at nvidia.com>
  Date:   2021-08-02 (Mon, 02 Aug 2021)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Fix offloads of modified flows.

Association of a mark to a flow is done as part of its offload handling,
in the offloading thread. However, the PMD thread specifies whether an
offload request is an "add" or "modify" by the association of a mark to
the flow.
This is exposed to a race condition. A flow might be created with
actions that cannot be fully offloaded, for example flooding (before MAC
learning), and later modified to have actions that can be fully
offloaded. If the two requests are queued before the offload thread
handling, they are both marked as "add". When the offload thread handles
them, the first request is partially offloaded, and the second one is
ignored as the flow is already considered as offloaded.

Fix it by specifying add/modify of an offload request by the actual flow
state change, without relying on the mark.

Fixes: 3c7330ebf036 ("netdev-offload-dpdk: Support offload of output action.")
Signed-off-by: Eli Britstein <elibr at nvidia.com>
Reviewed-by: Gaetan Rivet <gaetanr at nvidia.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/f92ce92e53eb...f7e3b47e09af


More information about the git mailing list