[openfabrics-ewg] [PATCH] enable RDMA CM multicast support on RH4 U4

Or Gerlitz ogerlitz at voltaire.com
Sun Feb 11 06:36:52 PST 2007


Similarily to the network stack, the RDMA CM uses ip_ib_mc_map to map IPv4
IP addresses to IB MGIDs. This function was removed from RHAS4U4 by mistake
however, the RDMA CM multicast code can work well on this system.

Signed-off-by: Or Gerlitz <ogerlitz at voltaire.com>

Index: ofed_1_2/kernel_addons/backport/2.6.9_U4/include/net/ip.h
===================================================================
--- ofed_1_2.orig/kernel_addons/backport/2.6.9_U4/include/net/ip.h	2007-02-11 16:28:55.000000000 +0200
+++ ofed_1_2/kernel_addons/backport/2.6.9_U4/include/net/ip.h	2007-02-11 16:31:54.000000000 +0200
@@ -3,7 +3,42 @@

 #include_next <net/ip.h>

-/* ip_ib_mc_map was removed from RHAS4U4 by mistake */
-#define ip_ib_mc_map ip_tr_mc_map
+/* ip_ib_mc_map was removed from RHAS4U4 by mistake - put here a copy of it
+   to be used by the rdma cm multicast code
+ */
+
+/*
+ *	Map a multicast IP onto multicast MAC for type IP-over-InfiniBand.
+ *	Leave P_Key as 0 to be filled in by driver.
+ */
+
+static inline void ip_ib_mc_map(__be32 naddr, char *buf)
+{
+	__u32 addr;
+	buf[0]  = 0;		/* Reserved */
+	buf[1]  = 0xff;		/* Multicast QPN */
+	buf[2]  = 0xff;
+	buf[3]  = 0xff;
+	addr    = ntohl(naddr);
+	buf[4]  = 0xff;
+	buf[5]  = 0x12;		/* link local scope */
+	buf[6]  = 0x40;		/* IPv4 signature */
+	buf[7]  = 0x1b;
+	buf[8]  = 0;		/* P_Key */
+	buf[9]  = 0;
+	buf[10] = 0;
+	buf[11] = 0;
+	buf[12] = 0;
+	buf[13] = 0;
+	buf[14] = 0;
+	buf[15] = 0;
+	buf[19] = addr & 0xff;
+	addr  >>= 8;
+	buf[18] = addr & 0xff;
+	addr  >>= 8;
+	buf[17] = addr & 0xff;
+	addr  >>= 8;
+	buf[16] = addr & 0x0f;
+}

 #endif




More information about the ewg mailing list