[openib-general] Re: [openib-commits] r894 - gen2/branches/roland-merge/src/linux-kernel/infiniband/ulp/ipoib

Hal Rosenstock halr at voltaire.com
Tue Sep 28 07:16:57 PDT 2004


On Mon, 2004-09-27 at 15:17, Roland Dreier wrote:
> I think I've done all the straightforward work on IPoIB now.  We can
> try to figure out how to make it a "native" driver now (ie use the
> full 20 byte HW address instead of hashing down to 6 bytes, etc).  I
> had some inconclusive discussions on netdev at oss.sgi.com about this
> last week but I still don't know how to do it.

Can you elaborate on the issue ?

The last I saw on this was when you wrote:
> As far as I can tell, the only changes needed would be: 
> implement an ip_ib_mc_map() function and add
> 
>       case ARPHRD_INFINIBAND:
>               ip_ib_mc_map(addr, haddr);
>               return 0;
> 
> to arp_mc_map() in net/ipv4/arp.c and to make the analogous addition
> for ndisc_mc_map() in net/ipv6/ndisc.c.  

Here's a cut at the mapping:

    |   8    |  4 |  4 |     16 bits     | 16 bits |      80 bits      |
    +------ -+----+----+-----------------+---------+-------------------+
    |11111111|0001|scop|<IPoIB signature>|< P_Key >|      group ID     |
    +--------+----+----+-----------------+---------+-------------------+
                                

    |   8    |  4 |  4 |     16 bits    | 16 bits | 48 bits  | 32 bits |
    +--------+----+----+----------------+---------+----------+---------+
    |11111111|0001|scop|0100000000011011|< P_Key >|00.......0|<all 1's>|
    +--------+----+----+----------------+---------+----------+---------+

For IPv6 the lower
    80-bit of the group ID is used directly in the lower 80-bit of the
    MGID. For IPv4, the group ID is only 28-bit long and the rest of the
    bits are filled with 0.


The ib mc_map functions would be defined in include/net/[ip if_inet6].h.
Here's a cut at the one for IPv4 (ip.h):
232,261d231
< /*
<  * Map a multicast IP onto multicast GID for type infiniband.
<  * PKey is added subsequent to this by the ipoib driver.
<  * ipoib driver joins broadcast group itself.
<  */
< 
< static inline void ip_ib_mc_map(u32 addr, char *buf)
< {
<         addr=ntohl(addr);
<       buf[0]=0xFF;
<       buf[1]=0x12; /* link local scope */
<       buf[2]=0x40; /* IPv4 signature */
<       buf[3]=0x1B;
<       buf[4]=0;
<       buf[5]=0;
<       buf[6]=0;
<       buf[7]=0;
<       buf[8]=0;
<       buf[9]=0;
<       buf[10]=0;
<       buf[11]=0;
<       buf[15]=addr&0xFF;
<       addr>>=8;
<       buf[14]=addr&0xFF;
<       addr>>=8;
<       buf[13]=addr&0xFF;
<       addr>>=8;
<       buf[12]=addr&0x0F;
< }
< 

The only issue I see is where the scope and PKey would come from to 
form the MGID. The scope could default to link local (2). Couldn't
the PKey be applied by the driver as it knows the PKey for the IPoIB
interface ? Or is there a problem with delivering this to the proper 
IPoIB interface ?

-- Hal




More information about the general mailing list