History

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma

Pull rdma fixes from Doug Ledford: "This has been a slow -rc cycle for the RDMA subsystem. We really haven't had a lot of rc fixes come in. This pull request is the first of this entire rc cycle and it has all of the suitable fixes so far and it's still only about 20 patches. The fix for the minor breakage cause by the dma mapping patchset is in here, as well as a couple other potential oops fixes, but the rest is more minor. Summary: - fix for dma_ops change in this kernel, resolving the s390, powerpc, and IOMMU operation - a few other oops fixes - the rest are all minor fixes" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: IB/qib: fix false-postive maybe-uninitialized warning RDMA/iser: Fix possible mr leak on device removal event IB/device: Convert ib-comp-wq to be CPU-bound IB/cq: Don't process more than the given budget IB/rxe: increment msn only when completing a request uapi: fix rdma/mlx5-abi.h userspace compilation errors IB/core: Restore I/O MMU, s390 and powerpc support IB/rxe: Update documentation link RDMA/ocrdma: fix a type issue in ocrdma_put_pd_num() IB/rxe: double free on error RDMA/vmw_pvrdma: Activate device on ethernet link up RDMA/vmw_pvrdma: Dont hardcode QP header page RDMA/vmw_pvrdma: Cleanup unused variables infiniband: Fix alignment of mmap cookies to support VIPT caching IB/core: Protect against self-requeue of a cq work item i40iw: Receive netdev events post INET_NOTIFIER state

Linus Torvalds committed 9 years ago

Commit 4a01fa52 parents 4c3de7e f6aafac18 files · +110 −69Browse files

Unified · Split

18 files
  1. drivers/infiniband/core/cq.c +8 −2
  2. drivers/infiniband/core/device.c +21 −8
  3. drivers/infiniband/hw/i40iw/i40iw_utils.c +8 −0
  4. drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1 −1
  5. drivers/infiniband/hw/qib/qib_iba7322.c +1 −1
  6. drivers/infiniband/hw/vmw_pvrdma/pvrdma.h +3 −0
  7. drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h +1 −1
  8. drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +13 −4
  9. drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c +18 −24
  10. drivers/infiniband/sw/rdmavt/mmap.c +2 −2
  11. drivers/infiniband/sw/rxe/Kconfig +1 −1
  12. drivers/infiniband/sw/rxe/rxe_mmap.c +2 −2
  13. drivers/infiniband/sw/rxe/rxe_req.c +1 −1
  14. drivers/infiniband/sw/rxe/rxe_resp.c +4 −5
  15. drivers/infiniband/ulp/iser/iscsi_iser.h +2 −0
  16. drivers/infiniband/ulp/iser/iser_verbs.c +5 −3
  17. include/rdma/ib_verbs.h +17 −13
  18. include/uapi/rdma/mlx5-abi.h +2 −1
