Skip to content

Commit bf9f6f8

Browse files
nickcooper-zhangtonghaoddiproietto
authored andcommitted
netdev-dummy: Limits the number of tx/rx queues.
This patch avoids the ovs_rcu to report WARN, caused by blocked for a long time, when ovs-vswitchd processes a port with many rx/tx queues. The number of tx/rx queues per port may be appropriate, because the dpdk uses it as an default max value. Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
1 parent ec2b070 commit bf9f6f8

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

lib/netdev-dummy.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,8 @@ netdev_dummy_set_in6(struct netdev *netdev_, struct in6_addr *in6,
827827
return 0;
828828
}
829829

830+
#define DUMMY_MAX_QUEUES_PER_PORT 1024
831+
830832
static int
831833
netdev_dummy_set_config(struct netdev *netdev_, const struct smap *args)
832834
{
@@ -870,6 +872,21 @@ netdev_dummy_set_config(struct netdev *netdev_, const struct smap *args)
870872

871873
new_n_rxq = MAX(smap_get_int(args, "n_rxq", NR_QUEUE), 1);
872874
new_n_txq = MAX(smap_get_int(args, "n_txq", NR_QUEUE), 1);
875+
876+
if (new_n_rxq > DUMMY_MAX_QUEUES_PER_PORT ||
877+
new_n_txq > DUMMY_MAX_QUEUES_PER_PORT) {
878+
VLOG_WARN("The one or both of interface %s queues"
879+
"(rxq: %d, txq: %d) exceed %d. Sets it %d.\n",
880+
netdev_get_name(netdev_),
881+
new_n_rxq,
882+
new_n_txq,
883+
DUMMY_MAX_QUEUES_PER_PORT,
884+
DUMMY_MAX_QUEUES_PER_PORT);
885+
886+
new_n_rxq = MIN(DUMMY_MAX_QUEUES_PER_PORT, new_n_rxq);
887+
new_n_txq = MIN(DUMMY_MAX_QUEUES_PER_PORT, new_n_txq);
888+
}
889+
873890
new_numa_id = smap_get_int(args, "numa_id", 0);
874891
if (new_n_rxq != netdev->requested_n_rxq
875892
|| new_n_txq != netdev->requested_n_txq

0 commit comments

Comments
 (0)