Thread (6 messages) 6 messages, 3 authors, 2016-06-02
STALE3771d

[net-next PATCH 2/2] tun: Configure Rx queues to default to RPS enabled

From: Alexander Duyck <hidden>
Date: 2016-06-02 01:17:26
Subsystem: networking drivers, the rest, tun/tap driver · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds, Willem de Bruijn, Jason Wang

This patch enables tun/tap interfaces to use RPS by default.  The
motivation behind this is to address the fact that the interfaces are
currently using netif_rx_ni which in turn will queue packets on whatever
CPU the function is called on, and when combined with load balancing this
can result in packets being received out of order.

Signed-off-by: Alexander Duyck <redacted>
---
 drivers/net/tun.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index e16487cc6a9a..51555daaa6e4 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -646,7 +646,6 @@ static int tun_attach(struct tun_struct *tun, struct file *file, bool skip_filte
 	tfile->socket.sk->sk_shutdown &= ~RCV_SHUTDOWN;
 	rcu_assign_pointer(tfile->tun, tun);
 	rcu_assign_pointer(tun->tfiles[tun->numqueues], tfile);
-	tun->numqueues++;
 
 	if (tfile->detached)
 		tun_enable_queue(tfile);
@@ -655,6 +654,9 @@ static int tun_attach(struct tun_struct *tun, struct file *file, bool skip_filte
 
 	tun_set_real_num_queues(tun);
 
+	netif_set_rps_cpus(tun->dev, cpu_online_mask, tun->numqueues);
+	tun->numqueues++;
+
 	/* device is allowed to go away first, so no need to hold extra
 	 * refcnt.
 	 */
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help