drivers/infiniband/core/cq.c+8−2
@@ -29,7 +29,13 @@ static int __ib_process_cq(struct ib_cq *cq, int budget) · 28 unmodified lines
29{29{
30 int i, n, completed = 0;30 int i, n, completed = 0;
31 31
32 while ((n = ib_poll_cq(cq, IB_POLL_BATCH, cq->wc)) > 0) {32 /*
33 * budget might be (-1) if the caller does not
34 * want to bound this call, thus we need unsigned
35 * minimum here.
36 */
37 while ((n = ib_poll_cq(cq, min_t(u32, IB_POLL_BATCH,
38 budget - completed), cq->wc)) > 0) {
33 for (i = 0; i < n; i++) {39 for (i = 0; i < n; i++) {
34 struct ib_wc *wc = &cq->wc[i];40 struct ib_wc *wc = &cq->wc[i];
35 41
@@ -196,7 +202,7 @@ void ib_free_cq(struct ib_cq *cq) · 160 unmodified lines
196 irq_poll_disable(&cq->iop);202 irq_poll_disable(&cq->iop);
197 break;203 break;
198 case IB_POLL_WORKQUEUE:204 case IB_POLL_WORKQUEUE:
199 flush_work(&cq->work);205 cancel_work_sync(&cq->work);
200 break;206 break;
201 default:207 default:
202 WARN_ON_ONCE(1);208 WARN_ON_ONCE(1);
drivers/infiniband/core/device.c+21−8
@@ -336,12 +336,26 @@ int ib_register_device(struct ib_device *device, · 335 unmodified lines
336 struct device *parent = device->dev.parent;336 struct device *parent = device->dev.parent;
337 337
338 WARN_ON_ONCE(!parent);338 WARN_ON_ONCE(!parent);
339 if (!device->dev.dma_ops)339 WARN_ON_ONCE(device->dma_device);
340 device->dev.dma_ops = parent->dma_ops;340 if (device->dev.dma_ops) {
341 if (!device->dev.dma_mask)341 /*
342 device->dev.dma_mask = parent->dma_mask;342 * The caller provided custom DMA operations. Copy the
343 if (!device->dev.coherent_dma_mask)343 * DMA-related fields that are used by e.g. dma_alloc_coherent()
344 device->dev.coherent_dma_mask = parent->coherent_dma_mask;344 * into device->dev.
345 */
346 device->dma_device = &device->dev;
347 if (!device->dev.dma_mask)
348 device->dev.dma_mask = parent->dma_mask;
349 if (!device->dev.coherent_dma_mask)
350 device->dev.coherent_dma_mask =
351 parent->coherent_dma_mask;
352 } else {
353 /*
354 * The caller did not provide custom DMA operations. Use the
355 * DMA mapping operations of the parent device.
356 */
357 device->dma_device = parent;
358 }
345 359
346 mutex_lock(&device_mutex);360 mutex_lock(&device_mutex);
347 361
@@ -1015,8 +1029,7 @@ static int __init ib_core_init(void) · 667 unmodified lines
1015 return -ENOMEM;1029 return -ENOMEM;
1016 1030
1017 ib_comp_wq = alloc_workqueue("ib-comp-wq",1031 ib_comp_wq = alloc_workqueue("ib-comp-wq",
1018 WQ_UNBOUND | WQ_HIGHPRI | WQ_MEM_RECLAIM,1032 WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
1019 WQ_UNBOUND_MAX_ACTIVE);
1020 if (!ib_comp_wq) {1033 if (!ib_comp_wq) {
1021 ret = -ENOMEM;1034 ret = -ENOMEM;
1022 goto err;1035 goto err;
drivers/infiniband/hw/i40iw/i40iw_utils.c+8−0
@@ -160,6 +160,9 @@ int i40iw_inetaddr_event(struct notifier_block *notifier, · 159 unmodified lines
160 return NOTIFY_DONE;160 return NOTIFY_DONE;
161 161
162 iwdev = &hdl->device;162 iwdev = &hdl->device;
163 if (iwdev->init_state < INET_NOTIFIER)
164 return NOTIFY_DONE;
165
163 netdev = iwdev->ldev->netdev;166 netdev = iwdev->ldev->netdev;
164 upper_dev = netdev_master_upper_dev_get(netdev);167 upper_dev = netdev_master_upper_dev_get(netdev);
165 if (netdev != event_netdev)168 if (netdev != event_netdev)
@@ -214,6 +217,9 @@ int i40iw_inet6addr_event(struct notifier_block *notifier, · 48 unmodified lines
214 return NOTIFY_DONE;217 return NOTIFY_DONE;
215 218
216 iwdev = &hdl->device;219 iwdev = &hdl->device;
220 if (iwdev->init_state < INET_NOTIFIER)
221 return NOTIFY_DONE;
222
217 netdev = iwdev->ldev->netdev;223 netdev = iwdev->ldev->netdev;
218 if (netdev != event_netdev)224 if (netdev != event_netdev)
219 return NOTIFY_DONE;225 return NOTIFY_DONE;
@@ -260,6 +266,8 @@ int i40iw_net_event(struct notifier_block *notifier, unsigned long event, void * · 40 unmodified lines
260 if (!iwhdl)266 if (!iwhdl)
261 return NOTIFY_DONE;267 return NOTIFY_DONE;
262 iwdev = &iwhdl->device;268 iwdev = &iwhdl->device;
269 if (iwdev->init_state < INET_NOTIFIER)
270 return NOTIFY_DONE;
263 p = (__be32 *)neigh->primary_key;271 p = (__be32 *)neigh->primary_key;
264 i40iw_copy_ip_ntohl(local_ipaddr, p);272 i40iw_copy_ip_ntohl(local_ipaddr, p);
265 if (neigh->nud_state & NUD_VALID) {273 if (neigh->nud_state & NUD_VALID) {
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c+1−1
@@ -372,7 +372,7 @@ static int _ocrdma_pd_mgr_put_bitmap(struct ocrdma_dev *dev, u16 pd_id, · 371 unmodified lines
372 return 0;372 return 0;
373}373}
374 374
375static u8 ocrdma_put_pd_num(struct ocrdma_dev *dev, u16 pd_id,375static int ocrdma_put_pd_num(struct ocrdma_dev *dev, u16 pd_id,
376 bool dpp_pool)376 bool dpp_pool)
377{377{
378 int status;378 int status;
drivers/infiniband/hw/qib/qib_iba7322.c+1−1
@@ -7068,7 +7068,7 @@ static void qib_7322_txchk_change(struct qib_devdata *dd, u32 start, · 7067 unmodified lines
7068 unsigned long flags;7068 unsigned long flags;
7069 7069
7070 while (wait) {7070 while (wait) {
7071 unsigned long shadow;7071 unsigned long shadow = 0;
7072 int cstart, previ = -1;7072 int cstart, previ = -1;
7073 7073
7074 /*7074 /*
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h+3−0
@@ -69,6 +69,9 @@ · 68 unmodified lines
69 */69 */
70#define PCI_DEVICE_ID_VMWARE_PVRDMA 0x082070#define PCI_DEVICE_ID_VMWARE_PVRDMA 0x0820
71 71
72#define PVRDMA_NUM_RING_PAGES 4
73#define PVRDMA_QP_NUM_HEADER_PAGES 1
74
72struct pvrdma_dev;75struct pvrdma_dev;
73 76
74struct pvrdma_page_dir {77struct pvrdma_page_dir {
drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h+1−1
@@ -132,7 +132,7 @@ enum pvrdma_pci_resource { · 131 unmodified lines
132 132
133enum pvrdma_device_ctl {133enum pvrdma_device_ctl {
134 PVRDMA_DEVICE_CTL_ACTIVATE, /* Activate device. */134 PVRDMA_DEVICE_CTL_ACTIVATE, /* Activate device. */
135 PVRDMA_DEVICE_CTL_QUIESCE, /* Quiesce device. */135 PVRDMA_DEVICE_CTL_UNQUIESCE, /* Unquiesce device. */
136 PVRDMA_DEVICE_CTL_RESET, /* Reset device. */136 PVRDMA_DEVICE_CTL_RESET, /* Reset device. */
137};137};
138 138
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c+13−4
@@ -56,7 +56,7 @@ · 55 unmodified lines
56#include "pvrdma.h"56#include "pvrdma.h"
57 57
58#define DRV_NAME "vmw_pvrdma"58#define DRV_NAME "vmw_pvrdma"
59#define DRV_VERSION "1.0.0.0-k"59#define DRV_VERSION "1.0.1.0-k"
60 60
61static DEFINE_MUTEX(pvrdma_device_list_lock);61static DEFINE_MUTEX(pvrdma_device_list_lock);
62static LIST_HEAD(pvrdma_device_list);62static LIST_HEAD(pvrdma_device_list);
@@ -660,7 +660,16 @@ static void pvrdma_netdevice_event_handle(struct pvrdma_dev *dev, · 597 unmodified lines
660 pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ERR);660 pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ERR);
661 break;661 break;
662 case NETDEV_UP:662 case NETDEV_UP:
663 pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ACTIVE);663 pvrdma_write_reg(dev, PVRDMA_REG_CTL,
664 PVRDMA_DEVICE_CTL_UNQUIESCE);
665
666 mb();
667
668 if (pvrdma_read_reg(dev, PVRDMA_REG_ERR))
669 dev_err(&dev->pdev->dev,
670 "failed to activate device during link up\n");
671 else
672 pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ACTIVE);
664 break;673 break;
665 default:674 default:
666 dev_dbg(&dev->pdev->dev, "ignore netdevice event %ld on %s\n",675 dev_dbg(&dev->pdev->dev, "ignore netdevice event %ld on %s\n",
@@ -858,7 +867,7 @@ static int pvrdma_pci_probe(struct pci_dev *pdev, · 191 unmodified lines
858 dev->dsr->resp_slot_dma = (u64)slot_dma;867 dev->dsr->resp_slot_dma = (u64)slot_dma;
859 868
860 /* Async event ring */869 /* Async event ring */
861 dev->dsr->async_ring_pages.num_pages = 4;870 dev->dsr->async_ring_pages.num_pages = PVRDMA_NUM_RING_PAGES;
862 ret = pvrdma_page_dir_init(dev, &dev->async_pdir,871 ret = pvrdma_page_dir_init(dev, &dev->async_pdir,
863 dev->dsr->async_ring_pages.num_pages, true);872 dev->dsr->async_ring_pages.num_pages, true);
864 if (ret)873 if (ret)
@@ -867,7 +876,7 @@ static int pvrdma_pci_probe(struct pci_dev *pdev, · 2 unmodified lines
867 dev->dsr->async_ring_pages.pdir_dma = dev->async_pdir.dir_dma;876 dev->dsr->async_ring_pages.pdir_dma = dev->async_pdir.dir_dma;
868 877
869 /* CQ notification ring */878 /* CQ notification ring */
870 dev->dsr->cq_ring_pages.num_pages = 4;879 dev->dsr->cq_ring_pages.num_pages = PVRDMA_NUM_RING_PAGES;
871 ret = pvrdma_page_dir_init(dev, &dev->cq_pdir,880 ret = pvrdma_page_dir_init(dev, &dev->cq_pdir,
872 dev->dsr->cq_ring_pages.num_pages, true);881 dev->dsr->cq_ring_pages.num_pages, true);
873 if (ret)882 if (ret)
drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c+18−24
@@ -170,8 +170,9 @@ static int pvrdma_set_sq_size(struct pvrdma_dev *dev, struct ib_qp_cap *req_cap, · 169 unmodified lines
170 sizeof(struct pvrdma_sge) *170 sizeof(struct pvrdma_sge) *
171 qp->sq.max_sg);171 qp->sq.max_sg);
172 /* Note: one extra page for the header. */172 /* Note: one extra page for the header. */
173 qp->npages_send = 1 + (qp->sq.wqe_cnt * qp->sq.wqe_size +173 qp->npages_send = PVRDMA_QP_NUM_HEADER_PAGES +
174 PAGE_SIZE - 1) / PAGE_SIZE;174 (qp->sq.wqe_cnt * qp->sq.wqe_size + PAGE_SIZE - 1) /
175 PAGE_SIZE;
175 176
176 return 0;177 return 0;
177}178}
@@ -288,7 +289,7 @@ struct ib_qp *pvrdma_create_qp(struct ib_pd *pd, · 110 unmodified lines
288 qp->npages = qp->npages_send + qp->npages_recv;289 qp->npages = qp->npages_send + qp->npages_recv;
289 290
290 /* Skip header page. */291 /* Skip header page. */
291 qp->sq.offset = PAGE_SIZE;292 qp->sq.offset = PVRDMA_QP_NUM_HEADER_PAGES * PAGE_SIZE;
292 293
293 /* Recv queue pages are after send pages. */294 /* Recv queue pages are after send pages. */
294 qp->rq.offset = qp->npages_send * PAGE_SIZE;295 qp->rq.offset = qp->npages_send * PAGE_SIZE;
@@ -341,7 +342,7 @@ struct ib_qp *pvrdma_create_qp(struct ib_pd *pd, · 46 unmodified lines
341 cmd->qp_type = ib_qp_type_to_pvrdma(init_attr->qp_type);342 cmd->qp_type = ib_qp_type_to_pvrdma(init_attr->qp_type);
342 cmd->access_flags = IB_ACCESS_LOCAL_WRITE;343 cmd->access_flags = IB_ACCESS_LOCAL_WRITE;
343 cmd->total_chunks = qp->npages;344 cmd->total_chunks = qp->npages;
344 cmd->send_chunks = qp->npages_send - 1;345 cmd->send_chunks = qp->npages_send - PVRDMA_QP_NUM_HEADER_PAGES;
345 cmd->pdir_dma = qp->pdir.dir_dma;346 cmd->pdir_dma = qp->pdir.dir_dma;
346 347
347 dev_dbg(&dev->pdev->dev, "create queuepair with %d, %d, %d, %d\n",348 dev_dbg(&dev->pdev->dev, "create queuepair with %d, %d, %d, %d\n",
@@ -554,13 +555,13 @@ out: · 206 unmodified lines
554 return ret;555 return ret;
555}556}
556 557
557static inline void *get_sq_wqe(struct pvrdma_qp *qp, int n)558static inline void *get_sq_wqe(struct pvrdma_qp *qp, unsigned int n)
558{559{
559 return pvrdma_page_dir_get_ptr(&qp->pdir,560 return pvrdma_page_dir_get_ptr(&qp->pdir,
560 qp->sq.offset + n * qp->sq.wqe_size);561 qp->sq.offset + n * qp->sq.wqe_size);
561}562}
562 563
563static inline void *get_rq_wqe(struct pvrdma_qp *qp, int n)564static inline void *get_rq_wqe(struct pvrdma_qp *qp, unsigned int n)
564{565{
565 return pvrdma_page_dir_get_ptr(&qp->pdir,566 return pvrdma_page_dir_get_ptr(&qp->pdir,
566 qp->rq.offset + n * qp->rq.wqe_size);567 qp->rq.offset + n * qp->rq.wqe_size);
@@ -598,9 +599,7 @@ int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 31 unmodified lines
598 unsigned long flags;599 unsigned long flags;
599 struct pvrdma_sq_wqe_hdr *wqe_hdr;600 struct pvrdma_sq_wqe_hdr *wqe_hdr;
600 struct pvrdma_sge *sge;601 struct pvrdma_sge *sge;
601 int i, index;602 int i, ret;
602 int nreq;
603 int ret;
604 603
605 /*604 /*
606 * In states lower than RTS, we can fail immediately. In other states,605 * In states lower than RTS, we can fail immediately. In other states,
@@ -613,9 +612,8 @@ int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 6 unmodified lines
613 612
614 spin_lock_irqsave(&qp->sq.lock, flags);613 spin_lock_irqsave(&qp->sq.lock, flags);
615 614
616 index = pvrdma_idx(&qp->sq.ring->prod_tail, qp->sq.wqe_cnt);615 while (wr) {
617 for (nreq = 0; wr; nreq++, wr = wr->next) {616 unsigned int tail = 0;
618 unsigned int tail;
619 617
620 if (unlikely(!pvrdma_idx_ring_has_space(618 if (unlikely(!pvrdma_idx_ring_has_space(
621 qp->sq.ring, qp->sq.wqe_cnt, &tail))) {619 qp->sq.ring, qp->sq.wqe_cnt, &tail))) {
@@ -680,7 +678,7 @@ int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 58 unmodified lines
680 }678 }
681 }679 }
682 680
683 wqe_hdr = (struct pvrdma_sq_wqe_hdr *)get_sq_wqe(qp, index);681 wqe_hdr = (struct pvrdma_sq_wqe_hdr *)get_sq_wqe(qp, tail);
684 memset(wqe_hdr, 0, sizeof(*wqe_hdr));682 memset(wqe_hdr, 0, sizeof(*wqe_hdr));
685 wqe_hdr->wr_id = wr->wr_id;683 wqe_hdr->wr_id = wr->wr_id;
686 wqe_hdr->num_sge = wr->num_sge;684 wqe_hdr->num_sge = wr->num_sge;
@@ -771,12 +769,11 @@ int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 84 unmodified lines
771 /* Make sure wqe is written before index update */769 /* Make sure wqe is written before index update */
772 smp_wmb();770 smp_wmb();
773 771
774 index++;
775 if (unlikely(index >= qp->sq.wqe_cnt))
776 index = 0;
777 /* Update shared sq ring */772 /* Update shared sq ring */
778 pvrdma_idx_ring_inc(&qp->sq.ring->prod_tail,773 pvrdma_idx_ring_inc(&qp->sq.ring->prod_tail,
779 qp->sq.wqe_cnt);774 qp->sq.wqe_cnt);
775
776 wr = wr->next;
780 }777 }
781 778
782 ret = 0;779 ret = 0;
@@ -806,7 +803,6 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, · 23 unmodified lines
806 struct pvrdma_qp *qp = to_vqp(ibqp);803 struct pvrdma_qp *qp = to_vqp(ibqp);
807 struct pvrdma_rq_wqe_hdr *wqe_hdr;804 struct pvrdma_rq_wqe_hdr *wqe_hdr;
808 struct pvrdma_sge *sge;805 struct pvrdma_sge *sge;
809 int index, nreq;
810 int ret = 0;806 int ret = 0;
811 int i;807 int i;
812 808
@@ -821,9 +817,8 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, · 8 unmodified lines
821 817
822 spin_lock_irqsave(&qp->rq.lock, flags);818 spin_lock_irqsave(&qp->rq.lock, flags);
823 819
824 index = pvrdma_idx(&qp->rq.ring->prod_tail, qp->rq.wqe_cnt);820 while (wr) {
825 for (nreq = 0; wr; nreq++, wr = wr->next) {821 unsigned int tail = 0;
826 unsigned int tail;
827 822
828 if (unlikely(wr->num_sge > qp->rq.max_sg ||823 if (unlikely(wr->num_sge > qp->rq.max_sg ||
829 wr->num_sge < 0)) {824 wr->num_sge < 0)) {
@@ -843,7 +838,7 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, · 13 unmodified lines
843 goto out;838 goto out;
844 }839 }
845 840
846 wqe_hdr = (struct pvrdma_rq_wqe_hdr *)get_rq_wqe(qp, index);841 wqe_hdr = (struct pvrdma_rq_wqe_hdr *)get_rq_wqe(qp, tail);
847 wqe_hdr->wr_id = wr->wr_id;842 wqe_hdr->wr_id = wr->wr_id;
848 wqe_hdr->num_sge = wr->num_sge;843 wqe_hdr->num_sge = wr->num_sge;
849 wqe_hdr->total_len = 0;844 wqe_hdr->total_len = 0;
@@ -859,12 +854,11 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, · 9 unmodified lines
859 /* Make sure wqe is written before index update */854 /* Make sure wqe is written before index update */
860 smp_wmb();855 smp_wmb();
861 856
862 index++;
863 if (unlikely(index >= qp->rq.wqe_cnt))
864 index = 0;
865 /* Update shared rq ring */857 /* Update shared rq ring */
866 pvrdma_idx_ring_inc(&qp->rq.ring->prod_tail,858 pvrdma_idx_ring_inc(&qp->rq.ring->prod_tail,
867 qp->rq.wqe_cnt);859 qp->rq.wqe_cnt);
860
861 wr = wr->next;
868 }862 }
869 863
870 spin_unlock_irqrestore(&qp->rq.lock, flags);864 spin_unlock_irqrestore(&qp->rq.lock, flags);
drivers/infiniband/sw/rdmavt/mmap.c+2−2
@@ -170,9 +170,9 @@ struct rvt_mmap_info *rvt_create_mmap_info(struct rvt_dev_info *rdi, · 169 unmodified lines
170 170
171 spin_lock_irq(&rdi->mmap_offset_lock);171 spin_lock_irq(&rdi->mmap_offset_lock);
172 if (rdi->mmap_offset == 0)172 if (rdi->mmap_offset == 0)
173 rdi->mmap_offset = PAGE_SIZE;173 rdi->mmap_offset = ALIGN(PAGE_SIZE, SHMLBA);
174 ip->offset = rdi->mmap_offset;174 ip->offset = rdi->mmap_offset;
175 rdi->mmap_offset += size;175 rdi->mmap_offset += ALIGN(size, SHMLBA);
176 spin_unlock_irq(&rdi->mmap_offset_lock);176 spin_unlock_irq(&rdi->mmap_offset_lock);
177 177
178 INIT_LIST_HEAD(&ip->pending_mmaps);178 INIT_LIST_HEAD(&ip->pending_mmaps);
drivers/infiniband/sw/rxe/Kconfig+1−1
@@ -22,4 +22,4 @@ config RDMA_RXE · 21 unmodified lines
22 To configure and work with soft-RoCE driver please use the22 To configure and work with soft-RoCE driver please use the
23 following wiki page under "configure Soft-RoCE (RXE)" section:23 following wiki page under "configure Soft-RoCE (RXE)" section:
24 24
25 https://github.com/SoftRoCE/rxe-dev/wiki/rxe-dev:-Home25 https://github.com/linux-rdma/rdma-core/blob/master/Documentation/rxe.md
drivers/infiniband/sw/rxe/rxe_mmap.c+2−2
@@ -156,10 +156,10 @@ struct rxe_mmap_info *rxe_create_mmap_info(struct rxe_dev *rxe, · 155 unmodified lines
156 spin_lock_bh(&rxe->mmap_offset_lock);156 spin_lock_bh(&rxe->mmap_offset_lock);
157 157
158 if (rxe->mmap_offset == 0)158 if (rxe->mmap_offset == 0)
159 rxe->mmap_offset = PAGE_SIZE;159 rxe->mmap_offset = ALIGN(PAGE_SIZE, SHMLBA);
160 160
161 ip->info.offset = rxe->mmap_offset;161 ip->info.offset = rxe->mmap_offset;
162 rxe->mmap_offset += size;162 rxe->mmap_offset += ALIGN(size, SHMLBA);
163 163
164 spin_unlock_bh(&rxe->mmap_offset_lock);164 spin_unlock_bh(&rxe->mmap_offset_lock);
165 165
drivers/infiniband/sw/rxe/rxe_req.c+1−1
@@ -729,11 +729,11 @@ next_wqe: · 728 unmodified lines
729 ret = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, &pkt, skb);729 ret = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, &pkt, skb);
730 if (ret) {730 if (ret) {
731 qp->need_req_skb = 1;731 qp->need_req_skb = 1;
732 kfree_skb(skb);
733 732
734 rollback_state(wqe, qp, &rollback_wqe, rollback_psn);733 rollback_state(wqe, qp, &rollback_wqe, rollback_psn);
735 734
736 if (ret == -EAGAIN) {735 if (ret == -EAGAIN) {
736 kfree_skb(skb);
737 rxe_run_task(&qp->req.task, 1);737 rxe_run_task(&qp->req.task, 1);
738 goto exit;738 goto exit;
739 }739 }
drivers/infiniband/sw/rxe/rxe_resp.c+4−5
@@ -813,18 +813,17 @@ static enum resp_states execute(struct rxe_qp *qp, struct rxe_pkt_info *pkt) · 812 unmodified lines
813 WARN_ON_ONCE(1);813 WARN_ON_ONCE(1);
814 }814 }
815 815
816 /* We successfully processed this new request. */
817 qp->resp.msn++;
818
819 /* next expected psn, read handles this separately */816 /* next expected psn, read handles this separately */
820 qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK;817 qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK;
821 818
822 qp->resp.opcode = pkt->opcode;819 qp->resp.opcode = pkt->opcode;
823 qp->resp.status = IB_WC_SUCCESS;820 qp->resp.status = IB_WC_SUCCESS;
824 821
825 if (pkt->mask & RXE_COMP_MASK)822 if (pkt->mask & RXE_COMP_MASK) {
823 /* We successfully processed this new request. */
824 qp->resp.msn++;
826 return RESPST_COMPLETE;825 return RESPST_COMPLETE;
827 else if (qp_type(qp) == IB_QPT_RC)826 } else if (qp_type(qp) == IB_QPT_RC)
828 return RESPST_ACKNOWLEDGE;827 return RESPST_ACKNOWLEDGE;
829 else828 else
830 return RESPST_CLEANUP;829 return RESPST_CLEANUP;
drivers/infiniband/ulp/iser/iscsi_iser.h+2−0
@@ -430,6 +430,7 @@ struct iser_fr_desc { · 429 unmodified lines
430 struct list_head list;430 struct list_head list;
431 struct iser_reg_resources rsc;431 struct iser_reg_resources rsc;
432 struct iser_pi_context *pi_ctx;432 struct iser_pi_context *pi_ctx;
433 struct list_head all_list;
433};434};
434 435
435/**436/**
@@ -443,6 +444,7 @@ struct iser_fr_pool { · 7 unmodified lines
443 struct list_head list;444 struct list_head list;
444 spinlock_t lock;445 spinlock_t lock;
445 int size;446 int size;
447 struct list_head all_list;
446};448};
447 449
448/**450/**
drivers/infiniband/ulp/iser/iser_verbs.c+5−3
@@ -362,6 +362,7 @@ int iser_alloc_fastreg_pool(struct ib_conn *ib_conn, · 361 unmodified lines
362 int i, ret;362 int i, ret;
363 363
364 INIT_LIST_HEAD(&fr_pool->list);364 INIT_LIST_HEAD(&fr_pool->list);
365 INIT_LIST_HEAD(&fr_pool->all_list);
365 spin_lock_init(&fr_pool->lock);366 spin_lock_init(&fr_pool->lock);
366 fr_pool->size = 0;367 fr_pool->size = 0;
367 for (i = 0; i < cmds_max; i++) {368 for (i = 0; i < cmds_max; i++) {
@@ -373,6 +374,7 @@ int iser_alloc_fastreg_pool(struct ib_conn *ib_conn, · 5 unmodified lines
373 }374 }
374 375
375 list_add_tail(&desc->list, &fr_pool->list);376 list_add_tail(&desc->list, &fr_pool->list);
377 list_add_tail(&desc->all_list, &fr_pool->all_list);
376 fr_pool->size++;378 fr_pool->size++;
377 }379 }
378 380
@@ -392,13 +394,13 @@ void iser_free_fastreg_pool(struct ib_conn *ib_conn) · 13 unmodified lines
392 struct iser_fr_desc *desc, *tmp;394 struct iser_fr_desc *desc, *tmp;
393 int i = 0;395 int i = 0;
394 396
395 if (list_empty(&fr_pool->list))397 if (list_empty(&fr_pool->all_list))
396 return;398 return;
397 399
398 iser_info("freeing conn %p fr pool\n", ib_conn);400 iser_info("freeing conn %p fr pool\n", ib_conn);
399 401
400 list_for_each_entry_safe(desc, tmp, &fr_pool->list, list) {402 list_for_each_entry_safe(desc, tmp, &fr_pool->all_list, all_list) {
401 list_del(&desc->list);403 list_del(&desc->all_list);
402 iser_free_reg_res(&desc->rsc);404 iser_free_reg_res(&desc->rsc);
403 if (desc->pi_ctx)405 if (desc->pi_ctx)
404 iser_free_pi_ctx(desc->pi_ctx);406 iser_free_pi_ctx(desc->pi_ctx);
include/rdma/ib_verbs.h+17−13
@@ -1863,6 +1863,9 @@ struct ib_port_immutable { · 1862 unmodified lines
1863};1863};
1864 1864
1865struct ib_device {1865struct ib_device {
1866 /* Do not access @dma_device directly from ULP nor from HW drivers. */
1867 struct device *dma_device;
1868
1866 char name[IB_DEVICE_NAME_MAX];1869 char name[IB_DEVICE_NAME_MAX];
1867 1870
1868 struct list_head event_handler_list;1871 struct list_head event_handler_list;
@@ -3007,7 +3010,7 @@ static inline int ib_req_ncomp_notif(struct ib_cq *cq, int wc_cnt) · 1138 unmodified lines
3007 */3010 */
3008static inline int ib_dma_mapping_error(struct ib_device *dev, u64 dma_addr)3011static inline int ib_dma_mapping_error(struct ib_device *dev, u64 dma_addr)
3009{3012{
3010 return dma_mapping_error(&dev->dev, dma_addr);3013 return dma_mapping_error(dev->dma_device, dma_addr);
3011}3014}
3012 3015
3013/**3016/**
@@ -3021,7 +3024,7 @@ static inline u64 ib_dma_map_single(struct ib_device *dev, · 7 unmodified lines
3021 void *cpu_addr, size_t size,3024 void *cpu_addr, size_t size,
3022 enum dma_data_direction direction)3025 enum dma_data_direction direction)
3023{3026{
3024 return dma_map_single(&dev->dev, cpu_addr, size, direction);3027 return dma_map_single(dev->dma_device, cpu_addr, size, direction);
3025}3028}
3026 3029
3027/**3030/**
@@ -3035,7 +3038,7 @@ static inline void ib_dma_unmap_single(struct ib_device *dev, · 7 unmodified lines
3035 u64 addr, size_t size,3038 u64 addr, size_t size,
3036 enum dma_data_direction direction)3039 enum dma_data_direction direction)
3037{3040{
3038 dma_unmap_single(&dev->dev, addr, size, direction);3041 dma_unmap_single(dev->dma_device, addr, size, direction);
3039}3042}
3040 3043
3041/**3044/**
@@ -3052,7 +3055,7 @@ static inline u64 ib_dma_map_page(struct ib_device *dev, · 10 unmodified lines
3052 size_t size,3055 size_t size,
3053 enum dma_data_direction direction)3056 enum dma_data_direction direction)
3054{3057{
3055 return dma_map_page(&dev->dev, page, offset, size, direction);3058 return dma_map_page(dev->dma_device, page, offset, size, direction);
3056}3059}
3057 3060
3058/**3061/**
@@ -3066,7 +3069,7 @@ static inline void ib_dma_unmap_page(struct ib_device *dev, · 7 unmodified lines
3066 u64 addr, size_t size,3069 u64 addr, size_t size,
3067 enum dma_data_direction direction)3070 enum dma_data_direction direction)
3068{3071{
3069 dma_unmap_page(&dev->dev, addr, size, direction);3072 dma_unmap_page(dev->dma_device, addr, size, direction);
3070}3073}
3071 3074
3072/**3075/**
@@ -3080,7 +3083,7 @@ static inline int ib_dma_map_sg(struct ib_device *dev, · 7 unmodified lines
3080 struct scatterlist *sg, int nents,3083 struct scatterlist *sg, int nents,
3081 enum dma_data_direction direction)3084 enum dma_data_direction direction)
3082{3085{
3083 return dma_map_sg(&dev->dev, sg, nents, direction);3086 return dma_map_sg(dev->dma_device, sg, nents, direction);
3084}3087}
3085 3088
3086/**3089/**
@@ -3094,7 +3097,7 @@ static inline void ib_dma_unmap_sg(struct ib_device *dev, · 7 unmodified lines
3094 struct scatterlist *sg, int nents,3097 struct scatterlist *sg, int nents,
3095 enum dma_data_direction direction)3098 enum dma_data_direction direction)
3096{3099{
3097 dma_unmap_sg(&dev->dev, sg, nents, direction);3100 dma_unmap_sg(dev->dma_device, sg, nents, direction);
3098}3101}
3099 3102
3100static inline int ib_dma_map_sg_attrs(struct ib_device *dev,3103static inline int ib_dma_map_sg_attrs(struct ib_device *dev,
@@ -3102,7 +3105,8 @@ static inline int ib_dma_map_sg_attrs(struct ib_device *dev, · 1 unmodified line
3102 enum dma_data_direction direction,3105 enum dma_data_direction direction,
3103 unsigned long dma_attrs)3106 unsigned long dma_attrs)
3104{3107{
3105 return dma_map_sg_attrs(&dev->dev, sg, nents, direction, dma_attrs);3108 return dma_map_sg_attrs(dev->dma_device, sg, nents, direction,
3109 dma_attrs);
3106}3110}
3107 3111
3108static inline void ib_dma_unmap_sg_attrs(struct ib_device *dev,3112static inline void ib_dma_unmap_sg_attrs(struct ib_device *dev,
@@ -3110,7 +3114,7 @@ static inline void ib_dma_unmap_sg_attrs(struct ib_device *dev, · 1 unmodified line
3110 enum dma_data_direction direction,3114 enum dma_data_direction direction,
3111 unsigned long dma_attrs)3115 unsigned long dma_attrs)
3112{3116{
3113 dma_unmap_sg_attrs(&dev->dev, sg, nents, direction, dma_attrs);3117 dma_unmap_sg_attrs(dev->dma_device, sg, nents, direction, dma_attrs);
3114}3118}
3115/**3119/**
3116 * ib_sg_dma_address - Return the DMA address from a scatter/gather entry3120 * ib_sg_dma_address - Return the DMA address from a scatter/gather entry
@@ -3152,7 +3156,7 @@ static inline void ib_dma_sync_single_for_cpu(struct ib_device *dev, · 35 unmodified lines
3152 size_t size,3156 size_t size,
3153 enum dma_data_direction dir)3157 enum dma_data_direction dir)
3154{3158{
3155 dma_sync_single_for_cpu(&dev->dev, addr, size, dir);3159 dma_sync_single_for_cpu(dev->dma_device, addr, size, dir);
3156}3160}
3157 3161
3158/**3162/**
@@ -3167,7 +3171,7 @@ static inline void ib_dma_sync_single_for_device(struct ib_device *dev, · 8 unmodified lines
3167 size_t size,3171 size_t size,
3168 enum dma_data_direction dir)3172 enum dma_data_direction dir)
3169{3173{
3170 dma_sync_single_for_device(&dev->dev, addr, size, dir);3174 dma_sync_single_for_device(dev->dma_device, addr, size, dir);
3171}3175}
3172 3176
3173/**3177/**
@@ -3182,7 +3186,7 @@ static inline void *ib_dma_alloc_coherent(struct ib_device *dev, · 8 unmodified lines
3182 dma_addr_t *dma_handle,3186 dma_addr_t *dma_handle,
3183 gfp_t flag)3187 gfp_t flag)
3184{3188{
3185 return dma_alloc_coherent(&dev->dev, size, dma_handle, flag);3189 return dma_alloc_coherent(dev->dma_device, size, dma_handle, flag);
3186}3190}
3187 3191
3188/**3192/**
@@ -3196,7 +3200,7 @@ static inline void ib_dma_free_coherent(struct ib_device *dev, · 7 unmodified lines
3196 size_t size, void *cpu_addr,3200 size_t size, void *cpu_addr,
3197 dma_addr_t dma_handle)3201 dma_addr_t dma_handle)
3198{3202{
3199 dma_free_coherent(&dev->dev, size, cpu_addr, dma_handle);3203 dma_free_coherent(dev->dma_device, size, cpu_addr, dma_handle);
3200}3204}
3201 3205
3202/**3206/**
include/uapi/rdma/mlx5-abi.h+2−1
@@ -34,6 +34,7 @@ · 33 unmodified lines
34#define MLX5_ABI_USER_H34#define MLX5_ABI_USER_H
35 35
36#include <linux/types.h>36#include <linux/types.h>
37#include <linux/if_ether.h> /* For ETH_ALEN. */
37 38
38enum {39enum {
39 MLX5_QP_FLAG_SIGNATURE = 1 << 0,40 MLX5_QP_FLAG_SIGNATURE = 1 << 0,
@@ -66,7 +67,7 @@ struct mlx5_ib_alloc_ucontext_req { · 26 unmodified lines
66};67};
67 68
68enum mlx5_lib_caps {69enum mlx5_lib_caps {
69 MLX5_LIB_CAP_4K_UAR = (u64)1 << 0,70 MLX5_LIB_CAP_4K_UAR = (__u64)1 << 0,
70};71};
71 72
72struct mlx5_ib_alloc_ucontext_req_v2 {73struct mlx5_ib_alloc_ucontext_req_v2 {