[openib-general] some CM/CMA clarfications/questions related to listener impl.

Or Gerlitz ogerlitz at voltaire.com
Thu Jul 27 03:31:05 PDT 2006


Sean,

Does the the code below is what needs to be done by a CMA
consumer to listen on a SID based on <port-space,port> over
all the active IB ports of this node?

What's most important for me now is to understand that the code
below does what i expect, however looking in ib_cm.h and the cma
code while coding the example, one point that i run into was the
granularity the IB CM allows consumers "bind" objects to.

I see that CM IDs are bounded to **device** and not to
<device,port> couple? if indeed, what was the rational?

It means that we don't support a config of a node connected to
two IP subnets each over a different port of the same device,
and two processes, each attempting to listen over the same port,
but with different ip.

Is it as of the CM section of the IB spec saying the CM works with
node guids and this implies we can't support this config?

Or.

void listen_all(void)
{
        struct rdma_cm_id *cma_id;
        struct sockaddr_in addr;
        int rc,rb,rl;
        rc = rb = rl = 1;

        memset(&addr, 0, sizeof addr);

        addr.sin_family = AF_INET;
        addr.sin_port = htons(0x1234);
        addr.sin_addr.s_addr = htonl(INADDR_ANY);

        cma_id = rdma_create_id(cma_handler, NULL, RDMA_PS_TCP);
        if (IS_ERR(cma_id)) {
                rc = PTR_ERR(cma_id);
                goto end;
        }

        rb = rdma_bind_addr(cma_id, (struct sockaddr *)&addr);
        if(rb) goto end;

        rl = rdma_listen(cma_id, 0);
        if(rl) goto end;

        rdma_destroy_id(cma_id);
end:
        printk("create %d bind %d listen %d\n",rc,rb,rl);
}





More information about the general mailing list