aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2012-12-08 23:45:48 -0500
committerRoland Dreier <roland@purestorage.com>2012-12-08 23:45:48 -0500
commit01e03365981ebd99f1b4027dbf7c215d1c136f71 (patch)
treea1ecc39339aa625da8271f539b38dcd09e285019 /drivers/infiniband
parentfb57e1dbbd4a69aff759d5fd14a936d5260937b6 (diff)
parent7d9c199a55200c9b9fcad08e150470d02fb385be (diff)
Merge branch 'nes' into for-next
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/nes/nes.h1
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c24
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.c9
-rw-r--r--drivers/infiniband/hw/nes/nes_verbs.c9
4 files changed, 17 insertions, 26 deletions
diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h
index 5cac29e6bc1c..33cc58941a3e 100644
--- a/drivers/infiniband/hw/nes/nes.h
+++ b/drivers/infiniband/hw/nes/nes.h
@@ -532,6 +532,7 @@ void nes_iwarp_ce_handler(struct nes_device *, struct nes_hw_cq *);
532int nes_destroy_cqp(struct nes_device *); 532int nes_destroy_cqp(struct nes_device *);
533int nes_nic_cm_xmit(struct sk_buff *, struct net_device *); 533int nes_nic_cm_xmit(struct sk_buff *, struct net_device *);
534void nes_recheck_link_status(struct work_struct *work); 534void nes_recheck_link_status(struct work_struct *work);
535void nes_terminate_timeout(unsigned long context);
535 536
536/* nes_nic.c */ 537/* nes_nic.c */
537struct net_device *nes_netdev_init(struct nes_device *, void __iomem *); 538struct net_device *nes_netdev_init(struct nes_device *, void __iomem *);
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index feb41e74206b..22ea67eea5dc 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -669,7 +669,6 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb,
669 struct nes_cm_core *cm_core = cm_node->cm_core; 669 struct nes_cm_core *cm_core = cm_node->cm_core;
670 struct nes_timer_entry *new_send; 670 struct nes_timer_entry *new_send;
671 int ret = 0; 671 int ret = 0;
672 u32 was_timer_set;
673 672
674 new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC); 673 new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC);
675 if (!new_send) 674 if (!new_send)
@@ -721,12 +720,8 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb,
721 } 720 }
722 } 721 }
723 722
724 was_timer_set = timer_pending(&cm_core->tcp_timer); 723 if (!timer_pending(&cm_core->tcp_timer))
725 724 mod_timer(&cm_core->tcp_timer, new_send->timetosend);
726 if (!was_timer_set) {
727 cm_core->tcp_timer.expires = new_send->timetosend;
728 add_timer(&cm_core->tcp_timer);
729 }
730 725
731 return ret; 726 return ret;
732} 727}
@@ -944,10 +939,8 @@ static void nes_cm_timer_tick(unsigned long pass)
944 } 939 }
945 940
946 if (settimer) { 941 if (settimer) {
947 if (!timer_pending(&cm_core->tcp_timer)) { 942 if (!timer_pending(&cm_core->tcp_timer))
948 cm_core->tcp_timer.expires = nexttimeout; 943 mod_timer(&cm_core->tcp_timer, nexttimeout);
949 add_timer(&cm_core->tcp_timer);
950 }
951 } 944 }
952} 945}
953 946
@@ -1312,8 +1305,6 @@ static int mini_cm_del_listen(struct nes_cm_core *cm_core,
1312static inline int mini_cm_accelerated(struct nes_cm_core *cm_core, 1305static inline int mini_cm_accelerated(struct nes_cm_core *cm_core,
1313 struct nes_cm_node *cm_node) 1306 struct nes_cm_node *cm_node)
1314{ 1307{
1315 u32 was_timer_set;
1316
1317 cm_node->accelerated = 1; 1308 cm_node->accelerated = 1;
1318 1309
1319 if (cm_node->accept_pend) { 1310 if (cm_node->accept_pend) {
@@ -1323,11 +1314,8 @@ static inline int mini_cm_accelerated(struct nes_cm_core *cm_core,
1323 BUG_ON(atomic_read(&cm_node->listener->pend_accepts_cnt) < 0); 1314 BUG_ON(atomic_read(&cm_node->listener->pend_accepts_cnt) < 0);
1324 } 1315 }
1325 1316
1326 was_timer_set = timer_pending(&cm_core->tcp_timer); 1317 if (!timer_pending(&cm_core->tcp_timer))
1327 if (!was_timer_set) { 1318 mod_timer(&cm_core->tcp_timer, (jiffies + NES_SHORT_TIME));
1328 cm_core->tcp_timer.expires = jiffies + NES_SHORT_TIME;
1329 add_timer(&cm_core->tcp_timer);
1330 }
1331 1319
1332 return 0; 1320 return 0;
1333} 1321}
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index fe7965ee4096..67647e264611 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -75,7 +75,6 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
75static void process_critical_error(struct nes_device *nesdev); 75static void process_critical_error(struct nes_device *nesdev);
76static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number); 76static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number);
77static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode); 77static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode);
78static void nes_terminate_timeout(unsigned long context);
79static void nes_terminate_start_timer(struct nes_qp *nesqp); 78static void nes_terminate_start_timer(struct nes_qp *nesqp);
80 79
81#ifdef CONFIG_INFINIBAND_NES_DEBUG 80#ifdef CONFIG_INFINIBAND_NES_DEBUG
@@ -3520,7 +3519,7 @@ static void nes_terminate_received(struct nes_device *nesdev,
3520} 3519}
3521 3520
3522/* Timeout routine in case terminate fails to complete */ 3521/* Timeout routine in case terminate fails to complete */
3523static void nes_terminate_timeout(unsigned long context) 3522void nes_terminate_timeout(unsigned long context)
3524{ 3523{
3525 struct nes_qp *nesqp = (struct nes_qp *)(unsigned long)context; 3524 struct nes_qp *nesqp = (struct nes_qp *)(unsigned long)context;
3526 3525
@@ -3530,11 +3529,7 @@ static void nes_terminate_timeout(unsigned long context)
3530/* Set a timer in case hw cannot complete the terminate sequence */ 3529/* Set a timer in case hw cannot complete the terminate sequence */
3531static void nes_terminate_start_timer(struct nes_qp *nesqp) 3530static void nes_terminate_start_timer(struct nes_qp *nesqp)
3532{ 3531{
3533 init_timer(&nesqp->terminate_timer); 3532 mod_timer(&nesqp->terminate_timer, (jiffies + HZ));
3534 nesqp->terminate_timer.function = nes_terminate_timeout;
3535 nesqp->terminate_timer.expires = jiffies + HZ;
3536 nesqp->terminate_timer.data = (unsigned long)nesqp;
3537 add_timer(&nesqp->terminate_timer);
3538} 3533}
3539 3534
3540/** 3535/**
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index cd0ecb215cca..07e4fbad987a 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -1404,6 +1404,9 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
1404 } 1404 }
1405 1405
1406 nesqp->sig_all = (init_attr->sq_sig_type == IB_SIGNAL_ALL_WR); 1406 nesqp->sig_all = (init_attr->sq_sig_type == IB_SIGNAL_ALL_WR);
1407 init_timer(&nesqp->terminate_timer);
1408 nesqp->terminate_timer.function = nes_terminate_timeout;
1409 nesqp->terminate_timer.data = (unsigned long)nesqp;
1407 1410
1408 /* update the QP table */ 1411 /* update the QP table */
1409 nesdev->nesadapter->qp_table[nesqp->hwqp.qp_id-NES_FIRST_QPN] = nesqp; 1412 nesdev->nesadapter->qp_table[nesqp->hwqp.qp_id-NES_FIRST_QPN] = nesqp;
@@ -1413,7 +1416,6 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
1413 return &nesqp->ibqp; 1416 return &nesqp->ibqp;
1414} 1417}
1415 1418
1416
1417/** 1419/**
1418 * nes_clean_cq 1420 * nes_clean_cq
1419 */ 1421 */
@@ -2559,6 +2561,11 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
2559 return ibmr; 2561 return ibmr;
2560 case IWNES_MEMREG_TYPE_QP: 2562 case IWNES_MEMREG_TYPE_QP:
2561 case IWNES_MEMREG_TYPE_CQ: 2563 case IWNES_MEMREG_TYPE_CQ:
2564 if (!region->length) {
2565 nes_debug(NES_DBG_MR, "Unable to register zero length region for CQ\n");
2566 ib_umem_release(region);
2567 return ERR_PTR(-EINVAL);
2568 }
2562 nespbl = kzalloc(sizeof(*nespbl), GFP_KERNEL); 2569 nespbl = kzalloc(sizeof(*nespbl), GFP_KERNEL);
2563 if (!nespbl) { 2570 if (!nespbl) {
2564 nes_debug(NES_DBG_MR, "Unable to allocate PBL\n"); 2571 nes_debug(NES_DBG_MR, "Unable to allocate PBL\n");