[ovs-git] [openvswitch/ovs] 55db8a: dpif-netdev: Fix non-atomic read of smc_enable_db.

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


  Branch: refs/heads/branch-2.16
  Home:   https://github.com/openvswitch/ovs
  Commit: 55db8af2336f731b40a2ed82193d076515a3fdbc
      https://github.com/openvswitch/ovs/commit/55db8af2336f731b40a2ed82193d076515a3fdbc
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-08-02 (Mon, 02 Aug 2021)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Fix non-atomic read of smc_enable_db.

Atomic variables must be read atomically.  And since we already have
'smc_enable_db' in the PMD context, we need to use it from there to
avoid reading atomically twice.

Also, 'smc_enable_db' is a global configuration, there is no need
to read it per-port or per-rxq.

Fixes: 9ac84a1a3698 ("dpif-avx512: Add ISA implementation of dpif.")
Acked-by: Eelco Chaudron <echaudro at redhat.com>
Acked-by: Cian Ferriter <cian.ferriter at intel.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 053d057145aea95c142326d7e43d2cff02dcc2ee
      https://github.com/openvswitch/ovs/commit/053d057145aea95c142326d7e43d2cff02dcc2ee
  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: c5b30503927fb06221be75991cd2b9620af616c1
      https://github.com/openvswitch/ovs/commit/c5b30503927fb06221be75991cd2b9620af616c1
  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/f4642a3e1ada...c5b30503927f


More information about the git mailing list