From: Herbert Xu Date: Tue, 26 May 2009 18:50:24 +0000 (+0000) Subject: tcp: Optimise GRO port comparisons X-Git-Tag: v2.6.31-rc1~330^2~256 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=745898eaf0eb7a04a56dec1188d9148259510863;p=~shefty%2Frdma-dev.git tcp: Optimise GRO port comparisons Instead of doing two 16-bit operations for the source/destination ports, we can do one 32-bit operation to take care both. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 7a0f0b27bf1..ff6adecc54c 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2544,7 +2544,7 @@ struct sk_buff **tcp_gro_receive(struct sk_buff **head, struct sk_buff *skb) th2 = tcp_hdr(p); - if ((th->source ^ th2->source) | (th->dest ^ th2->dest)) { + if (*(u32 *)&th->source ^ *(u32 *)&th2->source) { NAPI_GRO_CB(p)->same_flow = 0; continue; }