[ovs-git] [openvswitch/ovs] ae7ad0: dpif-netdev: Rework of rx queue management.

GitHub noreply at github.com
Wed Jan 27 05:04:51 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: ae7ad0a15ef5c9c045419e1dbcfb7b98b05c7b5a
      https://github.com/openvswitch/ovs/commit/ae7ad0a15ef5c9c045419e1dbcfb7b98b05c7b5a
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2016-01-26 (Tue, 26 Jan 2016)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Rework of rx queue management.

Current rx queue management model is buggy and will not work properly
without additional barriers and other syncronization between PMD
threads and main thread.

Known BUGS of current model:
	* While reloading, two PMD threads, one already reloaded and
	  one not yet reloaded, can poll same queue of the same port.
	  This behavior may lead to dpdk driver failure, because they
	  are not thread-safe.
	* Same bug as fixed in commit e4e74c3a2b
	  ("dpif-netdev: Purge all ukeys when reconfigure pmd.") but
	  reproduced while only reconfiguring of pmd threads without
	  restarting, because addition may change the sequence of
	  other ports, which is important in time of reconfiguration.

Introducing the new model, where distribution of queues made by main
thread with minimal synchronizations and without data races between
pmd threads. Also, this model should work faster, because only
needed threads will be interrupted for reconfiguraition and total
computational complexity of reconfiguration is less.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Daniele Di Proietto <diproiettod at vmware.com>


  Commit: 347ba9bb9b7a8e053ced54016f903e749ebecb7f
      https://github.com/openvswitch/ovs/commit/347ba9bb9b7a8e053ced54016f903e749ebecb7f
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2016-01-26 (Tue, 26 Jan 2016)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Unique and sequential tx_qids.

Currently tx_qid is equal to pmd->core_id. This leads to unexpected
behavior if pmd-cpu-mask different from '/(0*)(1|3|7)?(f*)/',
e.g. if core_ids are not sequential, or doesn't start from 0, or both.

Example:
	starting 2 pmd threads with 1 port, 2 rxqs per port,
	pmd-cpu-mask = 00000014 and let dev->real_n_txq = 2

	It that case pmd_1->tx_qid = 2, pmd_2->tx_qid = 4 and
	txq_needs_locking = true (if device hasn't ovs_numa_get_n_cores()+1
	queues).

	In that case, after truncating in netdev_dpdk_send__():
		'qid = qid % dev->real_n_txq;'
	pmd_1: qid = 2 % 2 = 0
	pmd_2: qid = 4 % 2 = 0

	So, both threads will call dpdk_queue_pkts() with same qid = 0.
	This is unexpected behavior if there is 2 tx queues in device.
	Queue #1 will not be used and both threads will lock queue #0
	on each send.

Fix that by using sequential tx_qids.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Daniele Di Proietto <diproiettod at vmware.com>


Compare: https://github.com/openvswitch/ovs/compare/02ab4b1a6a17...347ba9bb9b7a


More information about the git mailing list