[ovs-git] [openvswitch/ovs] 549687: netdev: Add function for configuring tx and rx que...

GitHub noreply at github.com
Mon Sep 15 18:44:11 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 5496878cbf52f3819601f7bd925adc06890add9d
      https://github.com/openvswitch/ovs/commit/5496878cbf52f3819601f7bd925adc06890add9d
  Author: Alex Wang <alexw at nicira.com>
  Date:   2014-09-15 (Mon, 15 Sep 2014)

  Changed paths:
    M lib/netdev-bsd.c
    M lib/netdev-dpdk.c
    M lib/netdev-dummy.c
    M lib/netdev-linux.c
    M lib/netdev-provider.h
    M lib/netdev-vport.c
    M lib/netdev.c
    M lib/netdev.h

  Log Message:
  -----------
  netdev: Add function for configuring tx and rx queues.

This commit adds a new API to the 'struct netdev_class' which
allows user to configure the number of tx queues and rx queues
of 'netdev'.  Upcoming patches will use this function to set
multiple tx/rx queues when adding the netdev to dpif-netdev.

Currently, only netdev-dpdk module implements this function.

Signed-off-by: Alex Wang <alexw at nicira.com>
Acked-by: Pravin B Shelar <pshelar at nicira.com>


  Commit: 5a0340647741260c5cc87327e84a13cb851bb1b4
      https://github.com/openvswitch/ovs/commit/5a0340647741260c5cc87327e84a13cb851bb1b4
  Author: Alex Wang <alexw at nicira.com>
  Date:   2014-09-15 (Mon, 15 Sep 2014)

  Changed paths:
    M lib/dpif-netdev.c
    M lib/netdev-dpdk.c

  Log Message:
  -----------
  dpif-netdev: Create multiple tx/rx queues when adding dpdk interface.

Before this commit, ovs creates one tx and one rx queue for
each dpdk interface and uses only one poll thread for handling
I/O of all dpdk interfaces.  An upcoming patch will allow multiple
poll threads be created.  As a preparation, this commit changes
the dpif-netdev to create multiple tx/rx queues when the dpdk
interface is added.

Specifically, the number of rx queues will still be one per-dpdk
interface for this commit.  But upcoming work will allow user
create multiple rx queues.  The number of tx queues will be the
number of cpu cores on the machine.  Although not all the tx queues
will be used, each poll thread will have its own queue for
transmission on the dpdk interface.

Signed-off-by: Alex Wang <alexw at nicira.com>
Acked-by: Pravin B Shelar <pshelar at nicira.com>


  Commit: 94143fc41e7a0a136f2ef9aa9f5126eca83c3ac0
      https://github.com/openvswitch/ovs/commit/94143fc41e7a0a136f2ef9aa9f5126eca83c3ac0
  Author: Alex Wang <alexw at nicira.com>
  Date:   2014-09-15 (Mon, 15 Sep 2014)

  Changed paths:
    M lib/netdev-dpdk.c

  Log Message:
  -----------
  netdev-dpdk: Add indicator for flushing tx queue.

Previous commit makes OVS create one tx queue for each cpu
core.  An upcoming patch will allow multiple pmd threads be
created and pinned to cpu cores.  So each pmd thread will use
the tx queue corresponding to its core id.

Moreover, the pmd threads running on different numa node than
the dpdk interface (called non-local pmd thread) will not
handle the rx of the interface.  Consequently, there need to
be a way to flush the tx queues of the non-local pmd threads.

To address the queue flushing issue, this commit introduces a
new flag 'flush_tx' in the 'struct dpdk_tx_queue' which is
set if the queue is to be used by a non-local pmd thread.
Then, when enqueueing the tx pkts, if the flag is set, the tx
queue will always be flushed immediately after the enqueue.

Signed-off-by: Alex Wang <alexw at nicira.com>
Acked-by: Pravin B Shelar <pshelar at nicira.com>


  Commit: 95a596e3d9137cd482eb23719a10890d0863ef41
      https://github.com/openvswitch/ovs/commit/95a596e3d9137cd482eb23719a10890d0863ef41
  Author: Alex Wang <alexw at nicira.com>
  Date:   2014-09-15 (Mon, 15 Sep 2014)

  Changed paths:
    M lib/netdev-dpdk.c

  Log Message:
  -----------
  netdev-dpdk: Remove the tx queue spinlock.

The previous commit makes OVS create one tx queue for each
cpu core, each pmd thread will use a separate tx queue.
Also, tx of non-pmd threads on dpdk interface is all through
'NON_PMD_THREAD_TX_QUEUE', protected by the 'nonpmd_mempool_mutex'.
Therefore, the spinlock is no longer needed.  And this commit
removes it from 'struct dpdk_tx_queue'.

Signed-off-by: Alex Wang <alexw at nicira.com>
Acked-by: Pravin B Shelar <pshelar at nicira.com>


  Commit: 65f13b50c5aaa9afaef397ee8252647f1ef1688d
      https://github.com/openvswitch/ovs/commit/65f13b50c5aaa9afaef397ee8252647f1ef1688d
  Author: Alex Wang <alexw at nicira.com>
  Date:   2014-09-15 (Mon, 15 Sep 2014)

  Changed paths:
    M lib/dpif-netdev.c
    M lib/dpif-netdev.h
    M lib/netdev-dpdk.c

  Log Message:
  -----------
  dpif-netdev: Create multiple pmd threads by default.

With this commit, ovs by default will create one pmd thread
for each numa node and pin the pmd thread to available cpu
core on the numa node.

NON_PMD_CORE_ID (currently 0) is used to reserve a particular
cpu core for the I/O of all non-pmd threads.  No pmd thread
can be pinned to this reserved core.

As side-effects of this commit:

-  pmd thread will not be created, if there is no dpdk interface
   from the corresponding numa node added to ovs.

- the exact-match cache for non-pmd threads is removed from
  'struct dp_netdev'.  Instead, all non-pmd threads will use
  the exact-match cache defined in the 'struct dp_netdev_pmd_thread'
  for NON_PMD_CORE_ID.

- the rx packet processing functions are refactored to use
  'struct dp_netdev_pmd_thread' as input.

- the 'netdev_send()' function will be called with the proper
  queue id.

- both pmd and non-pmd threads can call the dpif_netdev_execute().
  so, use a per-thread key to help recognize the calling thread.

Signed-off-by: Alex Wang <alexw at nicira.com>
Acked-by: Pravin B Shelar <pshelar at nicira.com>


Compare: https://github.com/openvswitch/ovs/compare/2f9dd77fcd17...65f13b50c5aa


More information about the git mailing list