Skip to contentSkip to conversation

xen-netfront: convert to GRO API

PATCH Applied Wei Liu 4 participants 7 messages Sep 30, 2013 – Oct 2, 2013

Subsystems (3)
lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 xen-netfront: convert to GRO API

Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.

Cc Anirban Chakraborty <[email protected]>
Cc Ian Campbell <[email protected]>
---
 drivers/net/xen-netfront.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/xen-netfront.c +3 -1
index 36808bf..dd1011e 100644
@@ -952,7 +952,7 @@ static int handle_incoming_queue(struct net_device *dev,
 		u64_stats_update_end(&stats->syncp);
 
 		/* Pass it up. */
-		netif_receive_skb(skb);
+		napi_gro_receive(&np->napi, skb);
 	}
 
 	return packets_dropped;
@@ -1051,6 +1051,8 @@ err:
 	if (work_done < budget) {
 		int more_to_do = 0;
 
+		napi_gro_flush(napi, false);
+
 		local_irq_save(flags);
 
 		RING_FINAL_CHECK_FOR_RESPONSES(&np->rx, more_to_do);
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Wei Liu

Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.

Cc Anirban Chakraborty <[email protected]>
Quoted 27 lines
---
 drivers/net/xen-netfront.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/xen-netfront.c +3 -1
index 36808bf..dd1011e 100644
@@ -952,7 +952,7 @@ static int handle_incoming_queue(struct net_device *dev,
 		u64_stats_update_end(&stats->syncp);
 
 		/* Pass it up. */
-		netif_receive_skb(skb);
+		napi_gro_receive(&np->napi, skb);
 	}
 
 	return packets_dropped;
@@ -1051,6 +1051,8 @@ err:
 	if (work_done < budget) {
 		int more_to_do = 0;
 
+		napi_gro_flush(napi, false);
+
 		local_irq_save(flags);
 
 		RING_FINAL_CHECK_FOR_RESPONSES(&np->rx, more_to_do);
Acked-by on v1 1/1
#2 lore raw
In reply to Wei Liu
Quoted 6 lines · Wei Liu

Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.

Cc Anirban Chakraborty <[email protected]>
Quoted 27 lines
---
 drivers/net/xen-netfront.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/xen-netfront.c +3 -1
index 36808bf..dd1011e 100644
@@ -952,7 +952,7 @@ static int handle_incoming_queue(struct net_device *dev,
 		u64_stats_update_end(&stats->syncp);
 
 		/* Pass it up. */
-		netif_receive_skb(skb);
+		napi_gro_receive(&np->napi, skb);
 	}
 
 	return packets_dropped;
@@ -1051,6 +1051,8 @@ err:
 	if (work_done < budget) {
 		int more_to_do = 0;
 
+		napi_gro_flush(napi, false);
+
 		local_irq_save(flags);
 
 		RING_FINAL_CHECK_FOR_RESPONSES(&np->rx, more_to_do);
#3 lore raw
Quoted 32 lines · Ian Campbell
Quoted 6 lines · Wei Liu

Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.

Cc Anirban Chakraborty <[email protected]>
Quoted 22 lines

---
drivers/net/xen-netfront.c | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/xen-netfront.c +1 -1
index 36808bf..dd1011e 100644
@@ -952,7 +952,7 @@ static int handle_incoming_queue(struct net_device *dev,
 		u64_stats_update_end(&stats->syncp);
 
 		/* Pass it up. */
-		netif_receive_skb(skb);
+		napi_gro_receive(&np->napi, skb);
 	}
 
 	return packets_dropped;
@@ -1051,6 +1051,8 @@ err:
 	if (work_done < budget) {
 		int more_to_do = 0;
 
Quoted 6 lines

drivers/net/xen-netfront.c err: · line 1058

Quoted 5 lines
drivers/net/xen-netfront.c +2 -0
+		napi_gro_flush(napi, false);
+
 		local_irq_save(flags);
 
 		RING_FINAL_CHECK_FOR_RESPONSES(&np->rx, more_to_do);

We should apply it to stable as well. Thanks.
Anirban

#4 lore raw
In reply to Ian Campbell
Quoted 32 lines · Ian Campbell
Quoted 6 lines · Wei Liu

Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.

Cc Anirban Chakraborty <[email protected]>
Quoted 22 lines

---
drivers/net/xen-netfront.c | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/xen-netfront.c +1 -1
index 36808bf..dd1011e 100644
@@ -952,7 +952,7 @@ static int handle_incoming_queue(struct net_device *dev,
 		u64_stats_update_end(&stats->syncp);
 
 		/* Pass it up. */
-		netif_receive_skb(skb);
+		napi_gro_receive(&np->napi, skb);
 	}
 
 	return packets_dropped;
@@ -1051,6 +1051,8 @@ err:
 	if (work_done < budget) {
 		int more_to_do = 0;
 
Quoted 6 lines

drivers/net/xen-netfront.c err: · line 1058

Quoted 5 lines
drivers/net/xen-netfront.c +2 -0
+		napi_gro_flush(napi, false);
+
 		local_irq_save(flags);
 
 		RING_FINAL_CHECK_FOR_RESPONSES(&np->rx, more_to_do);

We should apply it to stable as well. Thanks.
Anirban

maintainer Applied
#5 lore raw
In reply to Wei Liu

From: Wei Liu <[email protected]>
Date: Mon, 30 Sep 2013 13:46:34 +0100

Quoted 8 lines

Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.

Cc Anirban Chakraborty <[email protected]>
Cc Ian Campbell <[email protected]>

Applied, to net-next.

Anirban suggested to queue this to -stable but that is absolutely not appropriate so I'm not doing that.

maintainer Applied
#6 lore raw
In reply to Wei Liu

From: Wei Liu <[email protected]>
Date: Mon, 30 Sep 2013 13:46:34 +0100

Quoted 8 lines

Anirban was seeing netfront received MTU size packets, which downgraded throughput. The following patch makes netfront use GRO API which improves throughput for that case.

Cc Anirban Chakraborty <[email protected]>
Cc Ian Campbell <[email protected]>

Applied, to net-next.

Anirban suggested to queue this to -stable but that is absolutely not appropriate so I'm not doing that.