Re: [1/2] ipv6: Add GRO support

Previous thread: [PATCH] net: reset network device counters on the fly by Huascar Tejeda on Tuesday, January 6, 2009 - 7:08 pm. (5 messages)

Next thread: RFC: Network privilege separation. by Michael Stone on Tuesday, January 6, 2009 - 10:48 pm. (36 messages)
From: Herbert Xu
Date: Tuesday, January 6, 2009 - 8:14 pm

Hi Dave:

Give an inch and take a mile, parity with LRO just isn't enough :)
I've tested it locally and it does work.

ipv6: Add GRO support

This patch adds GRO support for IPv6.  IPv6 GRO supports extension
headers in the same way as GSO (by using the same infrastructure).
It's also simpler compared to IPv4 since we no longer have to worry
about fragmentation attributes or header checksums.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/include/net/protocol.h b/include/net/protocol.h
index cb2965a..ffa5b8b 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -59,6 +59,9 @@ struct inet6_protocol
 	int	(*gso_send_check)(struct sk_buff *skb);
 	struct sk_buff *(*gso_segment)(struct sk_buff *skb,
 				       int features);
+	struct sk_buff **(*gro_receive)(struct sk_buff **head,
+					struct sk_buff *skb);
+	int	(*gro_complete)(struct sk_buff *skb);
 
 	unsigned int	flags;	/* INET6_PROTO_xxx */
 };
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 437b750..94f74f5 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -672,8 +672,7 @@ int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb)
 
 EXPORT_SYMBOL_GPL(ipv6_opt_accepted);
 
-static struct inet6_protocol *ipv6_gso_pull_exthdrs(struct sk_buff *skb,
-						    int proto)
+static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto)
 {
 	struct inet6_protocol *ops = NULL;
 
@@ -704,7 +703,7 @@ static struct inet6_protocol *ipv6_gso_pull_exthdrs(struct sk_buff *skb,
 		__skb_pull(skb, len);
 	}
 
-	return ops;
+	return proto;
 }
 
 static int ipv6_gso_send_check(struct sk_buff *skb)
@@ -721,7 +720,9 @@ static int ipv6_gso_send_check(struct sk_buff *skb)
 	err = -EPROTONOSUPPORT;
 
 	rcu_read_lock();
-	ops = ipv6_gso_pull_exthdrs(skb, ipv6h->nexthdr);
+	ops = rcu_dereference(inet6_protos[
+		ipv6_gso_pull_exthdrs(skb, ipv6h->nexthdr)]);
+
 	if (likely(ops && ops->gso_send_check)) {
 		skb_reset_transport_header(skb);
 		err = ...
From: Herbert Xu
Date: Tuesday, January 6, 2009 - 8:15 pm

[Empty message]
From: David Miller
Date: Thursday, January 8, 2009 - 11:41 am

From: Herbert Xu <herbert@gondor.apana.org.au>

Applied.
--

From: David Miller
Date: Thursday, January 8, 2009 - 11:41 am

From: Herbert Xu <herbert@gondor.apana.org.au>

Applied.
--

Previous thread: [PATCH] net: reset network device counters on the fly by Huascar Tejeda on Tuesday, January 6, 2009 - 7:08 pm. (5 messages)

Next thread: RFC: Network privilege separation. by Michael Stone on Tuesday, January 6, 2009 - 10:48 pm. (36 messages)