Skip to content

Commit

Permalink
netdev-dpdk: Avoid reconfiguration on VIRTIO_NET_F_MQ changes.
Browse files Browse the repository at this point in the history
At the moment, a malicious guest might negotiate VIRTIO_NET_F_MQ and
!VIRTIO_NET_F_MQ in a loop which would be seen as qp_num going from 1 to
n and n to 1 continuously, triggering datapath reconfigurations at each
transition.

Limit this by only reconfiguring on increased qp_num.
The previous patch reduced the observed cost of polling disabled queues,
so the only cost is memory.

Co-authored-by: Ilya Maximets <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
Signed-off-by: David Marchand <[email protected]>
Acked-by: Kevin Traynor <[email protected]>
Signed-off-by: Ian Stokes <[email protected]>
  • Loading branch information
2 people authored and istokes committed Jun 26, 2019
1 parent 35c9156 commit 7235cd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/netdev-dpdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -3512,8 +3512,8 @@ new_device(int vid)
newnode = dev->socket_id;
}

if (dev->requested_n_txq != qp_num
|| dev->requested_n_rxq != qp_num
if (dev->requested_n_txq < qp_num
|| dev->requested_n_rxq < qp_num
|| dev->requested_socket_id != newnode) {
dev->requested_socket_id = newnode;
dev->requested_n_rxq = qp_num;
Expand Down

0 comments on commit 7235cd2

Please sign in to comment.