From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262114AbUL1G5M (ORCPT ); Tue, 28 Dec 2004 01:57:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262094AbUL1G43 (ORCPT ); Tue, 28 Dec 2004 01:56:29 -0500 Received: from umhlanga.stratnet.net ([12.162.17.40]:52561 "EHLO umhlanga.STRATNET.NET") by vger.kernel.org with ESMTP id S262095AbUL1Fxv (ORCPT ); Tue, 28 Dec 2004 00:53:51 -0500 Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, openib-general@openib.org In-Reply-To: <200412272151.qKxQwjb8RXkS5kEQ@topspin.com> X-Mailer: Roland's Patchbomber Date: Mon, 27 Dec 2004 21:51:15 -0800 Message-Id: <200412272151.6vXZnyn99yKN3sSD@topspin.com> Mime-Version: 1.0 To: davem@davemloft.net From: Roland Dreier X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: roland@topspin.com Subject: [PATCH][v5][18/24] IPoIB IPv6 support Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-SA-Exim-Version: 4.1 (built Tue, 17 Aug 2004 11:06:07 +0200) X-SA-Exim-Scanned: Yes (on eddore) X-OriginalArrivalTime: 28 Dec 2004 05:51:15.0595 (UTC) FILETIME=[3E8415B0:01C4ECA1] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Add ipv6_ib_mc_map() to convert IPv6 multicast addresses to IPoIB hardware addresses, and add support for autoconfiguration for devices with type ARPHRD_INFINIBAND. The mapping for multicast addresses is described in http://www.ietf.org/internet-drafts/draft-ietf-ipoib-ip-over-infiniband-08.txt Signed-off-by: Nitin Hande Signed-off-by: Roland Dreier --- linux-bk.orig/include/net/if_inet6.h 2004-12-27 21:47:59.669014924 -0800 +++ linux-bk/include/net/if_inet6.h 2004-12-27 21:48:24.976289805 -0800 @@ -266,5 +266,20 @@ { buf[0] = 0x00; } + +static inline void ipv6_ib_mc_map(struct in6_addr *addr, char *buf) +{ + buf[0] = 0; /* Reserved */ + buf[1] = 0xff; /* Multicast QPN */ + buf[2] = 0xff; + buf[3] = 0xff; + buf[4] = 0xff; + buf[5] = 0x12; /* link local scope */ + buf[6] = 0x60; /* IPv6 signature */ + buf[7] = 0x1b; + buf[8] = 0; /* P_Key */ + buf[9] = 0; + memcpy(buf + 10, addr->s6_addr + 6, 10); +} #endif #endif --- linux-bk.orig/net/ipv6/addrconf.c 2004-12-27 21:47:59.159089982 -0800 +++ linux-bk/net/ipv6/addrconf.c 2004-12-27 21:48:24.978289511 -0800 @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -1095,6 +1096,12 @@ memset(eui, 0, 7); eui[7] = *(u8*)dev->dev_addr; return 0; + case ARPHRD_INFINIBAND: + if (dev->addr_len != INFINIBAND_ALEN) + return -1; + memcpy(eui, dev->dev_addr + 12, 8); + eui[0] |= 2; + return 0; } return -1; } @@ -1794,7 +1801,8 @@ if ((dev->type != ARPHRD_ETHER) && (dev->type != ARPHRD_FDDI) && (dev->type != ARPHRD_IEEE802_TR) && - (dev->type != ARPHRD_ARCNET)) { + (dev->type != ARPHRD_ARCNET) && + (dev->type != ARPHRD_INFINIBAND)) { /* Alas, we support only Ethernet autoconfiguration. */ return; } --- linux-bk.orig/net/ipv6/ndisc.c 2004-12-27 21:47:44.031316692 -0800 +++ linux-bk/net/ipv6/ndisc.c 2004-12-27 21:48:24.979289364 -0800 @@ -260,6 +260,9 @@ case ARPHRD_ARCNET: ipv6_arcnet_mc_map(addr, buf); return 0; + case ARPHRD_INFINIBAND: + ipv6_ib_mc_map(addr, buf); + return 0; default: if (dir) { memcpy(buf, dev->broadcast, dev->addr_len);