Skip to content

Commit 133bbb1

Browse files
wdebruijdavem330
authored andcommitted
virtio-net: per-queue RPS config
On multiqueue network devices, RPS maps are configured independently for each receive queue through /sys/class/net/$DEV/queues/rx-*. On virtio-net currently all packets use the map from rx-0, because the real rx queue is not known at time of map lookup by get_rps_cpu. Call skb_record_rx_queue in the driver rx path to make lookup work. Recording the receive queue has ramifications beyond RPS, such as in sticky load balancing decisions for sockets (skb_tx_hash) and XPS. Reported-by: Mark Hlady <[email protected]> Signed-off-by: Willem de Bruijn <[email protected]> Acked-by: Jason Wang <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5f2939d commit 133bbb1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/virtio_net.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,7 @@ static void receive_buf(struct virtnet_info *vi, struct receive_queue *rq,
10351035
goto frame_err;
10361036
}
10371037

1038+
skb_record_rx_queue(skb, vq2rxq(rq->vq));
10381039
skb->protocol = eth_type_trans(skb, dev);
10391040
pr_debug("Receiving skb proto 0x%04x len %i type %i\n",
10401041
ntohs(skb->protocol), skb->len, skb->pkt_type);

0 commit comments

Comments
 (0)