This patch uses the new rte_vhost_driver_set_max_queue_num API to set the maximum number of queue pairs supported by the Vhost-user port.
This is required for VDUSE which needs to specify the maximum number of queue pairs at creation time. Without it 128 queue pairs metadata would be allocated. Signed-off-by: Maxime Coquelin <[email protected]> --- lib/netdev-dpdk.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index e454a4a5d..c508f254e 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -2506,6 +2506,9 @@ netdev_dpdk_vhost_client_set_config(struct netdev *netdev, VLOG_INFO("Max Tx retries for vhost device '%s' set to %d", netdev_get_name(netdev), max_tx_retries); } + + dpdk_set_rxq_config(dev, args); + ovs_mutex_unlock(&dev->mutex); return 0; @@ -6298,6 +6301,7 @@ netdev_dpdk_vhost_client_reconfigure(struct netdev *netdev) uint64_t virtio_unsup_features = 0; uint64_t vhost_flags = 0; bool enable_tso; + int nr_qp; enable_tso = userspace_tso_enabled() && dev->virtio_features_state & OVS_VIRTIO_F_CLEAN; @@ -6371,6 +6375,14 @@ netdev_dpdk_vhost_client_reconfigure(struct netdev *netdev) goto unlock; } + nr_qp = MAX(dev->requested_n_rxq, dev->requested_n_txq); + err = rte_vhost_driver_set_max_queue_num(dev->vhost_id, nr_qp); + if (err) { + VLOG_ERR("rte_vhost_driver_set_max_queue_num failed for vhost-user " + "client port: %s\n", dev->up.name); + goto unlock; + } + err = rte_vhost_driver_start(dev->vhost_id); if (err) { VLOG_ERR("rte_vhost_driver_start failed for vhost user " -- 2.46.2 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
