dpif-netdev: Create multiple pmd threads by default.
authorAlex Wang <alexw@nicira.com>
Fri, 5 Sep 2014 21:14:20 +0000 (14:14 -0700)
committerAlex Wang <alexw@nicira.com>
Mon, 15 Sep 2014 18:43:49 +0000 (11:43 -0700)
commit65f13b50c5aaa9afaef397ee8252647f1ef1688d
treef4828b39467a019cc52e80d1f98d918591b99328
parent95a596e3d9137cd482eb23719a10890d0863ef41
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@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
lib/dpif-netdev.c
lib/dpif-netdev.h
lib/netdev-dpdk.c