From patchwork Fri Aug 27 13:29:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Christoph Lameter (Ampere)" X-Patchwork-Id: 62853 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 7EFDBB70F7 for ; Fri, 27 Aug 2010 23:29:53 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753278Ab0H0N3m (ORCPT ); Fri, 27 Aug 2010 09:29:42 -0400 Received: from smtp110.prem.mail.ac4.yahoo.com ([76.13.13.93]:21106 "HELO smtp110.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753255Ab0H0N3l (ORCPT ); Fri, 27 Aug 2010 09:29:41 -0400 Received: (qmail 78430 invoked from network); 27 Aug 2010 13:29:40 -0000 Received: from router.home (cl@99.30.10.212 with plain) by smtp110.prem.mail.ac4.yahoo.com with SMTP; 27 Aug 2010 06:29:40 -0700 PDT X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- X-YMail-OSG: dcNuVEAVM1lf2u3NjeCor7sBEJk5iYjdx7_ZU9mg7ztAjz4 qI2oc71sg_4Hxkwy15N79mg_P1gRHTaIM2zzSpqu2p9GoUDimdWk1J2gXYf3 GcRZXyg1Lg6z2jlsB_vfNas8OUKUpCOsbULilEGzTAq85HAbNqqYdDYALwke NL9MajTRPbJlnCMRzpG7iQcQRSDI3pD3FwDD49hJIGEUhknlPAB.UhVA3W6Z 5gaop0vOkmKuNu3Hla0vzi6TLIu42lGE.azPrweWwvm4YVd8bwEX8smhq5HA YNQ-- X-Yahoo-Newman-Property: ymail-3 Received: from cl (helo=localhost) by router.home with local-esmtp (Exim 4.71) (envelope-from ) id 1Ooyzz-0003gZ-QY; Fri, 27 Aug 2010 08:29:39 -0500 Date: Fri, 27 Aug 2010 08:29:38 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@router.home To: Jason Gunthorpe cc: Roland Dreier , linux-rdma@vger.kernel.org, ogerlitz@voltaire.com, yosefe@voltaire.com, netdev@vger.kernel.org, David Miller Subject: Re: [IPoIB] Identify multicast packets and fix IGMP breakage V3 In-Reply-To: <20100826234342.GA24333@obsidianresearch.com> Message-ID: References: <20100826.151553.242147157.davem@davemloft.net> <20100826222146.GA23025@obsidianresearch.com> <20100826234342.GA24333@obsidianresearch.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 26 Aug 2010, Jason Gunthorpe wrote: > I think doing the memcmp only in the multicast path should be > reasonable overhead wise. Ok the dgid is only 8 bytes not the whole 40 bytes.... Here is the patch somewhat cleaned up with PACKET_BROADCAST. Subject: [IPoIB] Identify multicast packets and fix IGMP breakage V3 IGMP processing is broken because the IPOIB does not set the skb->pkt_type the right way for Multicast traffic. All incoming packets are set to PACKET_HOST which means that the igmp_recv() function will ignore the IGMP broadcasts/multicasts. This in turn means that the IGMP timers are firing and are sending information about multicast subscriptions unnecessarily. In a large private network this can cause traffic spikes. Signed-off-by: Christoph Lameter --- -- 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 Index: linux-2.6/drivers/infiniband/ulp/ipoib/ipoib_ib.c =================================================================== --- linux-2.6.orig/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2010-08-26 18:24:07.842079559 -0500 +++ linux-2.6/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2010-08-27 08:26:37.929641162 -0500 @@ -223,6 +223,7 @@ unsigned int wr_id = wc->wr_id & ~IPOIB_OP_RECV; struct sk_buff *skb; u64 mapping[IPOIB_UD_RX_SG]; + union ib_gid *dgid; ipoib_dbg_data(priv, "recv completion: id %d, status: %d\n", wr_id, wc->status); @@ -271,6 +272,21 @@ ipoib_ud_dma_unmap_rx(priv, mapping); ipoib_ud_skb_put_frags(priv, skb, wc->byte_len); + /* First byte of dgid signals multicast when 0xff */ + dgid = &((struct ib_grh *)skb->data)->dgid; + + if (!(wc->wc_flags & IB_WC_GRH) || dgid->raw[0] != 0xff) + + skb->pkt_type = PACKET_HOST; + + else if (memcmp(dgid, dev->broadcast + 4, sizeof(union ib_gid)) == 0) + + skb->pkt_type = PACKET_BROADCAST; + + else + + skb->pkt_type = PACKET_MULTICAST; + skb_pull(skb, IB_GRH_BYTES); skb->protocol = ((struct ipoib_header *) skb->data)->proto; @@ -281,9 +297,6 @@ dev->stats.rx_bytes += skb->len; skb->dev = dev; - /* XXX get correct PACKET_ type here */ - skb->pkt_type = PACKET_HOST; - if (test_bit(IPOIB_FLAG_CSUM, &priv->flags) && likely(wc->csum_ok)) skb->ip_summed = CHECKSUM_UNNECESSARY;