From patchwork Thu Sep 27 12:48:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 187347 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id ECDDD2C00C4 for ; Thu, 27 Sep 2012 22:48:59 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751877Ab2I0Msz (ORCPT ); Thu, 27 Sep 2012 08:48:55 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:40650 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355Ab2I0Msy (ORCPT ); Thu, 27 Sep 2012 08:48:54 -0400 Received: by bkcjk13 with SMTP id jk13so1706677bkc.19 for ; Thu, 27 Sep 2012 05:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=yVHAGxGStyO4k/YzwMKTCzu4mZjqYviD4pSFN1sfhjY=; b=GYZVSFTJiOKDFldd/AoQq3Oc4T9FwuR+P5MDJPWfW8af4ntpyjo5f9xPFds12I51i4 ffjn+nR75qu4c47omxpjdn6HAY0J6TcMnJ0yoExQPMpQdiONwDb6+ks1iaCV06V/vgtN fy/sfjhsQflUHBj5R/sN2YqwCP+UyRtKCw9XmlqNFovdQDuNwOu9A1hvMTS3OaSnXwnV vicYJiTKXR9n+SP0tp5Wr+8exr1YegId6aqHSn8l84zvCopfeMsIwxJ9XcgVfz3kFt0G JFyX3D2uZA57ygWXqSfRciveReM+mCxURqCyBx+nkb1Lxuh3OzTnPI+n4PSj2ixx2GxF lFSg== Received: by 10.204.151.81 with SMTP id b17mr2086182bkw.95.1348750133656; Thu, 27 Sep 2012 05:48:53 -0700 (PDT) Received: from [172.28.91.115] ([172.28.91.115]) by mx.google.com with ESMTPS id u23sm2908224bks.11.2012.09.27.05.48.51 (version=SSLv3 cipher=OTHER); Thu, 27 Sep 2012 05:48:52 -0700 (PDT) Subject: [PATCH net-next 3/3] ipv4: gre: add GRO capability From: Eric Dumazet To: David Miller Cc: netdev Date: Thu, 27 Sep 2012 14:48:50 +0200 Message-ID: <1348750130.5093.1227.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet Add GRO capability to IPv4 GRE tunnels, using the gro_cells infrastructure. Tested using IPv4 and IPv6 TCP traffic inside this tunnel, and checking GRO is building large packets. Signed-off-by: Eric Dumazet --- include/net/ipip.h | 3 +++ net/ipv4/ip_gre.c | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) -- 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 --git a/include/net/ipip.h b/include/net/ipip.h index a93cf6d..ddc077c 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h @@ -2,6 +2,7 @@ #define __NET_IPIP_H 1 #include +#include #include /* Keep error state on tunnel for 30 sec */ @@ -36,6 +37,8 @@ struct ip_tunnel { #endif struct ip_tunnel_prl_entry __rcu *prl; /* potential router list */ unsigned int prl_count; /* # of entries in PRL */ + + struct gro_cells gro_cells; }; struct ip_tunnel_prl_entry { diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index f233c1d..1f00b30 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -714,8 +714,7 @@ static int ipgre_rcv(struct sk_buff *skb) skb_reset_network_header(skb); ipgre_ecn_decapsulate(iph, skb); - netif_rx(skb); - + gro_cells_receive(&tunnel->gro_cells, skb); rcu_read_unlock(); return 0; } @@ -1296,6 +1295,9 @@ static const struct net_device_ops ipgre_netdev_ops = { static void ipgre_dev_free(struct net_device *dev) { + struct ip_tunnel *tunnel = netdev_priv(dev); + + gro_cells_destroy(&tunnel->gro_cells); free_percpu(dev->tstats); free_netdev(dev); } @@ -1327,6 +1329,7 @@ static int ipgre_tunnel_init(struct net_device *dev) { struct ip_tunnel *tunnel; struct iphdr *iph; + int err; tunnel = netdev_priv(dev); iph = &tunnel->parms.iph; @@ -1353,6 +1356,12 @@ static int ipgre_tunnel_init(struct net_device *dev) if (!dev->tstats) return -ENOMEM; + err = gro_cells_init(&tunnel->gro_cells, dev); + if (err) { + free_percpu(dev->tstats); + return err; + } + return 0; }