Skip to content

Commit 5cb3230

Browse files
rjarrymaxime-leroy
authored andcommitted
port: force equal queue counts for net_tap and net_virtio
The net_tap and net_virtio drivers require equal RX and TX queue counts. Set TX queue count to match RX queues for these drivers. This may result in fewer TX queues than workers, which is now handled by the TX queue sharing support. Signed-off-by: Robin Jarry <rjarry@redhat.com>
1 parent 8481f1a commit 5cb3230

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

modules/infra/control/port.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,12 @@ int port_configure(struct iface_info_port *p, uint16_t n_txq_min) {
103103
// cap number of queues to device maximum
104104
p->n_txq = RTE_MIN(n_txq_min, info.max_tx_queues);
105105

106-
if (strcmp(info.driver_name, "net_tap") == 0) {
107-
p->n_txq = RTE_MAX(p->n_txq, p->n_rxq);
108-
p->n_rxq = p->n_txq;
106+
if (strcmp(info.driver_name, "net_tap") == 0
107+
|| strcmp(info.driver_name, "net_virtio") == 0) {
108+
// force number of TX queues equal to requested RX queues
109+
p->n_txq = p->n_rxq;
110+
if (p->n_txq > info.max_tx_queues)
111+
return errno_set(EOVERFLOW);
109112
}
110113

111114
if (p->n_txq < n_txq_min)

0 commit comments

Comments
 (0)