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

elibritstein noreply at github.com
Mon Aug 2 19:51:53 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: cd36a34f337298a9dc458ea49a1ef6ae004ef485
      https://github.com/openvswitch/ovs/commit/cd36a34f337298a9dc458ea49a1ef6ae004ef485
  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: 8917010b05f9bc1d3d8f0f6eb326d8ea0855821c
      https://github.com/openvswitch/ovs/commit/8917010b05f9bc1d3d8f0f6eb326d8ea0855821c
  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: Do not flush PMD offloads on reload.

Before flushing offloads of a removed port was supported by [1], it was
necessary to flush the 'marks'. In doing so, all offloads of the PMD are
removed, include the ones that are not related to the removed port and
that are not modified following this removal. As a result such flows are
evicted from being offloaded, and won't resume offloading.

As PMD offload flush is not necessary, avoid it.

[1] 62d1c28e9ce0 ("dpif-netdev: Flush offload rules upon port deletion.")

Signed-off-by: Eli Britstein <elibr at nvidia.com>
Reviewed-by: Gaetan Rivet <gaetanr at nvidia.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>


  Commit: 0d25621e4d9fb50e2e2ddf3332bd7abe90b3e67b
      https://github.com/openvswitch/ovs/commit/0d25621e4d9fb50e2e2ddf3332bd7abe90b3e67b
  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: 6f69e0e30b2385a3146c358f6d1fe29dad9747ea
      https://github.com/openvswitch/ovs/commit/6f69e0e30b2385a3146c358f6d1fe29dad9747ea
  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>


  Commit: e21e9dcec24101648918e49e0b609106048e0850
      https://github.com/openvswitch/ovs/commit/e21e9dcec24101648918e49e0b609106048e0850
  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: Log flow modification in debug level.

Log flow modifications to help debugging.

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/de15afa50f30...e21e9dcec241


More information about the git mailing list