[ovs-dev] [PATCH v2 00/11] Reconfigure netdev at runtime

Daniele Di Proietto diproiettod at vmware.com
Thu Mar 3 01:33:11 UTC 2016


Currently we treat set_multiq() calls specially in netdev and dpif-netdev:
every pmd thread must be stopped and set_multiq() is allowed to destroy and
recreate the device.

I think we can improve this by:
* Generalizing the mechanism to allow changing other parameters at runtime
  (such as MTU).
* Involving less the above layer (dpif-netdev).  The request for changes
  often comes from below (netdev_dpdk_set_config(), or the vhost new_device()
  callback).  There's no need for dpif-netdev to remember the requested value,
  all that it needs to know is that a configuration change is requested.

This series implements exactly this: a mechanism to allow a netdev provider
to request configuration changes, to which dpif-netdev will respond by
stopping rx/tx and calling a netdev function to appy the new configuration.

The new mechanism is used in this series to replace the set_multiq() call,
but the idea is to use it also at least for:

* Changing the MTU at runtime
* Automatically detecting the number of rx queues for a vhost-user device

The first commits also clean up some code in dpif-netdev and make the ports
cmap fully RCU protected.

v2:
* Fixed do_add_port(): we have to call netdev_reconfigure() before opening
  the rxqs.  This prevents memory leaks, and makes sure that the datapath
  polls the appropriate number of queues
* Fixed netdev_dpdk_vhost_set_multiq(): it must call
  netdev_request_reconfigure(). Since it is now equal to
  netdev_dpdk_set_multiq(), the two function have been merged.
* Fixed netdev_dpdk_set_config(): dev->requested_n_rxq is now accessed
  while holding the appropriate mutex.
* Fixed some outdated comments about rx queue configuration.

Daniele Di Proietto (11):
  dpif-netdev: Proper error handling in do_add_port().
  dpif-netdev: Keep count of elements in port->rxq[].
  dpif-netdev: Do not keep refcount for ports.
  dpif-netdev: Remove useless dpif-dummy/delete-port appctl.
  dpif-netdev: Wait an RCU grace period before freeing ports.
  ofproto-dpif: Call dpif_poll_threads_set() before dpif_run()
  dpif-netdev: Change pmd thread configuration in dpif_netdev_run().
  dpif-netdev: Document locking discipline for non_pmd_mutex.
  dpif-netdev: Fix reconfigure_pmd_threads().
  netdev: Add reconfigure request mechanism.
  netdev-dpdk: Use ->reconfigure() call to change rx/tx queues.

 lib/dpif-netdev.c      | 435 +++++++++++++++++++++++++++----------------------
 lib/dpif-provider.h    |   3 +-
 lib/netdev-bsd.c       |   1 +
 lib/netdev-dpdk.c      | 180 ++++++++++----------
 lib/netdev-dummy.c     |   1 +
 lib/netdev-linux.c     |   1 +
 lib/netdev-provider.h  |  42 +++--
 lib/netdev-vport.c     |   1 +
 lib/netdev.c           |  59 ++++---
 lib/netdev.h           |   7 +-
 ofproto/ofproto-dpif.c |   4 +-
 tests/bridge.at        |   4 +-
 12 files changed, 406 insertions(+), 332 deletions(-)

-- 
2.1.4




More information about the dev mailing list