From patchwork Thu Aug 26 21:31:14 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: 62807 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 A8142B70D0 for ; Fri, 27 Aug 2010 07:38:02 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753001Ab0HZVh6 (ORCPT ); Thu, 26 Aug 2010 17:37:58 -0400 Received: from smtp101.prem.mail.ac4.yahoo.com ([76.13.13.40]:38322 "HELO smtp101.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752737Ab0HZVh5 (ORCPT ); Thu, 26 Aug 2010 17:37:57 -0400 X-Greylist: delayed 399 seconds by postgrey-1.27 at vger.kernel.org; Thu, 26 Aug 2010 17:37:57 EDT Received: (qmail 36821 invoked from network); 26 Aug 2010 21:31:16 -0000 Received: from router.home (cl@99.30.10.212 with plain) by smtp101.prem.mail.ac4.yahoo.com with SMTP; 26 Aug 2010 14:31:15 -0700 PDT X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- X-YMail-OSG: NWuQd8kVM1n7X700oIZdgyjW5t736OWYGaqQ9zYMWg3EZiD .A51hHstLIsIySc08buH6pwuPu1CYz1TgcZ6fMyrr_BtNCw0A6jKieMWYBRt UN50iBswTkG7xVZtuCGReuc_ZKdZ0ujqePywAzIZvuKCJubojYf8jzAWs3t4 7sFOnDBi5aC9hdPVtA1Tl4N16A6tMkh2hrSqoPB5ZV0_25hOe1DsMGDs7KZj MEpcOk.sItXZm58q3FKHKq9s7ffiqNdGuNGYvDX0PPdScFpMLkzO9osrKOKb mig-- X-Yahoo-Newman-Property: ymail-3 Received: from cl (helo=localhost) by router.home with local-esmtp (Exim 4.71) (envelope-from ) id 1Ook2V-0006P1-Ba; Thu, 26 Aug 2010 16:31:15 -0500 Date: Thu, 26 Aug 2010 16:31:14 -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 , netdev@vger.kernel.org Subject: [IPoIB] Identify multicast packets and fix IGMP breakage V2 In-Reply-To: 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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Is this better? Subject: [IPoIB] Identify Multicast packets and fix IGMP breakage V2 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 --- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 10 +++++++--- include/linux/in6.h | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) -- 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 15:11:34.000000000 -0500 +++ linux-2.6/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2010-08-26 16:29:19.000000000 -0500 @@ -271,6 +271,13 @@ static void ipoib_ib_handle_rx_wc(struct ipoib_ud_dma_unmap_rx(priv, mapping); ipoib_ud_skb_put_frags(priv, skb, wc->byte_len); + if ((wc->wc_flags & IB_WC_GRH) && + IN6_IS_ADDR_MULTICAST(&((struct ipv6hdr *)skb->data)->daddr)) + + 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 +288,6 @@ static void ipoib_ib_handle_rx_wc(struct 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 15:11:34.000000000 -0500 +++ linux-2.6/include/linux/in6.h 2010-08-26 16:27:08.000000000 -0500 @@ -53,6 +53,9 @@ extern const struct in6_addr in6addr_lin 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) ((a)->in6_u.u6_addr8[0] == 0xff) + #endif struct sockaddr_in6 {