]> git.openfabrics.org - ~shefty/librdmacm.git/commit
librdmacm: do not modify qp_init_attr in rdma_get_request
authorSean Hefty <sean.hefty@intel.com>
Mon, 18 Oct 2010 16:53:53 +0000 (09:53 -0700)
committerSean Hefty <sean.hefty@intel.com>
Mon, 18 Oct 2010 16:53:53 +0000 (09:53 -0700)
commit48dcae8ea23bd498f5116a30c90496942caa67ef
treea3c7eb5e6574cc1fd1279e7504b84416c6f86731
parent5f5181f4d09550af291347574e28441fe5b35ac5
librdmacm: do not modify qp_init_attr in rdma_get_request

rdma_create_qp modifies the qp_init_attr structure passed in
by the user to return the actual QP capabilities that were
allocated.  If the qp_init_attr does not specify CQs, the
librdmacm will allocate CQs for the user and return them.

rdma_get_request will allocate a QP off newly connected rdma_cm_id
if the corresponding listen request is associated with a
qp_init_attr structure.  The librdmacm passes in the listen->
qp_init_attr structure into the rdma_create_qp call.
rdma_create_qp ends up modifying the qp_init_attr's associated
with the listen.  The result is that future calls to
rdma_get_request will use the modified qp attributes, rather
than those specified by the user.

Fix this by having rdma_get_request pass in a copy of the
qp_init_attr, rather than modifying those associated with the
listen.  Also update the man page for rdma_create_qp to indicate
that the qp_init_attr structure may be modified on output.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
man/rdma_create_qp.3
src/cma.c