aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2011-05-10 01:23:57 -0400
committerRoland Dreier <roland@purestorage.com>2011-05-10 01:23:57 -0400
commitd0c49bf391b2e230a8f3ae4486da7df440f1216d (patch)
tree77c63b308e23c8a97b2fd334ddd820a5f5aac6a2 /drivers/infiniband
parenta9bb79128aa659f97b774b97c9bb1bdc74444595 (diff)
RDMA/iwcm: Get rid of enum iw_cm_event_status
The IW_CM_EVENT_STATUS_xxx values were used in only a couple of places; cma.c uses -Exxx values instead, and so do the amso1100, cxgb3 and cxgb4 drivers -- only nes was using the enum values (with the mild consequence that all nes connection failures were treated as generic errors rather than reported as timeouts or rejections). We can fix this confusion by getting rid of enum iw_cm_event_status and using a plain int for struct iw_cm_event.status, and converting nes to use -Exxx as the other iWARP drivers do. This also gets rid of the warning drivers/infiniband/core/cma.c: In function 'cma_iw_handler': drivers/infiniband/core/cma.c:1333:3: warning: case value '4294967185' not in enumerated type 'enum iw_cm_event_status' drivers/infiniband/core/cma.c:1336:3: warning: case value '4294967186' not in enumerated type 'enum iw_cm_event_status' drivers/infiniband/core/cma.c:1332:3: warning: case value '4294967192' not in enumerated type 'enum iw_cm_event_status' Signed-off-by: Roland Dreier <roland@purestorage.com> Reviewed-by: Steve Wise <swise@opengridcomputing.com> Reviewed-by: Sean Hefty <sean.hefty@intel.com> Reviewed-by: Faisal Latif <faisal.latif@intel.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/iwcm.c2
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c16
-rw-r--r--drivers/infiniband/hw/nes/nes_verbs.c2
3 files changed, 10 insertions, 10 deletions
diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
index 2a1e9ae134b4..a9c042345c6f 100644
--- a/drivers/infiniband/core/iwcm.c
+++ b/drivers/infiniband/core/iwcm.c
@@ -725,7 +725,7 @@ static int cm_conn_rep_handler(struct iwcm_id_private *cm_id_priv,
725 */ 725 */
726 clear_bit(IWCM_F_CONNECT_WAIT, &cm_id_priv->flags); 726 clear_bit(IWCM_F_CONNECT_WAIT, &cm_id_priv->flags);
727 BUG_ON(cm_id_priv->state != IW_CM_STATE_CONN_SENT); 727 BUG_ON(cm_id_priv->state != IW_CM_STATE_CONN_SENT);
728 if (iw_event->status == IW_CM_EVENT_STATUS_ACCEPTED) { 728 if (iw_event->status == 0) {
729 cm_id_priv->id.local_addr = iw_event->local_addr; 729 cm_id_priv->id.local_addr = iw_event->local_addr;
730 cm_id_priv->id.remote_addr = iw_event->remote_addr; 730 cm_id_priv->id.remote_addr = iw_event->remote_addr;
731 cm_id_priv->state = IW_CM_STATE_ESTABLISHED; 731 cm_id_priv->state = IW_CM_STATE_ESTABLISHED;
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 33c7eedaba6c..e74cdf9ef471 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -2563,7 +2563,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp)
2563 u16 last_ae; 2563 u16 last_ae;
2564 u8 original_hw_tcp_state; 2564 u8 original_hw_tcp_state;
2565 u8 original_ibqp_state; 2565 u8 original_ibqp_state;
2566 enum iw_cm_event_status disconn_status = IW_CM_EVENT_STATUS_OK; 2566 int disconn_status = 0;
2567 int issue_disconn = 0; 2567 int issue_disconn = 0;
2568 int issue_close = 0; 2568 int issue_close = 0;
2569 int issue_flush = 0; 2569 int issue_flush = 0;
@@ -2605,7 +2605,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp)
2605 (last_ae == NES_AEQE_AEID_LLP_CONNECTION_RESET))) { 2605 (last_ae == NES_AEQE_AEID_LLP_CONNECTION_RESET))) {
2606 issue_disconn = 1; 2606 issue_disconn = 1;
2607 if (last_ae == NES_AEQE_AEID_LLP_CONNECTION_RESET) 2607 if (last_ae == NES_AEQE_AEID_LLP_CONNECTION_RESET)
2608 disconn_status = IW_CM_EVENT_STATUS_RESET; 2608 disconn_status = -ECONNRESET;
2609 } 2609 }
2610 2610
2611 if (((original_hw_tcp_state == NES_AEQE_TCP_STATE_CLOSED) || 2611 if (((original_hw_tcp_state == NES_AEQE_TCP_STATE_CLOSED) ||
@@ -2666,7 +2666,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp)
2666 cm_id->provider_data = nesqp; 2666 cm_id->provider_data = nesqp;
2667 /* Send up the close complete event */ 2667 /* Send up the close complete event */
2668 cm_event.event = IW_CM_EVENT_CLOSE; 2668 cm_event.event = IW_CM_EVENT_CLOSE;
2669 cm_event.status = IW_CM_EVENT_STATUS_OK; 2669 cm_event.status = 0;
2670 cm_event.provider_data = cm_id->provider_data; 2670 cm_event.provider_data = cm_id->provider_data;
2671 cm_event.local_addr = cm_id->local_addr; 2671 cm_event.local_addr = cm_id->local_addr;
2672 cm_event.remote_addr = cm_id->remote_addr; 2672 cm_event.remote_addr = cm_id->remote_addr;
@@ -2966,7 +2966,7 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
2966 nes_add_ref(&nesqp->ibqp); 2966 nes_add_ref(&nesqp->ibqp);
2967 2967
2968 cm_event.event = IW_CM_EVENT_ESTABLISHED; 2968 cm_event.event = IW_CM_EVENT_ESTABLISHED;
2969 cm_event.status = IW_CM_EVENT_STATUS_ACCEPTED; 2969 cm_event.status = 0;
2970 cm_event.provider_data = (void *)nesqp; 2970 cm_event.provider_data = (void *)nesqp;
2971 cm_event.local_addr = cm_id->local_addr; 2971 cm_event.local_addr = cm_id->local_addr;
2972 cm_event.remote_addr = cm_id->remote_addr; 2972 cm_event.remote_addr = cm_id->remote_addr;
@@ -3377,7 +3377,7 @@ static void cm_event_connected(struct nes_cm_event *event)
3377 3377
3378 /* notify OF layer we successfully created the requested connection */ 3378 /* notify OF layer we successfully created the requested connection */
3379 cm_event.event = IW_CM_EVENT_CONNECT_REPLY; 3379 cm_event.event = IW_CM_EVENT_CONNECT_REPLY;
3380 cm_event.status = IW_CM_EVENT_STATUS_ACCEPTED; 3380 cm_event.status = 0;
3381 cm_event.provider_data = cm_id->provider_data; 3381 cm_event.provider_data = cm_id->provider_data;
3382 cm_event.local_addr.sin_family = AF_INET; 3382 cm_event.local_addr.sin_family = AF_INET;
3383 cm_event.local_addr.sin_port = cm_id->local_addr.sin_port; 3383 cm_event.local_addr.sin_port = cm_id->local_addr.sin_port;
@@ -3484,7 +3484,7 @@ static void cm_event_reset(struct nes_cm_event *event)
3484 nesqp->cm_id = NULL; 3484 nesqp->cm_id = NULL;
3485 /* cm_id->provider_data = NULL; */ 3485 /* cm_id->provider_data = NULL; */
3486 cm_event.event = IW_CM_EVENT_DISCONNECT; 3486 cm_event.event = IW_CM_EVENT_DISCONNECT;
3487 cm_event.status = IW_CM_EVENT_STATUS_RESET; 3487 cm_event.status = -ECONNRESET;
3488 cm_event.provider_data = cm_id->provider_data; 3488 cm_event.provider_data = cm_id->provider_data;
3489 cm_event.local_addr = cm_id->local_addr; 3489 cm_event.local_addr = cm_id->local_addr;
3490 cm_event.remote_addr = cm_id->remote_addr; 3490 cm_event.remote_addr = cm_id->remote_addr;
@@ -3495,7 +3495,7 @@ static void cm_event_reset(struct nes_cm_event *event)
3495 ret = cm_id->event_handler(cm_id, &cm_event); 3495 ret = cm_id->event_handler(cm_id, &cm_event);
3496 atomic_inc(&cm_closes); 3496 atomic_inc(&cm_closes);
3497 cm_event.event = IW_CM_EVENT_CLOSE; 3497 cm_event.event = IW_CM_EVENT_CLOSE;
3498 cm_event.status = IW_CM_EVENT_STATUS_OK; 3498 cm_event.status = 0;
3499 cm_event.provider_data = cm_id->provider_data; 3499 cm_event.provider_data = cm_id->provider_data;
3500 cm_event.local_addr = cm_id->local_addr; 3500 cm_event.local_addr = cm_id->local_addr;
3501 cm_event.remote_addr = cm_id->remote_addr; 3501 cm_event.remote_addr = cm_id->remote_addr;
@@ -3534,7 +3534,7 @@ static void cm_event_mpa_req(struct nes_cm_event *event)
3534 cm_node, cm_id, jiffies); 3534 cm_node, cm_id, jiffies);
3535 3535
3536 cm_event.event = IW_CM_EVENT_CONNECT_REQUEST; 3536 cm_event.event = IW_CM_EVENT_CONNECT_REQUEST;
3537 cm_event.status = IW_CM_EVENT_STATUS_OK; 3537 cm_event.status = 0;
3538 cm_event.provider_data = (void *)cm_node; 3538 cm_event.provider_data = (void *)cm_node;
3539 3539
3540 cm_event.local_addr.sin_family = AF_INET; 3540 cm_event.local_addr.sin_family = AF_INET;
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index 26d8018c0a7c..95ca93ceedac 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -1484,7 +1484,7 @@ static int nes_destroy_qp(struct ib_qp *ibqp)
1484 (nesqp->ibqp_state == IB_QPS_RTR)) && (nesqp->cm_id)) { 1484 (nesqp->ibqp_state == IB_QPS_RTR)) && (nesqp->cm_id)) {
1485 cm_id = nesqp->cm_id; 1485 cm_id = nesqp->cm_id;
1486 cm_event.event = IW_CM_EVENT_CONNECT_REPLY; 1486 cm_event.event = IW_CM_EVENT_CONNECT_REPLY;
1487 cm_event.status = IW_CM_EVENT_STATUS_TIMEOUT; 1487 cm_event.status = -ETIMEDOUT;
1488 cm_event.local_addr = cm_id->local_addr; 1488 cm_event.local_addr = cm_id->local_addr;
1489 cm_event.remote_addr = cm_id->remote_addr; 1489 cm_event.remote_addr = cm_id->remote_addr;
1490 cm_event.private_data = NULL; 1490 cm_event.private_data = NULL;