Re: [PATCH] rfs: Receive Flow Steering

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Dumazet
Date: Friday, April 2, 2010 - 12:43 pm

Le vendredi 02 avril 2010 à 18:28 +0200, Eric Dumazet a écrit :

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();
 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] rfs: Receive Flow Steering, Tom Herbert, (Thu Apr 1, 8:59 pm)
Re: [PATCH] rfs: Receive Flow Steering, Changli Gao, (Thu Apr 1, 10:04 pm)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 12:29 am)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 12:58 am)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 1:35 am)
Re: [PATCH] rfs: Receive Flow Steering, Changli Gao, (Fri Apr 2, 3:58 am)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 5:01 am)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 5:37 am)
Re: [PATCH] rfs: Receive Flow Steering, Changli Gao, (Fri Apr 2, 6:45 am)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 9:28 am)
Re: [PATCH] rfs: Receive Flow Steering, Rick Jones, (Fri Apr 2, 10:01 am)
Re: [PATCH] rfs: Receive Flow Steering, Rick Jones, (Fri Apr 2, 11:25 am)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 12:43 pm)
Re: [PATCH] rfs: Receive Flow Steering, Changli Gao, (Wed Apr 7, 6:37 pm)