From patchwork Thu Aug 26 19:55:27 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: 135841 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o7QJtWJ0025485 for ; Thu, 26 Aug 2010 19:55:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753971Ab0HZTzc (ORCPT ); Thu, 26 Aug 2010 15:55:32 -0400 Received: from smtp104.prem.mail.ac4.yahoo.com ([76.13.13.43]:29424 "HELO smtp104.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752314Ab0HZTzb (ORCPT ); Thu, 26 Aug 2010 15:55:31 -0400 Received: (qmail 30724 invoked from network); 26 Aug 2010 19:55:28 -0000 Received: from router.home (cl@99.30.10.212 with plain) by smtp104.prem.mail.ac4.yahoo.com with SMTP; 26 Aug 2010 12:55:28 -0700 PDT X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- X-YMail-OSG: IuC7teEVM1l916DHUemC8ClhfqeFpv5yI7uwschEP9PPTWL MZ2M9HVYyC.c29Dday.6T5Do5DslTaMzhckN3AV2KT0FmGMgsiam9lV.c5CF toEwmEZurwkvdhQjB74ScAMy4xiZGcqlxDFiXLPbvXs.PcGWHhyWpNiLHZ8M _DJPT6nqSMtkFfKkFdJT1V0BWmIn8Asl0qUWziUXo4JM37Rl.oPX_9APLkw_ ziJlnsGVNuIBny.YjM8mykmfc1Dp9TuHXWg-- X-Yahoo-Newman-Property: ymail-3 Received: from cl (helo=localhost) by router.home with local-esmtp (Exim 4.71) (envelope-from ) id 1OoiXo-0005wK-4d; Thu, 26 Aug 2010 14:55:28 -0500 Date: Thu, 26 Aug 2010 14:55:27 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@router.home To: Roland Dreier cc: linux-rdma@vger.kernel.org, Or Gerlitz , Jason Gunthorpe , Yossi Etigin Subject: [IPoIB] Identify Multicast packets and fix IGMP breakage In-Reply-To: <20100823183044.GM26549@obsidianresearch.com> Message-ID: References: <20100823174110.GK26549@obsidianresearch.com> <20100823183044.GM26549@obsidianresearch.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 26 Aug 2010 19:55:33 +0000 (UTC) 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 14:11:39.000000000 -0500 +++ linux-2.6/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2010-08-26 14:51:31.000000000 -0500 @@ -271,6 +271,14 @@ ipoib_ud_dma_unmap_rx(priv, mapping); ipoib_ud_skb_put_frags(priv, skb, wc->byte_len); + /* According to Jason Gunthorpe byte 24 in the GRH has the MGID */ + if (IN6_IS_ADDR_MULTICAST(skb->data + 24)) + + skb->pkt_type = PACKET_MULTICAST; + + else + skb->pkt_type = PACKET_HOST; + skb_pull(skb, IB_GRH_BYTES); skb->protocol = ((struct ipoib_header *) skb->data)->proto; @@ -281,9 +289,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; Index: linux-2.6/include/linux/in6.h =================================================================== --- linux-2.6.orig/include/linux/in6.h 2010-08-26 14:11:39.000000000 -0500 +++ linux-2.6/include/linux/in6.h 2010-08-26 14:11:52.000000000 -0500 @@ -53,6 +53,9 @@ extern const struct in6_addr in6addr_linklocal_allrouters; #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } } + +#define IN6_IS_ADDR_MULTICAST(a) (((const __u8 *) (a))[0] == 0xff) + #endif struct sockaddr_in6 {