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
2929 {
3030 int i, n, completed = 0;
3131
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) {
3339 for (i = 0; i < n; i++) {
3440 struct ib_wc *wc = &cq->wc[i];
3541
@@ -196,7 +202,7 @@ void ib_free_cq(struct ib_cq *cq) · 160 unmodified lines
196202 irq_poll_disable(&cq->iop);
197203 break;
198204 case IB_POLL_WORKQUEUE:
199− flush_work(&cq->work);
205+ cancel_work_sync(&cq->work);
200206 break;
201207 default:
202208 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
336336 struct device *parent = device->dev.parent;
337337
338338 WARN_ON_ONCE(!parent);
339− if (!device->dev.dma_ops)
340− device->dev.dma_ops = parent->dma_ops;
341− if (!device->dev.dma_mask)
342− device->dev.dma_mask = parent->dma_mask;
343− if (!device->dev.coherent_dma_mask)
344− device->dev.coherent_dma_mask = parent->coherent_dma_mask;
339+ WARN_ON_ONCE(device->dma_device);
340+ if (device->dev.dma_ops) {
341+ /*
342+ * The caller provided custom DMA operations. Copy the
343+ * DMA-related fields that are used by e.g. dma_alloc_coherent()
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+ }
345359
346360 mutex_lock(&device_mutex);
347361
@@ -1015,8 +1029,7 @@ static int __init ib_core_init(void) · 667 unmodified lines
10151029 return -ENOMEM;
10161030
10171031 ib_comp_wq = alloc_workqueue("ib-comp-wq",
1018− WQ_UNBOUND | WQ_HIGHPRI | WQ_MEM_RECLAIM,
1019− WQ_UNBOUND_MAX_ACTIVE);
1032+ WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
10201033 if (!ib_comp_wq) {
10211034 ret = -ENOMEM;
10221035 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
160160 return NOTIFY_DONE;
161161
162162 iwdev = &hdl->device;
163+ if (iwdev->init_state < INET_NOTIFIER)
164+ return NOTIFY_DONE;
165+
163166 netdev = iwdev->ldev->netdev;
164167 upper_dev = netdev_master_upper_dev_get(netdev);
165168 if (netdev != event_netdev)
@@ -214,6 +217,9 @@ int i40iw_inet6addr_event(struct notifier_block *notifier, · 48 unmodified lines
214217 return NOTIFY_DONE;
215218
216219 iwdev = &hdl->device;
220+ if (iwdev->init_state < INET_NOTIFIER)
221+ return NOTIFY_DONE;
222+
217223 netdev = iwdev->ldev->netdev;
218224 if (netdev != event_netdev)
219225 return NOTIFY_DONE;
@@ -260,6 +266,8 @@ int i40iw_net_event(struct notifier_block *notifier, unsigned long event, void * · 40 unmodified lines
260266 if (!iwhdl)
261267 return NOTIFY_DONE;
262268 iwdev = &iwhdl->device;
269+ if (iwdev->init_state < INET_NOTIFIER)
270+ return NOTIFY_DONE;
263271 p = (__be32 *)neigh->primary_key;
264272 i40iw_copy_ip_ntohl(local_ipaddr, p);
265273 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
372372 return 0;
373373 }
374374
375−static u8 ocrdma_put_pd_num(struct ocrdma_dev *dev, u16 pd_id,
375+static int ocrdma_put_pd_num(struct ocrdma_dev *dev, u16 pd_id,
376376 bool dpp_pool)
377377 {
378378 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
70687068 unsigned long flags;
70697069
70707070 while (wait) {
7071− unsigned long shadow;
7071+ unsigned long shadow = 0;
70727072 int cstart, previ = -1;
70737073
70747074 /*
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h+3−0
@@ -69,6 +69,9 @@ · 68 unmodified lines
6969 */
7070 #define PCI_DEVICE_ID_VMWARE_PVRDMA 0x0820
7171
72+#define PVRDMA_NUM_RING_PAGES 4
73+#define PVRDMA_QP_NUM_HEADER_PAGES 1
74+
7275 struct pvrdma_dev;
7376
7477 struct 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
132132
133133 enum pvrdma_device_ctl {
134134 PVRDMA_DEVICE_CTL_ACTIVATE, /* Activate device. */
135− PVRDMA_DEVICE_CTL_QUIESCE, /* Quiesce device. */
135+ PVRDMA_DEVICE_CTL_UNQUIESCE, /* Unquiesce device. */
136136 PVRDMA_DEVICE_CTL_RESET, /* Reset device. */
137137 };
138138
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c+13−4
@@ -56,7 +56,7 @@ · 55 unmodified lines
5656 #include "pvrdma.h"
5757
5858 #define DRV_NAME "vmw_pvrdma"
59−#define DRV_VERSION "1.0.0.0-k"
59+#define DRV_VERSION "1.0.1.0-k"
6060
6161 static DEFINE_MUTEX(pvrdma_device_list_lock);
6262 static LIST_HEAD(pvrdma_device_list);
@@ -660,7 +660,16 @@ static void pvrdma_netdevice_event_handle(struct pvrdma_dev *dev, · 597 unmodified lines
660660 pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ERR);
661661 break;
662662 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);
664673 break;
665674 default:
666675 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
858867 dev->dsr->resp_slot_dma = (u64)slot_dma;
859868
860869 /* Async event ring */
861− dev->dsr->async_ring_pages.num_pages = 4;
870+ dev->dsr->async_ring_pages.num_pages = PVRDMA_NUM_RING_PAGES;
862871 ret = pvrdma_page_dir_init(dev, &dev->async_pdir,
863872 dev->dsr->async_ring_pages.num_pages, true);
864873 if (ret)
@@ -867,7 +876,7 @@ static int pvrdma_pci_probe(struct pci_dev *pdev, · 2 unmodified lines
867876 dev->dsr->async_ring_pages.pdir_dma = dev->async_pdir.dir_dma;
868877
869878 /* CQ notification ring */
870− dev->dsr->cq_ring_pages.num_pages = 4;
879+ dev->dsr->cq_ring_pages.num_pages = PVRDMA_NUM_RING_PAGES;
871880 ret = pvrdma_page_dir_init(dev, &dev->cq_pdir,
872881 dev->dsr->cq_ring_pages.num_pages, true);
873882 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
170170 sizeof(struct pvrdma_sge) *
171171 qp->sq.max_sg);
172172 /* Note: one extra page for the header. */
173− qp->npages_send = 1 + (qp->sq.wqe_cnt * qp->sq.wqe_size +
174− PAGE_SIZE - 1) / PAGE_SIZE;
173+ qp->npages_send = PVRDMA_QP_NUM_HEADER_PAGES +
174+ (qp->sq.wqe_cnt * qp->sq.wqe_size + PAGE_SIZE - 1) /
175+ PAGE_SIZE;
175176
176177 return 0;
177178 }
@@ -288,7 +289,7 @@ struct ib_qp *pvrdma_create_qp(struct ib_pd *pd, · 110 unmodified lines
288289 qp->npages = qp->npages_send + qp->npages_recv;
289290
290291 /* Skip header page. */
291− qp->sq.offset = PAGE_SIZE;
292+ qp->sq.offset = PVRDMA_QP_NUM_HEADER_PAGES * PAGE_SIZE;
292293
293294 /* Recv queue pages are after send pages. */
294295 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
341342 cmd->qp_type = ib_qp_type_to_pvrdma(init_attr->qp_type);
342343 cmd->access_flags = IB_ACCESS_LOCAL_WRITE;
343344 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;
345346 cmd->pdir_dma = qp->pdir.dir_dma;
346347
347348 dev_dbg(&dev->pdev->dev, "create queuepair with %d, %d, %d, %d\n",
@@ -554,13 +555,13 @@ out: · 206 unmodified lines
554555 return ret;
555556 }
556557
557−static inline void *get_sq_wqe(struct pvrdma_qp *qp, int n)
558+static inline void *get_sq_wqe(struct pvrdma_qp *qp, unsigned int n)
558559 {
559560 return pvrdma_page_dir_get_ptr(&qp->pdir,
560561 qp->sq.offset + n * qp->sq.wqe_size);
561562 }
562563
563−static inline void *get_rq_wqe(struct pvrdma_qp *qp, int n)
564+static inline void *get_rq_wqe(struct pvrdma_qp *qp, unsigned int n)
564565 {
565566 return pvrdma_page_dir_get_ptr(&qp->pdir,
566567 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
598599 unsigned long flags;
599600 struct pvrdma_sq_wqe_hdr *wqe_hdr;
600601 struct pvrdma_sge *sge;
601− int i, index;
602− int nreq;
603− int ret;
602+ int i, ret;
604603
605604 /*
606605 * 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
613612
614613 spin_lock_irqsave(&qp->sq.lock, flags);
615614
616− index = pvrdma_idx(&qp->sq.ring->prod_tail, qp->sq.wqe_cnt);
617− for (nreq = 0; wr; nreq++, wr = wr->next) {
618− unsigned int tail;
615+ while (wr) {
616+ unsigned int tail = 0;
619617
620618 if (unlikely(!pvrdma_idx_ring_has_space(
621619 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
680678 }
681679 }
682680
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);
684682 memset(wqe_hdr, 0, sizeof(*wqe_hdr));
685683 wqe_hdr->wr_id = wr->wr_id;
686684 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
771769 /* Make sure wqe is written before index update */
772770 smp_wmb();
773771
774− index++;
775− if (unlikely(index >= qp->sq.wqe_cnt))
776− index = 0;
777772 /* Update shared sq ring */
778773 pvrdma_idx_ring_inc(&qp->sq.ring->prod_tail,
779774 qp->sq.wqe_cnt);
775+
776+ wr = wr->next;
780777 }
781778
782779 ret = 0;
@@ -806,7 +803,6 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, · 23 unmodified lines
806803 struct pvrdma_qp *qp = to_vqp(ibqp);
807804 struct pvrdma_rq_wqe_hdr *wqe_hdr;
808805 struct pvrdma_sge *sge;
809− int index, nreq;
810806 int ret = 0;
811807 int i;
812808
@@ -821,9 +817,8 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, · 8 unmodified lines
821817
822818 spin_lock_irqsave(&qp->rq.lock, flags);
823819
824− index = pvrdma_idx(&qp->rq.ring->prod_tail, qp->rq.wqe_cnt);
825− for (nreq = 0; wr; nreq++, wr = wr->next) {
826− unsigned int tail;
820+ while (wr) {
821+ unsigned int tail = 0;
827822
828823 if (unlikely(wr->num_sge > qp->rq.max_sg ||
829824 wr->num_sge < 0)) {
@@ -843,7 +838,7 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, · 13 unmodified lines
843838 goto out;
844839 }
845840
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);
847842 wqe_hdr->wr_id = wr->wr_id;
848843 wqe_hdr->num_sge = wr->num_sge;
849844 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
859854 /* Make sure wqe is written before index update */
860855 smp_wmb();
861856
862− index++;
863− if (unlikely(index >= qp->rq.wqe_cnt))
864− index = 0;
865857 /* Update shared rq ring */
866858 pvrdma_idx_ring_inc(&qp->rq.ring->prod_tail,
867859 qp->rq.wqe_cnt);
860+
861+ wr = wr->next;
868862 }
869863
870864 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
170170
171171 spin_lock_irq(&rdi->mmap_offset_lock);
172172 if (rdi->mmap_offset == 0)
173− rdi->mmap_offset = PAGE_SIZE;
173+ rdi->mmap_offset = ALIGN(PAGE_SIZE, SHMLBA);
174174 ip->offset = rdi->mmap_offset;
175− rdi->mmap_offset += size;
175+ rdi->mmap_offset += ALIGN(size, SHMLBA);
176176 spin_unlock_irq(&rdi->mmap_offset_lock);
177177
178178 INIT_LIST_HEAD(&ip->pending_mmaps);
drivers/infiniband/sw/rxe/Kconfig+1−1
@@ -22,4 +22,4 @@ config RDMA_RXE · 21 unmodified lines
2222 To configure and work with soft-RoCE driver please use the
2323 following wiki page under "configure Soft-RoCE (RXE)" section:
2424
25− https://github.com/SoftRoCE/rxe-dev/wiki/rxe-dev:-Home
25+ 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
156156 spin_lock_bh(&rxe->mmap_offset_lock);
157157
158158 if (rxe->mmap_offset == 0)
159− rxe->mmap_offset = PAGE_SIZE;
159+ rxe->mmap_offset = ALIGN(PAGE_SIZE, SHMLBA);
160160
161161 ip->info.offset = rxe->mmap_offset;
162− rxe->mmap_offset += size;
162+ rxe->mmap_offset += ALIGN(size, SHMLBA);
163163
164164 spin_unlock_bh(&rxe->mmap_offset_lock);
165165
drivers/infiniband/sw/rxe/rxe_req.c+1−1
@@ -729,11 +729,11 @@ next_wqe: · 728 unmodified lines
729729 ret = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, &pkt, skb);
730730 if (ret) {
731731 qp->need_req_skb = 1;
732− kfree_skb(skb);
733732
734733 rollback_state(wqe, qp, &rollback_wqe, rollback_psn);
735734
736735 if (ret == -EAGAIN) {
736+ kfree_skb(skb);
737737 rxe_run_task(&qp->req.task, 1);
738738 goto exit;
739739 }
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
813813 WARN_ON_ONCE(1);
814814 }
815815
816− /* We successfully processed this new request. */
817− qp->resp.msn++;
818−
819816 /* next expected psn, read handles this separately */
820817 qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK;
821818
822819 qp->resp.opcode = pkt->opcode;
823820 qp->resp.status = IB_WC_SUCCESS;
824821
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++;
826825 return RESPST_COMPLETE;
827− else if (qp_type(qp) == IB_QPT_RC)
826+ } else if (qp_type(qp) == IB_QPT_RC)
828827 return RESPST_ACKNOWLEDGE;
829828 else
830829 return RESPST_CLEANUP;
drivers/infiniband/ulp/iser/iscsi_iser.h+2−0
@@ -430,6 +430,7 @@ struct iser_fr_desc { · 429 unmodified lines
430430 struct list_head list;
431431 struct iser_reg_resources rsc;
432432 struct iser_pi_context *pi_ctx;
433+ struct list_head all_list;
433434 };
434435
435436 /**
@@ -443,6 +444,7 @@ struct iser_fr_pool { · 7 unmodified lines
443444 struct list_head list;
444445 spinlock_t lock;
445446 int size;
447+ struct list_head all_list;
446448 };
447449
448450 /**
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
362362 int i, ret;
363363
364364 INIT_LIST_HEAD(&fr_pool->list);
365+ INIT_LIST_HEAD(&fr_pool->all_list);
365366 spin_lock_init(&fr_pool->lock);
366367 fr_pool->size = 0;
367368 for (i = 0; i < cmds_max; i++) {
@@ -373,6 +374,7 @@ int iser_alloc_fastreg_pool(struct ib_conn *ib_conn, · 5 unmodified lines
373374 }
374375
375376 list_add_tail(&desc->list, &fr_pool->list);
377+ list_add_tail(&desc->all_list, &fr_pool->all_list);
376378 fr_pool->size++;
377379 }
378380
@@ -392,13 +394,13 @@ void iser_free_fastreg_pool(struct ib_conn *ib_conn) · 13 unmodified lines
392394 struct iser_fr_desc *desc, *tmp;
393395 int i = 0;
394396
395− if (list_empty(&fr_pool->list))
397+ if (list_empty(&fr_pool->all_list))
396398 return;
397399
398400 iser_info("freeing conn %p fr pool\n", ib_conn);
399401
400− list_for_each_entry_safe(desc, tmp, &fr_pool->list, list) {
401− list_del(&desc->list);
402+ list_for_each_entry_safe(desc, tmp, &fr_pool->all_list, all_list) {
403+ list_del(&desc->all_list);
402404 iser_free_reg_res(&desc->rsc);
403405 if (desc->pi_ctx)
404406 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
18631863 };
18641864
18651865 struct ib_device {
1866+ /* Do not access @dma_device directly from ULP nor from HW drivers. */
1867+ struct device *dma_device;
1868+
18661869 char name[IB_DEVICE_NAME_MAX];
18671870
18681871 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
30073010 */
30083011 static inline int ib_dma_mapping_error(struct ib_device *dev, u64 dma_addr)
30093012 {
3010− return dma_mapping_error(&dev->dev, dma_addr);
3013+ return dma_mapping_error(dev->dma_device, dma_addr);
30113014 }
30123015
30133016 /**
@@ -3021,7 +3024,7 @@ static inline u64 ib_dma_map_single(struct ib_device *dev, · 7 unmodified lines
30213024 void *cpu_addr, size_t size,
30223025 enum dma_data_direction direction)
30233026 {
3024− return dma_map_single(&dev->dev, cpu_addr, size, direction);
3027+ return dma_map_single(dev->dma_device, cpu_addr, size, direction);
30253028 }
30263029
30273030 /**
@@ -3035,7 +3038,7 @@ static inline void ib_dma_unmap_single(struct ib_device *dev, · 7 unmodified lines
30353038 u64 addr, size_t size,
30363039 enum dma_data_direction direction)
30373040 {
3038− dma_unmap_single(&dev->dev, addr, size, direction);
3041+ dma_unmap_single(dev->dma_device, addr, size, direction);
30393042 }
30403043
30413044 /**
@@ -3052,7 +3055,7 @@ static inline u64 ib_dma_map_page(struct ib_device *dev, · 10 unmodified lines
30523055 size_t size,
30533056 enum dma_data_direction direction)
30543057 {
3055− return dma_map_page(&dev->dev, page, offset, size, direction);
3058+ return dma_map_page(dev->dma_device, page, offset, size, direction);
30563059 }
30573060
30583061 /**
@@ -3066,7 +3069,7 @@ static inline void ib_dma_unmap_page(struct ib_device *dev, · 7 unmodified lines
30663069 u64 addr, size_t size,
30673070 enum dma_data_direction direction)
30683071 {
3069− dma_unmap_page(&dev->dev, addr, size, direction);
3072+ dma_unmap_page(dev->dma_device, addr, size, direction);
30703073 }
30713074
30723075 /**
@@ -3080,7 +3083,7 @@ static inline int ib_dma_map_sg(struct ib_device *dev, · 7 unmodified lines
30803083 struct scatterlist *sg, int nents,
30813084 enum dma_data_direction direction)
30823085 {
3083− return dma_map_sg(&dev->dev, sg, nents, direction);
3086+ return dma_map_sg(dev->dma_device, sg, nents, direction);
30843087 }
30853088
30863089 /**
@@ -3094,7 +3097,7 @@ static inline void ib_dma_unmap_sg(struct ib_device *dev, · 7 unmodified lines
30943097 struct scatterlist *sg, int nents,
30953098 enum dma_data_direction direction)
30963099 {
3097− dma_unmap_sg(&dev->dev, sg, nents, direction);
3100+ dma_unmap_sg(dev->dma_device, sg, nents, direction);
30983101 }
30993102
31003103 static 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
31023105 enum dma_data_direction direction,
31033106 unsigned long dma_attrs)
31043107 {
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);
31063110 }
31073111
31083112 static 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
31103114 enum dma_data_direction direction,
31113115 unsigned long dma_attrs)
31123116 {
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);
31143118 }
31153119 /**
31163120 * 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
31523156 size_t size,
31533157 enum dma_data_direction dir)
31543158 {
3155− dma_sync_single_for_cpu(&dev->dev, addr, size, dir);
3159+ dma_sync_single_for_cpu(dev->dma_device, addr, size, dir);
31563160 }
31573161
31583162 /**
@@ -3167,7 +3171,7 @@ static inline void ib_dma_sync_single_for_device(struct ib_device *dev, · 8 unmodified lines
31673171 size_t size,
31683172 enum dma_data_direction dir)
31693173 {
3170− dma_sync_single_for_device(&dev->dev, addr, size, dir);
3174+ dma_sync_single_for_device(dev->dma_device, addr, size, dir);
31713175 }
31723176
31733177 /**
@@ -3182,7 +3186,7 @@ static inline void *ib_dma_alloc_coherent(struct ib_device *dev, · 8 unmodified lines
31823186 dma_addr_t *dma_handle,
31833187 gfp_t flag)
31843188 {
3185− return dma_alloc_coherent(&dev->dev, size, dma_handle, flag);
3189+ return dma_alloc_coherent(dev->dma_device, size, dma_handle, flag);
31863190 }
31873191
31883192 /**
@@ -3196,7 +3200,7 @@ static inline void ib_dma_free_coherent(struct ib_device *dev, · 7 unmodified lines
31963200 size_t size, void *cpu_addr,
31973201 dma_addr_t dma_handle)
31983202 {
3199− dma_free_coherent(&dev->dev, size, cpu_addr, dma_handle);
3203+ dma_free_coherent(dev->dma_device, size, cpu_addr, dma_handle);
32003204 }
32013205
32023206 /**
include/uapi/rdma/mlx5-abi.h+2−1
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #define MLX5_ABI_USER_H
3535
3636 #include <linux/types.h>
37+#include <linux/if_ether.h> /* For ETH_ALEN. */
3738
3839 enum {
3940 MLX5_QP_FLAG_SIGNATURE = 1 << 0,
@@ -66,7 +67,7 @@ struct mlx5_ib_alloc_ucontext_req { · 26 unmodified lines
6667 };
6768
6869 enum mlx5_lib_caps {
69− MLX5_LIB_CAP_4K_UAR = (u64)1 << 0,
70+ MLX5_LIB_CAP_4K_UAR = (__u64)1 << 0,
7071 };
7172
7273 struct mlx5_ib_alloc_ucontext_req_v2 {