diff options
author | Hariprasad S <hariprasad@chelsio.com> | 2016-06-09 15:35:13 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-06-23 10:44:16 -0400 |
commit | bce2841f5a0dd9caf327fb1bc0051ea09a9e7dfb (patch) | |
tree | 6f13db44a09508ebb64cef719f0daea0619fddde /drivers/infiniband | |
parent | 68cebcab59fbfbab5827fcc44e04cd31da02041b (diff) |
RDMA/iw_cxgb4: clean up c4iw_reject_cr()
Get rid of unneeded code, and refactor things a bit.
For MPA version 0 we abort the connection. For > 0, we attempt to send
an MPA_START/REJECT Reply, and then disconnect gracefully. If the send
of the MPA message fails, then we abort the connection. We can ignore
c4iw_ep_disconnect() errors here because it will clean up the endpoint
if there are failures.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/cxgb4/cm.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 2ba3403d8101..25236fc7dc92 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c | |||
@@ -3037,9 +3037,9 @@ out: | |||
3037 | 3037 | ||
3038 | int c4iw_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len) | 3038 | int c4iw_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len) |
3039 | { | 3039 | { |
3040 | int err = 0; | 3040 | int abort; |
3041 | int disconnect = 0; | ||
3042 | struct c4iw_ep *ep = to_ep(cm_id); | 3041 | struct c4iw_ep *ep = to_ep(cm_id); |
3042 | |||
3043 | PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid); | 3043 | PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid); |
3044 | 3044 | ||
3045 | mutex_lock(&ep->com.mutex); | 3045 | mutex_lock(&ep->com.mutex); |
@@ -3050,16 +3050,13 @@ int c4iw_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len) | |||
3050 | } | 3050 | } |
3051 | set_bit(ULP_REJECT, &ep->com.history); | 3051 | set_bit(ULP_REJECT, &ep->com.history); |
3052 | if (mpa_rev == 0) | 3052 | if (mpa_rev == 0) |
3053 | disconnect = 2; | 3053 | abort = 1; |
3054 | else { | 3054 | else |
3055 | err = send_mpa_reject(ep, pdata, pdata_len); | 3055 | abort = send_mpa_reject(ep, pdata, pdata_len); |
3056 | disconnect = 1; | ||
3057 | } | ||
3058 | mutex_unlock(&ep->com.mutex); | 3056 | mutex_unlock(&ep->com.mutex); |
3059 | if (disconnect) { | 3057 | |
3060 | stop_ep_timer(ep); | 3058 | stop_ep_timer(ep); |
3061 | err = c4iw_ep_disconnect(ep, disconnect == 2, GFP_KERNEL); | 3059 | c4iw_ep_disconnect(ep, abort != 0, GFP_KERNEL); |
3062 | } | ||
3063 | c4iw_put_ep(&ep->com); | 3060 | c4iw_put_ep(&ep->com); |
3064 | return 0; | 3061 | return 0; |
3065 | } | 3062 | } |