aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/cm.c2
-rw-r--r--drivers/infiniband/core/mad.c3
-rw-r--r--drivers/infiniband/core/sysfs.c2
-rw-r--r--drivers/infiniband/core/ucm.c13
-rw-r--r--drivers/infiniband/core/user_mad.c9
-rw-r--r--drivers/infiniband/core/uverbs_main.c9
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch.c2
-rw-r--r--drivers/infiniband/hw/ehca/ehca_qes.h4
-rw-r--r--drivers/infiniband/hw/ehca/ehca_reqs.c2
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.c8
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.h1
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c30
-rw-r--r--drivers/infiniband/hw/nes/nes_verbs.c1
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_cm.c10
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c9
15 files changed, 71 insertions, 34 deletions
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 5130fc55b8e2..764787ebe8d8 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -3597,7 +3597,7 @@ static ssize_t cm_show_counter(struct kobject *obj, struct attribute *attr,
3597 atomic_long_read(&group->counter[cm_attr->index])); 3597 atomic_long_read(&group->counter[cm_attr->index]));
3598} 3598}
3599 3599
3600static struct sysfs_ops cm_counter_ops = { 3600static const struct sysfs_ops cm_counter_ops = {
3601 .show = cm_show_counter 3601 .show = cm_show_counter
3602}; 3602};
3603 3603
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 58463da814d1..e351b1548535 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -2953,6 +2953,9 @@ static void ib_mad_remove_device(struct ib_device *device)
2953{ 2953{
2954 int i, num_ports, cur_port; 2954 int i, num_ports, cur_port;
2955 2955
2956 if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
2957 return;
2958
2956 if (device->node_type == RDMA_NODE_IB_SWITCH) { 2959 if (device->node_type == RDMA_NODE_IB_SWITCH) {
2957 num_ports = 1; 2960 num_ports = 1;
2958 cur_port = 0; 2961 cur_port = 0;
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 158a214da2f7..1558bb7fc74d 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -79,7 +79,7 @@ static ssize_t port_attr_show(struct kobject *kobj,
79 return port_attr->show(p, port_attr, buf); 79 return port_attr->show(p, port_attr, buf);
80} 80}
81 81
82static struct sysfs_ops port_sysfs_ops = { 82static const struct sysfs_ops port_sysfs_ops = {
83 .show = port_attr_show 83 .show = port_attr_show
84}; 84};
85 85
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index 1b09b735c5a8..017d6e24448f 100644
--- a/drivers/infiniband/core/ucm.c
+++ b/drivers/infiniband/core/ucm.c
@@ -1336,11 +1336,8 @@ static void ib_ucm_remove_one(struct ib_device *device)
1336 device_unregister(&ucm_dev->dev); 1336 device_unregister(&ucm_dev->dev);
1337} 1337}
1338 1338
1339static ssize_t show_abi_version(struct class *class, char *buf) 1339static CLASS_ATTR_STRING(abi_version, S_IRUGO,
1340{ 1340 __stringify(IB_USER_CM_ABI_VERSION));
1341 return sprintf(buf, "%d\n", IB_USER_CM_ABI_VERSION);
1342}
1343static CLASS_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
1344 1341
1345static int __init ib_ucm_init(void) 1342static int __init ib_ucm_init(void)
1346{ 1343{
@@ -1353,7 +1350,7 @@ static int __init ib_ucm_init(void)
1353 goto error1; 1350 goto error1;
1354 } 1351 }
1355 1352
1356 ret = class_create_file(&cm_class, &class_attr_abi_version); 1353 ret = class_create_file(&cm_class, &class_attr_abi_version.attr);
1357 if (ret) { 1354 if (ret) {
1358 printk(KERN_ERR "ucm: couldn't create abi_version attribute\n"); 1355 printk(KERN_ERR "ucm: couldn't create abi_version attribute\n");
1359 goto error2; 1356 goto error2;
@@ -1367,7 +1364,7 @@ static int __init ib_ucm_init(void)
1367 return 0; 1364 return 0;
1368 1365
1369error3: 1366error3:
1370 class_remove_file(&cm_class, &class_attr_abi_version); 1367 class_remove_file(&cm_class, &class_attr_abi_version.attr);
1371error2: 1368error2:
1372 unregister_chrdev_region(IB_UCM_BASE_DEV, IB_UCM_MAX_DEVICES); 1369 unregister_chrdev_region(IB_UCM_BASE_DEV, IB_UCM_MAX_DEVICES);
1373error1: 1370error1:
@@ -1377,7 +1374,7 @@ error1:
1377static void __exit ib_ucm_cleanup(void) 1374static void __exit ib_ucm_cleanup(void)
1378{ 1375{
1379 ib_unregister_client(&ucm_client); 1376 ib_unregister_client(&ucm_client);
1380 class_remove_file(&cm_class, &class_attr_abi_version); 1377 class_remove_file(&cm_class, &class_attr_abi_version.attr);
1381 unregister_chrdev_region(IB_UCM_BASE_DEV, IB_UCM_MAX_DEVICES); 1378 unregister_chrdev_region(IB_UCM_BASE_DEV, IB_UCM_MAX_DEVICES);
1382 if (overflow_maj) 1379 if (overflow_maj)
1383 unregister_chrdev_region(overflow_maj, IB_UCM_MAX_DEVICES); 1380 unregister_chrdev_region(overflow_maj, IB_UCM_MAX_DEVICES);
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 02d360cfc2f7..04b585e86cb2 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -965,11 +965,8 @@ static ssize_t show_port(struct device *dev, struct device_attribute *attr,
965} 965}
966static DEVICE_ATTR(port, S_IRUGO, show_port, NULL); 966static DEVICE_ATTR(port, S_IRUGO, show_port, NULL);
967 967
968static ssize_t show_abi_version(struct class *class, char *buf) 968static CLASS_ATTR_STRING(abi_version, S_IRUGO,
969{ 969 __stringify(IB_USER_MAD_ABI_VERSION));
970 return sprintf(buf, "%d\n", IB_USER_MAD_ABI_VERSION);
971}
972static CLASS_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
973 970
974static dev_t overflow_maj; 971static dev_t overflow_maj;
975static DECLARE_BITMAP(overflow_map, IB_UMAD_MAX_PORTS); 972static DECLARE_BITMAP(overflow_map, IB_UMAD_MAX_PORTS);
@@ -1194,7 +1191,7 @@ static int __init ib_umad_init(void)
1194 goto out_chrdev; 1191 goto out_chrdev;
1195 } 1192 }
1196 1193
1197 ret = class_create_file(umad_class, &class_attr_abi_version); 1194 ret = class_create_file(umad_class, &class_attr_abi_version.attr);
1198 if (ret) { 1195 if (ret) {
1199 printk(KERN_ERR "user_mad: couldn't create abi_version attribute\n"); 1196 printk(KERN_ERR "user_mad: couldn't create abi_version attribute\n");
1200 goto out_class; 1197 goto out_class;
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 4fa2e6516441..d805cf365c8d 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -691,11 +691,8 @@ static ssize_t show_dev_abi_version(struct device *device,
691} 691}
692static DEVICE_ATTR(abi_version, S_IRUGO, show_dev_abi_version, NULL); 692static DEVICE_ATTR(abi_version, S_IRUGO, show_dev_abi_version, NULL);
693 693
694static ssize_t show_abi_version(struct class *class, char *buf) 694static CLASS_ATTR_STRING(abi_version, S_IRUGO,
695{ 695 __stringify(IB_USER_VERBS_ABI_VERSION));
696 return sprintf(buf, "%d\n", IB_USER_VERBS_ABI_VERSION);
697}
698static CLASS_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
699 696
700static dev_t overflow_maj; 697static dev_t overflow_maj;
701static DECLARE_BITMAP(overflow_map, IB_UVERBS_MAX_DEVICES); 698static DECLARE_BITMAP(overflow_map, IB_UVERBS_MAX_DEVICES);
@@ -841,7 +838,7 @@ static int __init ib_uverbs_init(void)
841 goto out_chrdev; 838 goto out_chrdev;
842 } 839 }
843 840
844 ret = class_create_file(uverbs_class, &class_attr_abi_version); 841 ret = class_create_file(uverbs_class, &class_attr_abi_version.attr);
845 if (ret) { 842 if (ret) {
846 printk(KERN_ERR "user_verbs: couldn't create abi_version attribute\n"); 843 printk(KERN_ERR "user_verbs: couldn't create abi_version attribute\n");
847 goto out_class; 844 goto out_class;
diff --git a/drivers/infiniband/hw/cxgb3/iwch.c b/drivers/infiniband/hw/cxgb3/iwch.c
index ee1d8b4d4541..63f975f3e30f 100644
--- a/drivers/infiniband/hw/cxgb3/iwch.c
+++ b/drivers/infiniband/hw/cxgb3/iwch.c
@@ -189,6 +189,7 @@ static void close_rnic_dev(struct t3cdev *tdev)
189 list_for_each_entry_safe(dev, tmp, &dev_list, entry) { 189 list_for_each_entry_safe(dev, tmp, &dev_list, entry) {
190 if (dev->rdev.t3cdev_p == tdev) { 190 if (dev->rdev.t3cdev_p == tdev) {
191 dev->rdev.flags = CXIO_ERROR_FATAL; 191 dev->rdev.flags = CXIO_ERROR_FATAL;
192 synchronize_net();
192 cancel_delayed_work_sync(&dev->db_drop_task); 193 cancel_delayed_work_sync(&dev->db_drop_task);
193 list_del(&dev->entry); 194 list_del(&dev->entry);
194 iwch_unregister_device(dev); 195 iwch_unregister_device(dev);
@@ -217,6 +218,7 @@ static void iwch_event_handler(struct t3cdev *tdev, u32 evt, u32 port_id)
217 switch (evt) { 218 switch (evt) {
218 case OFFLOAD_STATUS_DOWN: { 219 case OFFLOAD_STATUS_DOWN: {
219 rdev->flags = CXIO_ERROR_FATAL; 220 rdev->flags = CXIO_ERROR_FATAL;
221 synchronize_net();
220 event.event = IB_EVENT_DEVICE_FATAL; 222 event.event = IB_EVENT_DEVICE_FATAL;
221 dispatch = 1; 223 dispatch = 1;
222 break; 224 break;
diff --git a/drivers/infiniband/hw/ehca/ehca_qes.h b/drivers/infiniband/hw/ehca/ehca_qes.h
index 5d28e3e98a20..90c4efa67586 100644
--- a/drivers/infiniband/hw/ehca/ehca_qes.h
+++ b/drivers/infiniband/hw/ehca/ehca_qes.h
@@ -46,7 +46,7 @@
46 46
47#include "ehca_tools.h" 47#include "ehca_tools.h"
48 48
49/* virtual scatter gather entry to specify remote adresses with length */ 49/* virtual scatter gather entry to specify remote addresses with length */
50struct ehca_vsgentry { 50struct ehca_vsgentry {
51 u64 vaddr; 51 u64 vaddr;
52 u32 lkey; 52 u32 lkey;
@@ -148,7 +148,7 @@ struct ehca_wqe {
148 u32 immediate_data; 148 u32 immediate_data;
149 union { 149 union {
150 struct { 150 struct {
151 u64 remote_virtual_adress; 151 u64 remote_virtual_address;
152 u32 rkey; 152 u32 rkey;
153 u32 reserved; 153 u32 reserved;
154 u64 atomic_1st_op_dma_len; 154 u64 atomic_1st_op_dma_len;
diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c
index e3ec7fdd67bd..9a3fbfca9b41 100644
--- a/drivers/infiniband/hw/ehca/ehca_reqs.c
+++ b/drivers/infiniband/hw/ehca/ehca_reqs.c
@@ -269,7 +269,7 @@ static inline int ehca_write_swqe(struct ehca_qp *qp,
269 /* no break is intentional here */ 269 /* no break is intentional here */
270 case IB_QPT_RC: 270 case IB_QPT_RC:
271 /* TODO: atomic not implemented */ 271 /* TODO: atomic not implemented */
272 wqe_p->u.nud.remote_virtual_adress = 272 wqe_p->u.nud.remote_virtual_address =
273 send_wr->wr.rdma.remote_addr; 273 send_wr->wr.rdma.remote_addr;
274 wqe_p->u.nud.rkey = send_wr->wr.rdma.rkey; 274 wqe_p->u.nud.rkey = send_wr->wr.rdma.rkey;
275 275
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index ce7f53833577..925075557dc2 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -1899,9 +1899,14 @@ void nes_destroy_nic_qp(struct nes_vnic *nesvnic)
1899 u16 wqe_fragment_index; 1899 u16 wqe_fragment_index;
1900 u64 wqe_frag; 1900 u64 wqe_frag;
1901 u32 cqp_head; 1901 u32 cqp_head;
1902 u32 wqm_cfg0;
1902 unsigned long flags; 1903 unsigned long flags;
1903 int ret; 1904 int ret;
1904 1905
1906 /* clear wqe stall before destroying NIC QP */
1907 wqm_cfg0 = nes_read_indexed(nesdev, NES_IDX_WQM_CONFIG0);
1908 nes_write_indexed(nesdev, NES_IDX_WQM_CONFIG0, wqm_cfg0 & 0xFFFF7FFF);
1909
1905 /* Free remaining NIC receive buffers */ 1910 /* Free remaining NIC receive buffers */
1906 while (nesvnic->nic.rq_head != nesvnic->nic.rq_tail) { 1911 while (nesvnic->nic.rq_head != nesvnic->nic.rq_tail) {
1907 nic_rqe = &nesvnic->nic.rq_vbase[nesvnic->nic.rq_tail]; 1912 nic_rqe = &nesvnic->nic.rq_vbase[nesvnic->nic.rq_tail];
@@ -2020,6 +2025,9 @@ void nes_destroy_nic_qp(struct nes_vnic *nesvnic)
2020 2025
2021 pci_free_consistent(nesdev->pcidev, nesvnic->nic_mem_size, nesvnic->nic_vbase, 2026 pci_free_consistent(nesdev->pcidev, nesvnic->nic_mem_size, nesvnic->nic_vbase,
2022 nesvnic->nic_pbase); 2027 nesvnic->nic_pbase);
2028
2029 /* restore old wqm_cfg0 value */
2030 nes_write_indexed(nesdev, NES_IDX_WQM_CONFIG0, wqm_cfg0);
2023} 2031}
2024 2032
2025/** 2033/**
diff --git a/drivers/infiniband/hw/nes/nes_hw.h b/drivers/infiniband/hw/nes/nes_hw.h
index 9b1e7f869d83..bbbfe9fc5a5a 100644
--- a/drivers/infiniband/hw/nes/nes_hw.h
+++ b/drivers/infiniband/hw/nes/nes_hw.h
@@ -160,6 +160,7 @@ enum indexed_regs {
160 NES_IDX_ENDNODE0_NSTAT_TX_OCTETS_HI = 0x7004, 160 NES_IDX_ENDNODE0_NSTAT_TX_OCTETS_HI = 0x7004,
161 NES_IDX_ENDNODE0_NSTAT_TX_FRAMES_LO = 0x7008, 161 NES_IDX_ENDNODE0_NSTAT_TX_FRAMES_LO = 0x7008,
162 NES_IDX_ENDNODE0_NSTAT_TX_FRAMES_HI = 0x700c, 162 NES_IDX_ENDNODE0_NSTAT_TX_FRAMES_HI = 0x700c,
163 NES_IDX_WQM_CONFIG0 = 0x5000,
163 NES_IDX_WQM_CONFIG1 = 0x5004, 164 NES_IDX_WQM_CONFIG1 = 0x5004,
164 NES_IDX_CM_CONFIG = 0x5100, 165 NES_IDX_CM_CONFIG = 0x5100,
165 NES_IDX_NIC_LOGPORT_TO_PHYPORT = 0x6000, 166 NES_IDX_NIC_LOGPORT_TO_PHYPORT = 0x6000,
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index a1d79b6856ac..91fdde382e82 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -1595,7 +1595,6 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
1595 struct nes_vnic *nesvnic; 1595 struct nes_vnic *nesvnic;
1596 struct net_device *netdev; 1596 struct net_device *netdev;
1597 struct nic_qp_map *curr_qp_map; 1597 struct nic_qp_map *curr_qp_map;
1598 u32 u32temp;
1599 u8 phy_type = nesdev->nesadapter->phy_type[nesdev->mac_index]; 1598 u8 phy_type = nesdev->nesadapter->phy_type[nesdev->mac_index];
1600 1599
1601 netdev = alloc_etherdev(sizeof(struct nes_vnic)); 1600 netdev = alloc_etherdev(sizeof(struct nes_vnic));
@@ -1707,6 +1706,10 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
1707 ((phy_type == NES_PHY_TYPE_PUMA_1G) && 1706 ((phy_type == NES_PHY_TYPE_PUMA_1G) &&
1708 (((PCI_FUNC(nesdev->pcidev->devfn) == 1) && (nesdev->mac_index == 2)) || 1707 (((PCI_FUNC(nesdev->pcidev->devfn) == 1) && (nesdev->mac_index == 2)) ||
1709 ((PCI_FUNC(nesdev->pcidev->devfn) == 2) && (nesdev->mac_index == 1)))))) { 1708 ((PCI_FUNC(nesdev->pcidev->devfn) == 2) && (nesdev->mac_index == 1)))))) {
1709 u32 u32temp;
1710 u32 link_mask;
1711 u32 link_val;
1712
1710 u32temp = nes_read_indexed(nesdev, NES_IDX_PHY_PCS_CONTROL_STATUS0 + 1713 u32temp = nes_read_indexed(nesdev, NES_IDX_PHY_PCS_CONTROL_STATUS0 +
1711 (0x200 * (nesdev->mac_index & 1))); 1714 (0x200 * (nesdev->mac_index & 1)));
1712 if (phy_type != NES_PHY_TYPE_PUMA_1G) { 1715 if (phy_type != NES_PHY_TYPE_PUMA_1G) {
@@ -1715,13 +1718,36 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
1715 (0x200 * (nesdev->mac_index & 1)), u32temp); 1718 (0x200 * (nesdev->mac_index & 1)), u32temp);
1716 } 1719 }
1717 1720
1721 /* Check and set linkup here. This is for back to back */
1722 /* configuration where second port won't get link interrupt */
1723 switch (phy_type) {
1724 case NES_PHY_TYPE_PUMA_1G:
1725 if (nesdev->mac_index < 2) {
1726 link_mask = 0x01010000;
1727 link_val = 0x01010000;
1728 } else {
1729 link_mask = 0x02020000;
1730 link_val = 0x02020000;
1731 }
1732 break;
1733 default:
1734 link_mask = 0x0f1f0000;
1735 link_val = 0x0f0f0000;
1736 break;
1737 }
1738
1739 u32temp = nes_read_indexed(nesdev,
1740 NES_IDX_PHY_PCS_CONTROL_STATUS0 +
1741 (0x200 * (nesdev->mac_index & 1)));
1742 if ((u32temp & link_mask) == link_val)
1743 nesvnic->linkup = 1;
1744
1718 /* clear the MAC interrupt status, assumes direct logical to physical mapping */ 1745 /* clear the MAC interrupt status, assumes direct logical to physical mapping */
1719 u32temp = nes_read_indexed(nesdev, NES_IDX_MAC_INT_STATUS + (0x200 * nesdev->mac_index)); 1746 u32temp = nes_read_indexed(nesdev, NES_IDX_MAC_INT_STATUS + (0x200 * nesdev->mac_index));
1720 nes_debug(NES_DBG_INIT, "Phy interrupt status = 0x%X.\n", u32temp); 1747 nes_debug(NES_DBG_INIT, "Phy interrupt status = 0x%X.\n", u32temp);
1721 nes_write_indexed(nesdev, NES_IDX_MAC_INT_STATUS + (0x200 * nesdev->mac_index), u32temp); 1748 nes_write_indexed(nesdev, NES_IDX_MAC_INT_STATUS + (0x200 * nesdev->mac_index), u32temp);
1722 1749
1723 nes_init_phy(nesdev); 1750 nes_init_phy(nesdev);
1724
1725 } 1751 }
1726 1752
1727 return netdev; 1753 return netdev;
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index 815725f886c4..69928296d74b 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -1323,6 +1323,7 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
1323 nesqp->nesqp_context->aeq_token_low = cpu_to_le32((u32)((unsigned long)(nesqp))); 1323 nesqp->nesqp_context->aeq_token_low = cpu_to_le32((u32)((unsigned long)(nesqp)));
1324 nesqp->nesqp_context->aeq_token_high = cpu_to_le32((u32)(upper_32_bits((unsigned long)(nesqp)))); 1324 nesqp->nesqp_context->aeq_token_high = cpu_to_le32((u32)(upper_32_bits((unsigned long)(nesqp))));
1325 nesqp->nesqp_context->ird_ord_sizes = cpu_to_le32(NES_QPCONTEXT_ORDIRD_ALSMM | 1325 nesqp->nesqp_context->ird_ord_sizes = cpu_to_le32(NES_QPCONTEXT_ORDIRD_ALSMM |
1326 NES_QPCONTEXT_ORDIRD_AAH |
1326 ((((u32)nesadapter->max_irrq_wr) << 1327 ((((u32)nesadapter->max_irrq_wr) <<
1327 NES_QPCONTEXT_ORDIRD_IRDSIZE_SHIFT) & NES_QPCONTEXT_ORDIRD_IRDSIZE_MASK)); 1328 NES_QPCONTEXT_ORDIRD_IRDSIZE_SHIFT) & NES_QPCONTEXT_ORDIRD_IRDSIZE_MASK));
1328 if (disable_mpa_crc) { 1329 if (disable_mpa_crc) {
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 83a7751c38d6..bc658373ad55 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -708,6 +708,7 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
708 struct ipoib_dev_priv *priv = netdev_priv(dev); 708 struct ipoib_dev_priv *priv = netdev_priv(dev);
709 struct ipoib_cm_tx_buf *tx_req; 709 struct ipoib_cm_tx_buf *tx_req;
710 u64 addr; 710 u64 addr;
711 int rc;
711 712
712 if (unlikely(skb->len > tx->mtu)) { 713 if (unlikely(skb->len > tx->mtu)) {
713 ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", 714 ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n",
@@ -739,9 +740,10 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
739 740
740 tx_req->mapping = addr; 741 tx_req->mapping = addr;
741 742
742 if (unlikely(post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1), 743 rc = post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1),
743 addr, skb->len))) { 744 addr, skb->len);
744 ipoib_warn(priv, "post_send failed\n"); 745 if (unlikely(rc)) {
746 ipoib_warn(priv, "post_send failed, error %d\n", rc);
745 ++dev->stats.tx_errors; 747 ++dev->stats.tx_errors;
746 ib_dma_unmap_single(priv->ca, addr, skb->len, DMA_TO_DEVICE); 748 ib_dma_unmap_single(priv->ca, addr, skb->len, DMA_TO_DEVICE);
747 dev_kfree_skb_any(skb); 749 dev_kfree_skb_any(skb);
@@ -752,6 +754,8 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
752 if (++priv->tx_outstanding == ipoib_sendq_size) { 754 if (++priv->tx_outstanding == ipoib_sendq_size) {
753 ipoib_dbg(priv, "TX ring 0x%x full, stopping kernel net queue\n", 755 ipoib_dbg(priv, "TX ring 0x%x full, stopping kernel net queue\n",
754 tx->qp->qp_num); 756 tx->qp->qp_num);
757 if (ib_req_notify_cq(priv->send_cq, IB_CQ_NEXT_COMP))
758 ipoib_warn(priv, "request notify on send CQ failed\n");
755 netif_stop_queue(dev); 759 netif_stop_queue(dev);
756 } 760 }
757 } 761 }
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 8c91d9f37ada..5df40b128f81 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -529,7 +529,7 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
529{ 529{
530 struct ipoib_dev_priv *priv = netdev_priv(dev); 530 struct ipoib_dev_priv *priv = netdev_priv(dev);
531 struct ipoib_tx_buf *tx_req; 531 struct ipoib_tx_buf *tx_req;
532 int hlen; 532 int hlen, rc;
533 void *phead; 533 void *phead;
534 534
535 if (skb_is_gso(skb)) { 535 if (skb_is_gso(skb)) {
@@ -585,9 +585,10 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
585 netif_stop_queue(dev); 585 netif_stop_queue(dev);
586 } 586 }
587 587
588 if (unlikely(post_send(priv, priv->tx_head & (ipoib_sendq_size - 1), 588 rc = post_send(priv, priv->tx_head & (ipoib_sendq_size - 1),
589 address->ah, qpn, tx_req, phead, hlen))) { 589 address->ah, qpn, tx_req, phead, hlen);
590 ipoib_warn(priv, "post_send failed\n"); 590 if (unlikely(rc)) {
591 ipoib_warn(priv, "post_send failed, error %d\n", rc);
591 ++dev->stats.tx_errors; 592 ++dev->stats.tx_errors;
592 --priv->tx_outstanding; 593 --priv->tx_outstanding;
593 ipoib_dma_unmap_tx(priv->ca, tx_req); 594 ipoib_dma_unmap_tx(priv->ca, tx_req);