I had to move the check around a bit but the patch now passes our tests. Please merge soon.
Subject: [IPoIB] Identify Multicast packets and fix IGMP breakage 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 <c...@linux.com> --- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 7 +++++-- include/linux/in6.h | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) 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 { -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html