summaryrefslogtreecommitdiff
path: root/lib/netdev-provider.h
diff options
context:
space:
mode:
authorDaniele Di Proietto <diproiettod@vmware.com>2016-02-26 15:58:24 -0800
committerDaniele Di Proietto <diproiettod@vmware.com>2016-05-23 10:27:42 -0700
commit050c60bfb5b4bfb757284f5674904d6931f37269 (patch)
tree45f8ed5f810b0a70bb50d17c75429f8b68b50cf9 /lib/netdev-provider.h
parent790fb3b745d039ec904000a6c64cfc6e16508d9c (diff)
downloadopenvswitch-050c60bfb5b4bfb757284f5674904d6931f37269.tar.gz
netdev-dpdk: Use ->reconfigure() call to change rx/tx queues.
This introduces in dpif-netdev and netdev-dpdk the first use for the newly introduce reconfigure netdev call. When a request to change the number of queues comes, netdev-dpdk will remember this and notify the upper layer via netdev_request_reconfigure(). The datapath, instead of periodically calling netdev_set_multiq(), can detect this and call reconfigure(). This mechanism can also be used to: * Automatically match the number of rxq with the one provided by qemu via the new_device callback. * Provide a way to change the MTU of dpdk devices at runtime. * Move a DPDK vhost device to the proper NUMA socket. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Tested-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Ilya Maximets <i.maximets@samsung.com>
Diffstat (limited to 'lib/netdev-provider.h')
-rw-r--r--lib/netdev-provider.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
index a1ba504a0..be12e7cd7 100644
--- a/lib/netdev-provider.h
+++ b/lib/netdev-provider.h
@@ -67,8 +67,6 @@ struct netdev {
* modify them. */
int n_txq;
int n_rxq;
- /* Number of rx queues requested by user. */
- int requested_n_rxq;
int ref_cnt; /* Times this devices was opened. */
struct shash_node *node; /* Pointer to element in global map. */
struct ovs_list saved_flags_list; /* Contains "struct netdev_saved_flags". */
@@ -300,13 +298,8 @@ struct netdev_class {
* such info, returns NETDEV_NUMA_UNSPEC. */
int (*get_numa_id)(const struct netdev *netdev);
- /* Configures the number of tx queues and rx queues of 'netdev'.
- * Return 0 if successful, otherwise a positive errno value.
- *
- * 'n_rxq' specifies the maximum number of receive queues to create.
- * The netdev provider might choose to create less (e.g. if the hardware
- * supports only a smaller number). The actual number of queues created
- * is stored in the 'netdev->n_rxq' field.
+ /* Configures the number of tx queues of 'netdev'. Returns 0 if successful,
+ * otherwise a positive errno value.
*
* 'n_txq' specifies the exact number of transmission queues to create.
* The caller will call netdev_send() concurrently from 'n_txq' different
@@ -314,12 +307,12 @@ struct netdev_class {
* making sure that these concurrent calls do not create a race condition
* by using multiple hw queues or locking.
*
- * On error, the tx queue and rx queue configuration is indeterminant.
- * Caller should make decision on whether to restore the previous or
- * the default configuration. Also, caller must make sure there is no
- * other thread accessing the queues at the same time. */
- int (*set_multiq)(struct netdev *netdev, unsigned int n_txq,
- unsigned int n_rxq);
+ * The caller will call netdev_reconfigure() (if necessary) before using
+ * netdev_send() on any of the newly configured queues, giving the provider
+ * a chance to adjust its settings.
+ *
+ * On error, the tx queue configuration is unchanged. */
+ int (*set_tx_multiq)(struct netdev *netdev, unsigned int n_txq);
/* Sends buffers on 'netdev'.
* Returns 0 if successful (for every buffer), otherwise a positive errno