mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland Dreier <roland@topspin.com>
To: davem@davemloft.net
Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com,
	openib-general@openib.org
Subject: [PATCH][v5][18/24] IPoIB IPv6 support
Date: Mon, 27 Dec 2004 21:51:15 -0800	[thread overview]
Message-ID: <200412272151.6vXZnyn99yKN3sSD@topspin.com> (raw)
In-Reply-To: <200412272151.qKxQwjb8RXkS5kEQ@topspin.com>

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 <Nitin.Hande@Sun.Com>
Signed-off-by: Roland Dreier <roland@topspin.com>


--- 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 <linux/netdevice.h>
 #include <linux/if_arp.h>
 #include <linux/if_arcnet.h>
+#include <linux/if_infiniband.h>
 #include <linux/route.h>
 #include <linux/inetdevice.h>
 #include <linux/init.h>
@@ -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);


  reply	other threads:[~2004-12-28  6:57 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-28  5:50 [PATCH][v5][0/24] Latest IB patch queue Roland Dreier
2004-12-28  5:50 ` [PATCH][v5][1/24] Add core InfiniBand support (public headers) Roland Dreier
2004-12-28  5:50   ` [PATCH][v5][2/24] Add core InfiniBand support Roland Dreier
2004-12-28  5:50     ` [PATCH][v5][3/24] Hook up drivers/infiniband Roland Dreier
2004-12-28  5:50       ` [PATCH][v5][4/24] Add InfiniBand MAD (management datagram) support (public headers) Roland Dreier
2004-12-28  5:50         ` [PATCH][v5][5/24] Add InfiniBand MAD (management datagram) support Roland Dreier
2004-12-28  5:50           ` [PATCH][v5][6/24] Add InfiniBand MAD (management datagram) support (private headers) Roland Dreier
2004-12-28  5:51             ` [PATCH][v5][7/24] Add InfiniBand MAD SMI support Roland Dreier
2004-12-28  5:51               ` [PATCH][v5][8/24] Add InfiniBand SA (Subnet Administration) query support Roland Dreier
2004-12-28  5:51                 ` [PATCH][v5][9/24] Add Mellanox HCA low-level driver Roland Dreier
2004-12-28  5:51                   ` [PATCH][v5][10/24] Add Mellanox HCA low-level driver (midlayer interface) Roland Dreier
2004-12-28  5:51                     ` [PATCH][v5][11/24] Add Mellanox HCA low-level driver (FW commands) Roland Dreier
2004-12-28  5:51                       ` [PATCH][v5][12/24] Add Mellanox HCA low-level driver (EQ) Roland Dreier
2004-12-28  5:51                         ` [PATCH][v5][13/24] Add Mellanox HCA low-level driver (initialization) Roland Dreier
2004-12-28  5:51                           ` [PATCH][v5][14/24] Add Mellanox HCA low-level driver (QP/CQ) Roland Dreier
2004-12-28  5:51                             ` [PATCH][v5][15/24] Add Mellanox HCA low-level driver (last bits) Roland Dreier
2004-12-28  5:51                               ` [PATCH][v5][16/24] Add Mellanox HCA low-level driver (MAD) Roland Dreier
2004-12-28  5:51                                 ` [PATCH][v5][17/24] IPoIB IPv4 multicast Roland Dreier
2004-12-28  5:51                                   ` Roland Dreier [this message]
2004-12-28  5:51                                     ` [PATCH][v5][19/24] Add IPoIB (IP-over-InfiniBand) driver Roland Dreier
2004-12-28  5:51                                       ` [PATCH][v5][20/24] Add IPoIB multicast & partition code Roland Dreier
2004-12-28  5:51                                         ` [PATCH][v5][21/24] Add InfiniBand userspace MAD support Roland Dreier
2004-12-28  5:51                                           ` [PATCH][v5][22/24] Document InfiniBand ioctl use Roland Dreier
2004-12-28  5:51                                             ` [PATCH][v5][23/24] Add InfiniBand Documentation files Roland Dreier
2004-12-28  5:51                                               ` [PATCH][v5][24/24] InfiniBand MAINTAINERS entry Roland Dreier
2004-12-28  6:54 ` [PATCH][v5][0/24] Latest IB patch queue David S. Miller
2004-12-28 19:48   ` Roland Dreier
2004-12-28 22:17     ` David S. Miller
2004-12-28 23:24       ` Roland Dreier
2004-12-29  1:28         ` Karen Shaeffer
2004-12-29  1:36           ` Roland Dreier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200412272151.6vXZnyn99yKN3sSD@topspin.com \
    --to=roland@topspin.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=openib-general@openib.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®