[openib-general] Re: IPoIB

Hal Rosenstock halr at voltaire.com
Mon Apr 4 17:44:01 PDT 2005


On Mon, 2005-04-04 at 19:37, Roland Dreier wrote:
>     Hal> That's good to hear. There are going to be some other changes
>     Hal> for this.  At a quick glance, ipoib_main.c::ipoib_start_xmit
>     Hal> drops a unicast link level response if it is not ARP. RARP is
>     Hal> also possible there, right ?
> 
> Yeah, you're right.  That check can probably just be deleted.  The
> driver should trust the kernel to pass it packets it means to send.

OK. It does look like unicast_arp_send would work for this case if the
ARP check wasn't made. I'll play with this and propose a patch.

>     Hal> I'm not sure the Linux code above this is set up to support
>     Hal> the larger link level address needed by IPoIB either.
> 
> Not sure what you mean by this.

There are a couple of things that might be problematic but I'm not sure.
The first has to do with some data structures:
include/linux/socket.h:
struct sockaddr {
        sa_family_t     sa_family;      /* address family, AF_xxx      
*/
        char            sa_data[14];    /* 14 bytes of protocol address
*/
};
sa_data is not large enough for the IPoIB hardware address.
Also, similarly for sll_addr in include/linux/if_packet.h:
struct sockaddr_ll
{
...
        unsigned char   sll_halen;
        unsigned char   sll_addr[8];
};

I'm not sure what all the implications of changing these are.

Then, in net/packet/af_packet.c::packet_sendmsg:
        if (saddr == NULL) {
...
        } else {
                err = -EINVAL;
                if (msg->msg_namelen < sizeof(struct sockaddr_ll))
                        goto out;
                ifindex = saddr->sll_ifindex;
                proto   = saddr->sll_protocol;
                addr    = saddr->sll_addr;
        }

-- Hal



More information about the general mailing list