diff mbox

[net-next] xen-netfront: convert to GRO API

Message ID 1380545194-13419-1-git-send-email-wei.liu2@citrix.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Wei Liu Sept. 30, 2013, 12:46 p.m. UTC
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.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Anirban Chakraborty <abchak@juniper.net>
Cc: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Konrad Wilk <konrad.wilk@oracle.com>
---
 drivers/net/xen-netfront.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ian Campbell Sept. 30, 2013, 1:24 p.m. UTC | #1
On Mon, 2013-09-30 at 13:46 +0100, Wei Liu wrote:
> 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.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Cc: Anirban Chakraborty <abchak@juniper.net>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> Acked-by: Konrad Wilk <konrad.wilk@oracle.com>
> ---
>  drivers/net/xen-netfront.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index 36808bf..dd1011e 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -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);


--
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
Anirban Chakraborty Oct. 1, 2013, 8:32 p.m. UTC | #2
On Sep 30, 2013, at 6:24 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:

> On Mon, 2013-09-30 at 13:46 +0100, Wei Liu wrote:
>> 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.
>> 
>> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
>> Cc: Anirban Chakraborty <abchak@juniper.net>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
>> Acked-by: Konrad Wilk <konrad.wilk@oracle.com>
>> ---
>> drivers/net/xen-netfront.c |    4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
>> index 36808bf..dd1011e 100644
>> --- a/drivers/net/xen-netfront.c
>> +++ b/drivers/net/xen-netfront.c
>> @@ -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);
> 

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


--
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
David Miller Oct. 2, 2013, 7:54 p.m. UTC | #3
From: Wei Liu <wei.liu2@citrix.com>
Date: Mon, 30 Sep 2013 13:46:34 +0100

> 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.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Cc: Anirban Chakraborty <abchak@juniper.net>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Acked-by: Konrad Wilk <konrad.wilk@oracle.com>

Applied, to net-next.

Anirban suggested to queue this to -stable but that is absolutely
not appropriate so I'm not doing that.
--
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
diff mbox

Patch

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 36808bf..dd1011e 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -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);