when virtio pmd starts, a virtio-func named modern_setup_queue will set rxq num to hw. let's suppose 4 rxqs in hw-virtio. but a dpdk-process starts use only 2 rxqs, however hw doesn't aware this, pkts will send to 4 rxqs all the same, but dpdk-process would only poll 2 rxqs which result to a pkts loss. cuz the pkts send to the other 2 unused rxqs will never be consumed.
Created attachment 236 [details] write queue register is always the same as you can see,dpdk now always write 'max_queue_pairs' into hw, so hw will send to pkts to all rxq, but users may use only part of them which lead to a pkt loss
is there anybody could help me to confirm it?
this case happend when I set tx-queue and rx-queue respectively(tx-queues not equals to rx-queues). maybe not a bug, that's to say virtio only support queue pairs(tx-queues must equal to rx-queues)
/*Notify the backend *Otherwise the tap backend might already stop its queue due to fullness. *vhost backend will have no chance to be waked up */ nb_queues = RTE_MAX(dev->data->nb_rx_queues, dev->data->nb_tx_queues); if (hw->max_queue_pairs > 1) { if (virtio_set_multiple_queues(dev, nb_queues) != 0) return -EINVAL; } dpdk-virtio chose the RTE_MAX between nb_rx_queues and nb_tx_queues. however user may set nb_rx_queues to 1, and set nb_tx_queues to 2. this case dpdk-virtio notify the backend we use 2 queue-pairs. actually user only use rx-queue1, but packets will send to rx-queue1 and rx-queue2 by backend