Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma updates from Jason Gunthorpe: "A smaller cycle this time. Notably we see another new driver, 'Soft iWarp', and the deletion of an ancient unused driver for nes. - Revise and simplify the signature offload RDMA MR APIs - More progress on hoisting object allocation boiler plate code out of the drivers - Driver bug fixes and revisions for hns, hfi1, efa, cxgb4, qib, i40iw - Tree wide cleanups: struct_size, put_user_page, xarray, rst doc conversion - Removal of obsolete ib_ucm chardev and nes driver - netlink based discovery of chardevs and autoloading of the modules providing them - Move more of the rdamvt/hfi1 uapi to include/uapi/rdma - New driver 'siw' for software based iWarp running on top of netdev, much like rxe's software RoCE. - mlx5 feature to report events in their raw devx format to userspace - Expose per-object counters through rdma tool - Adaptive interrupt moderation for RDMA (DIM), sharing the DIM core from netdev" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (194 commits) RMDA/siw: Require a 64 bit arch RDMA/siw: Mark expected switch fall-throughs RDMA/core: Fix -Wunused-const-variable warnings rdma/siw: Remove set but not used variable 's' rdma/siw: Add missing dependencies on LIBCRC32C and DMA_VIRT_OPS RDMA/siw: Add missing rtnl_lock around access to ifa rdma/siw: Use proper enumerated type in map_cqe_status RDMA/siw: Remove unnecessary kthread create/destroy printouts IB/rdmavt: Fix variable shadowing issue in rvt_create_cq RDMA/core: Fix race when resolving IP address RDMA/core: Make rdma_counter.h compile stand alone IB/core: Work on the caller socket net namespace in nldev_newlink() RDMA/rxe: Fill in wc byte_len with IB_WC_RECV_RDMA_WITH_IMM RDMA/mlx5: Set RDMA DIM to be enabled by default RDMA/nldev: Added configuration of RDMA dynamic interrupt moderation to netlink RDMA/core: Provide RDMA DIM support for ULPs linux/dim: Implement RDMA adaptive moderation (DIM) IB/mlx5: Report correctly tag matching rendezvous capability docs: infiniband: add it to the driver-api bookset IB/mlx5: Implement VHCA tunnel mechanism in DEVX ...
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012 - 2017 Intel Corporation. All rights reserved.
|
||||
* Copyright (c) 2012 - 2019 Intel Corporation. All rights reserved.
|
||||
* Copyright (c) 2006 - 2012 QLogic Corporation. * All rights reserved.
|
||||
* Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
|
||||
*
|
||||
@@ -398,7 +398,7 @@ int qib_check_send_wqe(struct rvt_qp *qp,
|
||||
case IB_QPT_SMI:
|
||||
case IB_QPT_GSI:
|
||||
case IB_QPT_UD:
|
||||
ah = ibah_to_rvtah(wqe->ud_wr.ah);
|
||||
ah = rvt_get_swqe_ah(wqe);
|
||||
if (wqe->length > (1 << ah->log_pmtu))
|
||||
return -EINVAL;
|
||||
/* progress hint */
|
||||
|
@@ -921,20 +921,11 @@ void qib_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr)
|
||||
rvt_add_retry_timer(qp);
|
||||
|
||||
while (qp->s_last != qp->s_acked) {
|
||||
u32 s_last;
|
||||
|
||||
wqe = rvt_get_swqe_ptr(qp, qp->s_last);
|
||||
if (qib_cmp24(wqe->lpsn, qp->s_sending_psn) >= 0 &&
|
||||
qib_cmp24(qp->s_sending_psn, qp->s_sending_hpsn) <= 0)
|
||||
break;
|
||||
s_last = qp->s_last;
|
||||
if (++s_last >= qp->s_size)
|
||||
s_last = 0;
|
||||
qp->s_last = s_last;
|
||||
/* see post_send() */
|
||||
barrier();
|
||||
rvt_put_qp_swqe(qp, wqe);
|
||||
rvt_qp_swqe_complete(qp,
|
||||
rvt_qp_complete_swqe(qp,
|
||||
wqe,
|
||||
ib_qib_wc_opcode[wqe->wr.opcode],
|
||||
IB_WC_SUCCESS);
|
||||
@@ -972,21 +963,12 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp,
|
||||
* is finished.
|
||||
*/
|
||||
if (qib_cmp24(wqe->lpsn, qp->s_sending_psn) < 0 ||
|
||||
qib_cmp24(qp->s_sending_psn, qp->s_sending_hpsn) > 0) {
|
||||
u32 s_last;
|
||||
|
||||
rvt_put_qp_swqe(qp, wqe);
|
||||
s_last = qp->s_last;
|
||||
if (++s_last >= qp->s_size)
|
||||
s_last = 0;
|
||||
qp->s_last = s_last;
|
||||
/* see post_send() */
|
||||
barrier();
|
||||
rvt_qp_swqe_complete(qp,
|
||||
qib_cmp24(qp->s_sending_psn, qp->s_sending_hpsn) > 0)
|
||||
rvt_qp_complete_swqe(qp,
|
||||
wqe,
|
||||
ib_qib_wc_opcode[wqe->wr.opcode],
|
||||
IB_WC_SUCCESS);
|
||||
} else
|
||||
else
|
||||
this_cpu_inc(*ibp->rvp.rc_delayed_comp);
|
||||
|
||||
qp->s_retry = qp->s_retry_cnt;
|
||||
@@ -1909,8 +1891,7 @@ send_last:
|
||||
wc.dlid_path_bits = 0;
|
||||
wc.port_num = 0;
|
||||
/* Signal completion event if the solicited bit is set. */
|
||||
rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc,
|
||||
ib_bth_is_solicited(ohdr));
|
||||
rvt_recv_cq(qp, &wc, ib_bth_is_solicited(ohdr));
|
||||
break;
|
||||
|
||||
case OP(RDMA_WRITE_FIRST):
|
||||
|
@@ -400,8 +400,7 @@ last_imm:
|
||||
wc.dlid_path_bits = 0;
|
||||
wc.port_num = 0;
|
||||
/* Signal completion event if the solicited bit is set. */
|
||||
rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc,
|
||||
ib_bth_is_solicited(ohdr));
|
||||
rvt_recv_cq(qp, &wc, ib_bth_is_solicited(ohdr));
|
||||
break;
|
||||
|
||||
case OP(RDMA_WRITE_FIRST):
|
||||
|
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012 - 2019 Intel Corporation. All rights reserved.
|
||||
* Copyright (c) 2006, 2007, 2008, 2009 QLogic Corporation. All rights reserved.
|
||||
* Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
|
||||
*
|
||||
@@ -63,7 +64,7 @@ static void qib_ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
|
||||
enum ib_qp_type sqptype, dqptype;
|
||||
|
||||
rcu_read_lock();
|
||||
qp = rvt_lookup_qpn(rdi, &ibp->rvp, swqe->ud_wr.remote_qpn);
|
||||
qp = rvt_lookup_qpn(rdi, &ibp->rvp, rvt_get_swqe_remote_qpn(swqe));
|
||||
if (!qp) {
|
||||
ibp->rvp.n_pkt_drops++;
|
||||
goto drop;
|
||||
@@ -80,7 +81,7 @@ static void qib_ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
|
||||
goto drop;
|
||||
}
|
||||
|
||||
ah_attr = &ibah_to_rvtah(swqe->ud_wr.ah)->attr;
|
||||
ah_attr = rvt_get_swqe_ah_attr(swqe);
|
||||
ppd = ppd_from_ibp(ibp);
|
||||
|
||||
if (qp->ibqp.qp_num > 1) {
|
||||
@@ -110,8 +111,8 @@ static void qib_ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
|
||||
if (qp->ibqp.qp_num) {
|
||||
u32 qkey;
|
||||
|
||||
qkey = (int)swqe->ud_wr.remote_qkey < 0 ?
|
||||
sqp->qkey : swqe->ud_wr.remote_qkey;
|
||||
qkey = (int)rvt_get_swqe_remote_qkey(swqe) < 0 ?
|
||||
sqp->qkey : rvt_get_swqe_remote_qkey(swqe);
|
||||
if (unlikely(qkey != qp->qkey))
|
||||
goto drop;
|
||||
}
|
||||
@@ -203,15 +204,14 @@ static void qib_ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
|
||||
wc.qp = &qp->ibqp;
|
||||
wc.src_qp = sqp->ibqp.qp_num;
|
||||
wc.pkey_index = qp->ibqp.qp_type == IB_QPT_GSI ?
|
||||
swqe->ud_wr.pkey_index : 0;
|
||||
rvt_get_swqe_pkey_index(swqe) : 0;
|
||||
wc.slid = ppd->lid | (rdma_ah_get_path_bits(ah_attr) &
|
||||
((1 << ppd->lmc) - 1));
|
||||
wc.sl = rdma_ah_get_sl(ah_attr);
|
||||
wc.dlid_path_bits = rdma_ah_get_dlid(ah_attr) & ((1 << ppd->lmc) - 1);
|
||||
wc.port_num = qp->port_num;
|
||||
/* Signal completion event if the solicited bit is set. */
|
||||
rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc,
|
||||
swqe->wr.send_flags & IB_SEND_SOLICITED);
|
||||
rvt_recv_cq(qp, &wc, swqe->wr.send_flags & IB_SEND_SOLICITED);
|
||||
ibp->rvp.n_loop_pkts++;
|
||||
bail_unlock:
|
||||
spin_unlock_irqrestore(&qp->r_lock, flags);
|
||||
@@ -271,7 +271,7 @@ int qib_make_ud_req(struct rvt_qp *qp, unsigned long *flags)
|
||||
/* Construct the header. */
|
||||
ibp = to_iport(qp->ibqp.device, qp->port_num);
|
||||
ppd = ppd_from_ibp(ibp);
|
||||
ah_attr = &ibah_to_rvtah(wqe->ud_wr.ah)->attr;
|
||||
ah_attr = rvt_get_swqe_ah_attr(wqe);
|
||||
if (rdma_ah_get_dlid(ah_attr) >= be16_to_cpu(IB_MULTICAST_LID_BASE)) {
|
||||
if (rdma_ah_get_dlid(ah_attr) !=
|
||||
be16_to_cpu(IB_LID_PERMISSIVE))
|
||||
@@ -363,7 +363,7 @@ int qib_make_ud_req(struct rvt_qp *qp, unsigned long *flags)
|
||||
bth0 |= extra_bytes << 20;
|
||||
bth0 |= qp->ibqp.qp_type == IB_QPT_SMI ? QIB_DEFAULT_P_KEY :
|
||||
qib_get_pkey(ibp, qp->ibqp.qp_type == IB_QPT_GSI ?
|
||||
wqe->ud_wr.pkey_index : qp->s_pkey_index);
|
||||
rvt_get_swqe_pkey_index(wqe) : qp->s_pkey_index);
|
||||
ohdr->bth[0] = cpu_to_be32(bth0);
|
||||
/*
|
||||
* Use the multicast QP if the destination LID is a multicast LID.
|
||||
@@ -372,14 +372,15 @@ int qib_make_ud_req(struct rvt_qp *qp, unsigned long *flags)
|
||||
be16_to_cpu(IB_MULTICAST_LID_BASE) &&
|
||||
rdma_ah_get_dlid(ah_attr) != be16_to_cpu(IB_LID_PERMISSIVE) ?
|
||||
cpu_to_be32(QIB_MULTICAST_QPN) :
|
||||
cpu_to_be32(wqe->ud_wr.remote_qpn);
|
||||
cpu_to_be32(rvt_get_swqe_remote_qpn(wqe));
|
||||
ohdr->bth[2] = cpu_to_be32(wqe->psn & QIB_PSN_MASK);
|
||||
/*
|
||||
* Qkeys with the high order bit set mean use the
|
||||
* qkey from the QP context instead of the WR (see 10.2.5).
|
||||
*/
|
||||
ohdr->u.ud.deth[0] = cpu_to_be32((int)wqe->ud_wr.remote_qkey < 0 ?
|
||||
qp->qkey : wqe->ud_wr.remote_qkey);
|
||||
ohdr->u.ud.deth[0] =
|
||||
cpu_to_be32((int)rvt_get_swqe_remote_qkey(wqe) < 0 ? qp->qkey :
|
||||
rvt_get_swqe_remote_qkey(wqe));
|
||||
ohdr->u.ud.deth[1] = cpu_to_be32(qp->ibqp.qp_num);
|
||||
|
||||
done:
|
||||
@@ -573,8 +574,7 @@ void qib_ud_rcv(struct qib_ibport *ibp, struct ib_header *hdr,
|
||||
dlid & ((1 << ppd_from_ibp(ibp)->lmc) - 1);
|
||||
wc.port_num = qp->port_num;
|
||||
/* Signal completion event if the solicited bit is set. */
|
||||
rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc,
|
||||
ib_bth_is_solicited(ohdr));
|
||||
rvt_recv_cq(qp, &wc, ib_bth_is_solicited(ohdr));
|
||||
return;
|
||||
|
||||
drop:
|
||||
|
@@ -40,13 +40,10 @@
|
||||
static void __qib_release_user_pages(struct page **p, size_t num_pages,
|
||||
int dirty)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < num_pages; i++) {
|
||||
if (dirty)
|
||||
set_page_dirty_lock(p[i]);
|
||||
put_page(p[i]);
|
||||
}
|
||||
if (dirty)
|
||||
put_user_pages_dirty_lock(p, num_pages);
|
||||
else
|
||||
put_user_pages(p, num_pages);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -317,7 +317,7 @@ static int qib_user_sdma_page_to_frags(const struct qib_devdata *dd,
|
||||
* the caller can ignore this page.
|
||||
*/
|
||||
if (put) {
|
||||
put_page(page);
|
||||
put_user_page(page);
|
||||
} else {
|
||||
/* coalesce case */
|
||||
kunmap(page);
|
||||
@@ -631,7 +631,7 @@ static void qib_user_sdma_free_pkt_frag(struct device *dev,
|
||||
kunmap(pkt->addr[i].page);
|
||||
|
||||
if (pkt->addr[i].put_page)
|
||||
put_page(pkt->addr[i].page);
|
||||
put_user_page(pkt->addr[i].page);
|
||||
else
|
||||
__free_page(pkt->addr[i].page);
|
||||
} else if (pkt->addr[i].kvaddr) {
|
||||
@@ -706,7 +706,7 @@ static int qib_user_sdma_pin_pages(const struct qib_devdata *dd,
|
||||
/* if error, return all pages not managed by pkt */
|
||||
free_pages:
|
||||
while (i < j)
|
||||
put_page(pages[i++]);
|
||||
put_user_page(pages[i++]);
|
||||
|
||||
done:
|
||||
return ret;
|
||||
@@ -904,10 +904,11 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd,
|
||||
}
|
||||
|
||||
if (frag_size) {
|
||||
int pktsize, tidsmsize, n;
|
||||
int tidsmsize, n;
|
||||
size_t pktsize;
|
||||
|
||||
n = npages*((2*PAGE_SIZE/frag_size)+1);
|
||||
pktsize = sizeof(*pkt) + sizeof(pkt->addr[0])*n;
|
||||
pktsize = struct_size(pkt, addr, n);
|
||||
|
||||
/*
|
||||
* Determine if this is tid-sdma or just sdma.
|
||||
|
@@ -1480,6 +1480,9 @@ static void qib_fill_device_attr(struct qib_devdata *dd)
|
||||
}
|
||||
|
||||
static const struct ib_device_ops qib_dev_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
.driver_id = RDMA_DRIVER_QIB,
|
||||
|
||||
.init_port = qib_create_port_files,
|
||||
.modify_device = qib_modify_device,
|
||||
.process_mad = qib_process_mad,
|
||||
@@ -1543,7 +1546,6 @@ int qib_register_ib_device(struct qib_devdata *dd)
|
||||
if (!ib_qib_sys_image_guid)
|
||||
ib_qib_sys_image_guid = ppd->guid;
|
||||
|
||||
ibdev->owner = THIS_MODULE;
|
||||
ibdev->node_guid = ppd->guid;
|
||||
ibdev->phys_port_cnt = dd->num_pports;
|
||||
ibdev->dev.parent = &dd->pcidev->dev;
|
||||
@@ -1614,7 +1616,7 @@ int qib_register_ib_device(struct qib_devdata *dd)
|
||||
rdma_set_device_sysfs_group(&dd->verbs_dev.rdi.ibdev, &qib_attr_group);
|
||||
|
||||
ib_set_device_ops(ibdev, &qib_dev_ops);
|
||||
ret = rvt_register_device(&dd->verbs_dev.rdi, RDMA_DRIVER_QIB);
|
||||
ret = rvt_register_device(&dd->verbs_dev.rdi);
|
||||
if (ret)
|
||||
goto err_tx;
|
||||
|
||||
|
مرجع در شماره جدید
Block a user