From: Alexander Duyck <aduyck@mirantis.com>
To: netdev@vger.kernel.org, davem@davemloft.net, alexander.duyck@gmail.com
Subject: [net-next PATCH 2/2] tun: Configure Rx queues to default to RPS enabled
Date: Wed, 01 Jun 2016 18:17:24 -0700 [thread overview]
Message-ID: <20160602011724.9319.15659.stgit@localhost.localdomain> (raw)
In-Reply-To: <20160602010741.9319.56926.stgit@localhost.localdomain>
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 <aduyck@mirantis.com>
---
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.
*/
next prev parent reply other threads:[~2016-06-02 1:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-02 1:17 [net-next PATCH 0/2] Prevent packet reordering on tap/tun interfaces Alexander Duyck
2016-06-02 1:17 ` [net-next PATCH 1/2] net: Add function to allow configuration of RPS Alexander Duyck
2016-06-02 1:23 ` Alexander Duyck
2016-06-02 1:17 ` Alexander Duyck [this message]
2016-06-02 13:12 ` [net-next PATCH 2/2] tun: Configure Rx queues to default to RPS enabled Eric Dumazet
2016-06-02 15:24 ` Alexander Duyck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160602011724.9319.15659.stgit@localhost.localdomain \
--to=aduyck@mirantis.com \
--cc=alexander.duyck@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).