浏览代码

RDMA/cma: Allow enabling reuseaddr in any state

The rdma_cm only allows setting reuseaddr if the corresponding
rdma_cm_id is in the idle state.  Allow setting this value in other
states.  This brings the behavior more inline with sockets.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Sean Hefty 12 年之前
父节点
当前提交
c8dea2f9f0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/infiniband/core/cma.c

+ 1 - 1
drivers/infiniband/core/cma.c

@@ -2097,7 +2097,7 @@ int rdma_set_reuseaddr(struct rdma_cm_id *id, int reuse)
 
 	id_priv = container_of(id, struct rdma_id_private, id);
 	spin_lock_irqsave(&id_priv->lock, flags);
-	if (id_priv->state == RDMA_CM_IDLE) {
+	if (reuse || id_priv->state == RDMA_CM_IDLE) {
 		id_priv->reuseaddr = reuse;
 		ret = 0;
 	} else {