[ovs-git] [openvswitch/ovs] 299c8d: dpif-netdev: Convert exit latch to flag.

Ilya Maximets noreply at github.com
Wed Jul 10 12:43:07 UTC 2019


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 299c8d611e927bf688404c6986a043ade52a403b
      https://github.com/openvswitch/ovs/commit/299c8d611e927bf688404c6986a043ade52a403b
  Author: David Marchand <david.marchand at redhat.com>
  Date:   2019-07-10 (Wed, 10 Jul 2019)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Convert exit latch to flag.

No need for a latch here since we don't have to wait.
A simple boolean flag is enough.

The memory order on the reload flag is changed to rel-acq ordering to
serve as a synchronisation point between the pmd threads and the control
thread that asks for termination.

Fixes: e4cfed38b159 ("dpif-netdev: Add poll-mode-device thread.")
Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Eelco Chaudron <echaudro at redhat.com>
Acked-by: Ian Stokes <ian.stokes at intel.com>
Acked-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>


  Commit: 8f077b31e910580db86f2a197c618d079b8f869d
      https://github.com/openvswitch/ovs/commit/8f077b31e910580db86f2a197c618d079b8f869d
  Author: David Marchand <david.marchand at redhat.com>
  Date:   2019-07-10 (Wed, 10 Jul 2019)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Trigger parallel pmd reloads.

pmd reloads are currently serialised in each steps calling
reload_affected_pmds.
Any pmd processing packets, waiting on a mutex etc... will make other
pmd threads wait for a delay that can be undeterministic when syscalls
adds up.

Switch to a little busy loop on the control thread using the existing
per-pmd reload boolean.

The memory order on this atomic is rel-acq to have an explicit
synchronisation between the pmd threads and the control thread.

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Eelco Chaudron <echaudro at redhat.com>
Acked-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>


  Commit: 6d9fead107049d0db4ee269dbee17fc33a4bfa1f
      https://github.com/openvswitch/ovs/commit/6d9fead107049d0db4ee269dbee17fc33a4bfa1f
  Author: David Marchand <david.marchand at redhat.com>
  Date:   2019-07-10 (Wed, 10 Jul 2019)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Do not sleep when swapping queues.

When swapping queues from a pmd thread to another (q0 polled by pmd0/q1
polled by pmd1 -> q1 polled by pmd0/q0 polled by pmd1), the current
"Step 5" puts both pmds to sleep waiting for the control thread to wake
them up later.

Prefer to make them spin in such a case to avoid sleeping an
undeterministic amount of time.

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Eelco Chaudron <echaudro at redhat.com>
Acked-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>


  Commit: e2cafa8692f62afe85acc49f11475ca2756f87b0
      https://github.com/openvswitch/ovs/commit/e2cafa8692f62afe85acc49f11475ca2756f87b0
  Author: David Marchand <david.marchand at redhat.com>
  Date:   2019-07-10 (Wed, 10 Jul 2019)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Only reload static tx qid when needed.

pmd->static_tx_qid is allocated under a mutex by the different pmd
threads.
Unconditionally reallocating it will make those pmd threads sleep
when contention occurs.
During "normal" reloads like for rebalancing queues between pmd threads,
this can make pmd threads waste time on this.
Reallocating the tx qid is only needed when removing other pmd threads
as it is the only situation when the qid pool can become uncontiguous.

Add a flag to instruct the pmd to reload tx qid for this case which is
Step 1 in current code.

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Eelco Chaudron <echaudro at redhat.com>
Acked-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>


  Commit: 68a0625b78cfed6fcc479fc97b024dc28e538ab2
      https://github.com/openvswitch/ovs/commit/68a0625b78cfed6fcc479fc97b024dc28e538ab2
  Author: David Marchand <david.marchand at redhat.com>
  Date:   2019-07-10 (Wed, 10 Jul 2019)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Catch reloads faster.

Looking at the reload flag only every 1024 loops can be a long time
under load, since we might be handling 32 packets per rxq, per iteration,
which means up to poll_cnt * 32 * 1024 packets.
Look at the flag every loop, no major performance impact seen.

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Eelco Chaudron <echaudro at redhat.com>
Acked-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>


  Commit: ec61d4707b440ca03413624d3e88edfc23686883
      https://github.com/openvswitch/ovs/commit/ec61d4707b440ca03413624d3e88edfc23686883
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2019-07-10 (Wed, 10 Jul 2019)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Clarify PMD reloading scheme.

It became more complicated, hence needs to be documented.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>


Compare: https://github.com/openvswitch/ovs/compare/cfc06fb13d9c...ec61d4707b44


More information about the git mailing list