All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Tom Herbert <therbert@google.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH] rfs: Receive Flow Steering
Date: Fri, 02 Apr 2010 21:43:55 +0200	[thread overview]
Message-ID: <1270237435.2545.4.camel@edumazet-laptop> (raw)
In-Reply-To: <1270225735.11099.20.camel@edumazet-laptop>

Le vendredi 02 avril 2010 à 18:28 +0200, Eric Dumazet a écrit :
> Some more thoughts ...
> 
> Do we really want to call inet_rps_record_flow(sk) from inet_sendmsg() &
> inet_sendpage() ?
> 
> This seems not necessary to me...
> 

I think I get it, you want to catch unidirectional flows (apps that only
send data), and let ACK packets be processed by the sender cpu :=)


I did following patch to remove one conditional branch :

 net/core/dev.c |   20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)


diff --git a/net/core/dev.c b/net/core/dev.c
index 0a9ced8..cfe46d8 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2225,8 +2225,6 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb,
 	u16 tcpu;
 	u32 addr1, addr2, ports, ihl;
 
-	*rflowp = NULL;
-
 	if (skb_rx_queue_recorded(skb)) {
 		u16 index = skb_get_rx_queue(skb);
 		if (unlikely(index >= dev->num_rx_queues)) {
@@ -2443,7 +2441,7 @@ int netif_rx(struct sk_buff *skb)
 {
 	unsigned int qtail;
 #ifdef CONFIG_RPS
-	struct rps_dev_flow *rflow;
+	struct rps_dev_flow voidflow, *rflow = &voidflow;
 	int cpu, err;
 #endif
 
@@ -2461,10 +2459,7 @@ int netif_rx(struct sk_buff *skb)
 	if (cpu < 0)
 		cpu = smp_processor_id();
 
-	err = enqueue_to_backlog(skb, cpu, &qtail);
-
-	if (rflow)
-		rflow->last_qtail = qtail;
+	err = enqueue_to_backlog(skb, cpu, &rflow->last_qtail);
 
 	rcu_read_unlock();
 
@@ -2839,7 +2834,7 @@ out:
 int netif_receive_skb(struct sk_buff *skb)
 {
 #ifdef CONFIG_RPS
-	struct rps_dev_flow *rflow;
+	struct rps_dev_flow voidflow, *rflow = &voidflow;
 	int cpu, err;
 
 	rcu_read_lock();
@@ -2848,13 +2843,8 @@ int netif_receive_skb(struct sk_buff *skb)
 
 	if (cpu < 0)
 		err = __netif_receive_skb(skb);
-	else {
-		unsigned int qtail;
-
-		err = enqueue_to_backlog(skb, cpu, &qtail);
-		if (rflow)
-			rflow->last_qtail = qtail;
-	}
+	else
+		err = enqueue_to_backlog(skb, cpu, &rflow->last_qtail);
 
 	rcu_read_unlock();
 



      reply	other threads:[~2010-04-02 19:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-02  3:59 [PATCH] rfs: Receive Flow Steering Tom Herbert
2010-04-02  5:04 ` Changli Gao
2010-04-02  7:29   ` Eric Dumazet
2010-04-02 10:58     ` Changli Gao
2010-04-02 12:01       ` Eric Dumazet
2010-04-02 13:45         ` Changli Gao
2010-04-02 17:01     ` Rick Jones
     [not found]       ` <g2i65634d661004021045uff7c0e25ge7dfd17929bc9ee9@mail.gmail.com>
2010-04-02 18:25         ` Rick Jones
2010-04-08  1:37           ` Changli Gao
2010-04-02  7:58 ` Eric Dumazet
2010-04-02  8:35 ` Eric Dumazet
2010-04-02 12:37   ` Eric Dumazet
2010-04-02 16:28     ` Eric Dumazet
2010-04-02 19:43       ` Eric Dumazet [this message]

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=1270237435.2545.4.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.