aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/nes/nes_cm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/nes/nes_cm.c')
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index bd5cfeaac203..39adb267fb15 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -370,11 +370,11 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb,
370 int ret = 0; 370 int ret = 0;
371 u32 was_timer_set; 371 u32 was_timer_set;
372 372
373 if (!cm_node)
374 return -EINVAL;
373 new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC); 375 new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC);
374 if (!new_send) 376 if (!new_send)
375 return -1; 377 return -1;
376 if (!cm_node)
377 return -EINVAL;
378 378
379 /* new_send->timetosend = currenttime */ 379 /* new_send->timetosend = currenttime */
380 new_send->retrycount = NES_DEFAULT_RETRYS; 380 new_send->retrycount = NES_DEFAULT_RETRYS;
@@ -947,6 +947,7 @@ static int mini_cm_dec_refcnt_listen(struct nes_cm_core *cm_core,
947 nes_debug(NES_DBG_CM, "destroying listener (%p)\n", listener); 947 nes_debug(NES_DBG_CM, "destroying listener (%p)\n", listener);
948 948
949 kfree(listener); 949 kfree(listener);
950 listener = NULL;
950 ret = 0; 951 ret = 0;
951 cm_listens_destroyed++; 952 cm_listens_destroyed++;
952 } else { 953 } else {
@@ -2319,6 +2320,7 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
2319 struct iw_cm_event cm_event; 2320 struct iw_cm_event cm_event;
2320 struct nes_hw_qp_wqe *wqe; 2321 struct nes_hw_qp_wqe *wqe;
2321 struct nes_v4_quad nes_quad; 2322 struct nes_v4_quad nes_quad;
2323 u32 crc_value;
2322 int ret; 2324 int ret;
2323 2325
2324 ibqp = nes_get_qp(cm_id->device, conn_param->qpn); 2326 ibqp = nes_get_qp(cm_id->device, conn_param->qpn);
@@ -2435,8 +2437,8 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
2435 nes_quad.TcpPorts[1] = cm_id->local_addr.sin_port; 2437 nes_quad.TcpPorts[1] = cm_id->local_addr.sin_port;
2436 2438
2437 /* Produce hash key */ 2439 /* Produce hash key */
2438 nesqp->hte_index = cpu_to_be32( 2440 crc_value = get_crc_value(&nes_quad);
2439 crc32c(~0, (void *)&nes_quad, sizeof(nes_quad)) ^ 0xffffffff); 2441 nesqp->hte_index = cpu_to_be32(crc_value ^ 0xffffffff);
2440 nes_debug(NES_DBG_CM, "HTE Index = 0x%08X, CRC = 0x%08X\n", 2442 nes_debug(NES_DBG_CM, "HTE Index = 0x%08X, CRC = 0x%08X\n",
2441 nesqp->hte_index, nesqp->hte_index & adapter->hte_index_mask); 2443 nesqp->hte_index, nesqp->hte_index & adapter->hte_index_mask);
2442 2444
@@ -2750,6 +2752,7 @@ void cm_event_connected(struct nes_cm_event *event)
2750 struct iw_cm_event cm_event; 2752 struct iw_cm_event cm_event;
2751 struct nes_hw_qp_wqe *wqe; 2753 struct nes_hw_qp_wqe *wqe;
2752 struct nes_v4_quad nes_quad; 2754 struct nes_v4_quad nes_quad;
2755 u32 crc_value;
2753 int ret; 2756 int ret;
2754 2757
2755 /* get all our handles */ 2758 /* get all our handles */
@@ -2827,8 +2830,8 @@ void cm_event_connected(struct nes_cm_event *event)
2827 nes_quad.TcpPorts[1] = cm_id->local_addr.sin_port; 2830 nes_quad.TcpPorts[1] = cm_id->local_addr.sin_port;
2828 2831
2829 /* Produce hash key */ 2832 /* Produce hash key */
2830 nesqp->hte_index = cpu_to_be32( 2833 crc_value = get_crc_value(&nes_quad);
2831 crc32c(~0, (void *)&nes_quad, sizeof(nes_quad)) ^ 0xffffffff); 2834 nesqp->hte_index = cpu_to_be32(crc_value ^ 0xffffffff);
2832 nes_debug(NES_DBG_CM, "HTE Index = 0x%08X, After CRC = 0x%08X\n", 2835 nes_debug(NES_DBG_CM, "HTE Index = 0x%08X, After CRC = 0x%08X\n",
2833 nesqp->hte_index, nesqp->hte_index & nesadapter->hte_index_mask); 2836 nesqp->hte_index, nesqp->hte_index & nesadapter->hte_index_mask);
2834 2837