netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: amirv@mellanox.co.il
Cc: Tom Herbert <therbert@google.com>,
	oren@mellanox.co.il, liranl@mellanox.co.il,
	netdev@vger.kernel.org, Diego Crupnicoff <Diego@Mellanox.com>
Subject: Re: RFS issue: no HW filter for paused stream
Date: Wed, 21 Sep 2011 16:09:02 +0100	[thread overview]
Message-ID: <1316617742.2760.18.camel@bwh-desktop> (raw)
In-Reply-To: <4E783855.4020907@dev.mellanox.co.il>

On Tue, 2011-09-20 at 09:53 +0300, Amir Vadai wrote:
> This will unset the current CPU of the rflow that belongs to the desired 
> CPU.
> The problem is when the stream resumes and it goes to the wrong RXQ - in 
> our HW, it will be according to RSS, as long as there is no specific 
> flow steering rule for the stream.

Sorry, yes.  Told you I didn't test my patch!

> We need to unset the current CPU of the rflow of the actual RXQ that the 
> packet arrived at:
[...]
> Or even better, not set it in the first place - but I'm not sure I 
> undersdtand the implications on RPS:
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 4b9981c..748acdb 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2654,7 +2654,7 @@ set_rps_cpu(struct net_device *dev, struct sk_buff 
> *skb,
>   {
>          u16 tcpu;
> 
> -   tcpu = rflow->cpu = next_cpu;
> + tcpu = next_cpu;
>          if (tcpu != RPS_NO_CPU) {
>   #ifdef CONFIG_RFS_ACCEL
>                  struct netdev_rx_queue *rxqueue;
> 
> 

But that means we never move the flow to a new CPU in the non-
accelerated case.  So maybe the proper change would be:

--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2652,10 +2652,7 @@ static struct rps_dev_flow *
 set_rps_cpu(struct net_device *dev, struct sk_buff *skb,
 	    struct rps_dev_flow *rflow, u16 next_cpu)
 {
-	u16 tcpu;
-
-	tcpu = rflow->cpu = next_cpu;
-	if (tcpu != RPS_NO_CPU) {
+	if (next_cpu != RPS_NO_CPU) {
 #ifdef CONFIG_RFS_ACCEL
 		struct netdev_rx_queue *rxqueue;
 		struct rps_dev_flow_table *flow_table;
@@ -2683,16 +2680,16 @@ set_rps_cpu(struct net_device *dev, struct sk_buff *skb,
 			goto out;
 		old_rflow = rflow;
 		rflow = &flow_table->flows[flow_id];
-		rflow->cpu = next_cpu;
 		rflow->filter = rc;
 		if (old_rflow->filter == rflow->filter)
 			old_rflow->filter = RPS_NO_FILTER;
 	out:
 #endif
 		rflow->last_qtail =
-			per_cpu(softnet_data, tcpu).input_queue_head;
+			per_cpu(softnet_data, next_cpu).input_queue_head;
 	}
 
+	rflow->cpu = next_cpu;
 	return rflow;
 }
 
--- END ---

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

  reply	other threads:[~2011-09-21 15:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAP7N4Kfd9TOPr_V6+R9yVtK80eGWbkAvPE8BStG0+WhvJHaLGg@mail.gmail.com>
2011-09-19  6:05 ` RFS issue: no HW filter for paused stream Amir Vadai
2011-09-19 15:13   ` Tom Herbert
2011-09-19 15:52     ` Ben Hutchings
2011-09-20  6:53       ` Amir Vadai
2011-09-21 15:09         ` Ben Hutchings [this message]
2011-09-22  6:11           ` Amir Vadai
2011-09-27 23:42             ` Ben Hutchings
2011-10-02  7:59               ` Amir Vadai

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=1316617742.2760.18.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=Diego@Mellanox.com \
    --cc=amirv@mellanox.co.il \
    --cc=liranl@mellanox.co.il \
    --cc=netdev@vger.kernel.org \
    --cc=oren@mellanox.co.il \
    --cc=therbert@google.com \
    /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).