From patchwork Wed Aug 18 05:01:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changli Gao X-Patchwork-Id: 61990 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 BB25EB70DE for ; Wed, 18 Aug 2010 15:01:58 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751427Ab0HRFBx (ORCPT ); Wed, 18 Aug 2010 01:01:53 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:36333 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751297Ab0HRFBw (ORCPT ); Wed, 18 Aug 2010 01:01:52 -0400 Received: by pvg2 with SMTP id 2so56027pvg.19 for ; Tue, 17 Aug 2010 22:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=VFJWyksA63wnU/sgN/+JjDq7+DcaVsT+eWGrBsbFKNQ=; b=gGk0EJJgJbjYBft6H8+IkZ6znuxAUH3l9KpAWpgEnJLYNYOPC454Rvxle+oIyqcFjo oi/+mjHxvDvbi6Ain/wRbZdbkezery50ql3AZIEhDqbgy3drqJXalKV8BYL4/IjBKmnZ yoozb9ZaAJY0Np3sV9syqT5pSoRJk7oHnCSj8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=uIEElc/Bl1plZs/TnSY2t/dF2ffKFgIsNtbBQ31NzekD2KsWg+P//jDl7gFYcz1rp3 QlK8PTsLYPriwH+QYyVn4JdnXcIcDEhjxaMu+sXJOEN45KwID8WnIzcjD1xQxxjm/YTG CoZ1qiaFhYMWM+9mj/GIOg+OlVojzgr+baXt4= Received: by 10.114.131.15 with SMTP id e15mr9025246wad.178.1282107711690; Tue, 17 Aug 2010 22:01:51 -0700 (PDT) Received: from localhost.localdomain ([60.29.39.134]) by mx.google.com with ESMTPS id c24sm15758349wam.7.2010.08.17.22.01.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 17 Aug 2010 22:01:50 -0700 (PDT) From: Changli Gao To: "David S. Miller" Cc: netdev@vger.kernel.org, Changli Gao Subject: [PATCH 2/8] net: rps: skip fragment when computing rxhash Date: Wed, 18 Aug 2010 13:01:38 +0800 Message-Id: <1282107698-3456-1-git-send-email-xiaosuo@gmail.com> X-Mailer: git-send-email 1.7.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fragmented IP packets may have no transfer header, so when computing rxhash, we should skip them. Signed-off-by: Changli Gao Acked-by: Eric Dumazet --- net/core/dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 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/net/core/dev.c b/net/core/dev.c index 3f82781..b7c5309 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2284,7 +2284,10 @@ __u32 __skb_get_rxhash(struct sk_buff *skb) goto done; ip = (struct iphdr *) skb->data + nhoff; - ip_proto = ip->protocol; + if (ip->frag_off & htons(IP_MF|IP_OFFSET)) + ip_proto = 0; + else + ip_proto = ip->protocol; addr1 = (__force u32) ip->saddr; addr2 = (__force u32) ip->daddr; ihl = ip->ihl;