Skip to content

Commit 34b48b8

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Jason Gunthorpe: "This is pretty much just the usual array of smallish driver bugs. - remove bouncing addresses from the MAINTAINERS file - kernel oops and bad error handling fixes for hfi, i40iw, cxgb4, and hns drivers - various small LOC behavioral/operational bugs in mlx5, hns, qedr and i40iw drivers - two fixes for patches already sent during the merge window - a long-standing bug related to not decreasing the pinned pages count in the right MM was found and fixed" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (28 commits) RDMA/hns: Move the location for initializing tmp_len RDMA/hns: Bugfix for cq record db for kernel IB/uverbs: Fix uverbs_attr_get_obj RDMA/qedr: Fix doorbell bar mapping for dpi > 1 IB/umem: Use the correct mm during ib_umem_release iw_cxgb4: Fix an error handling path in 'c4iw_get_dma_mr()' RDMA/i40iw: Avoid panic when reading back the IRQ affinity hint RDMA/i40iw: Avoid reference leaks when processing the AEQ RDMA/i40iw: Avoid panic when objects are being created and destroyed RDMA/hns: Fix the bug with NULL pointer RDMA/hns: Set NULL for __internal_mr RDMA/hns: Enable inner_pa_vld filed of mpt RDMA/hns: Set desc_dma_addr for zero when free cmq desc RDMA/hns: Fix the bug with rq sge RDMA/hns: Not support qp transition from reset to reset for hip06 RDMA/hns: Add return operation when configured global param fail RDMA/hns: Update convert function of endian format RDMA/hns: Load the RoCE dirver automatically RDMA/hns: Bugfix for rq record db for kernel RDMA/hns: Add rq inline flags judgement ...
2 parents d7b66b4 + 55ba49c commit 34b48b8

File tree

29 files changed

+116
-98
lines changed

29 files changed

+116
-98
lines changed

MAINTAINERS

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5388,7 +5388,6 @@ S: Maintained
53885388
F: drivers/iommu/exynos-iommu.c
53895389

53905390
EZchip NPS platform support
5391-
M: Elad Kanfi <[email protected]>
53925391
M: Vineet Gupta <[email protected]>
53935392
S: Supported
53945393
F: arch/arc/plat-eznps
@@ -9021,7 +9020,6 @@ Q: http://patchwork.ozlabs.org/project/netdev/list/
90219020
F: drivers/net/ethernet/mellanox/mlx5/core/en_*
90229021

90239022
MELLANOX ETHERNET INNOVA DRIVER
9024-
M: Ilan Tayari <[email protected]>
90259023
R: Boris Pismenny <[email protected]>
90269024
90279025
S: Supported
@@ -9031,7 +9029,6 @@ F: drivers/net/ethernet/mellanox/mlx5/core/fpga/*
90319029
F: include/linux/mlx5/mlx5_ifc_fpga.h
90329030

90339031
MELLANOX ETHERNET INNOVA IPSEC DRIVER
9034-
M: Ilan Tayari <[email protected]>
90359032
R: Boris Pismenny <[email protected]>
90369033
90379034
S: Supported
@@ -9087,7 +9084,6 @@ F: include/uapi/rdma/mlx4-abi.h
90879084

90889085
MELLANOX MLX5 core VPI driver
90899086
M: Saeed Mahameed <[email protected]>
9090-
M: Matan Barak <[email protected]>
90919087
M: Leon Romanovsky <[email protected]>
90929088
90939089
@@ -9098,7 +9094,6 @@ F: drivers/net/ethernet/mellanox/mlx5/core/
90989094
F: include/linux/mlx5/
90999095

91009096
MELLANOX MLX5 IB driver
9101-
M: Matan Barak <[email protected]>
91029097
M: Leon Romanovsky <[email protected]>
91039098
91049099
W: http://www.mellanox.com
@@ -9832,7 +9827,6 @@ F: net/netfilter/xt_CONNSECMARK.c
98329827
F: net/netfilter/xt_SECMARK.c
98339828

98349829
NETWORKING [TLS]
9835-
M: Ilya Lesokhin <[email protected]>
98369830
M: Aviad Yehezkel <[email protected]>
98379831
M: Dave Watson <[email protected]>
98389832

drivers/infiniband/core/umem.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
119119
umem->length = size;
120120
umem->address = addr;
121121
umem->page_shift = PAGE_SHIFT;
122-
umem->pid = get_task_pid(current, PIDTYPE_PID);
123122
/*
124123
* We ask for writable memory if any of the following
125124
* access flags are set. "Local write" and "remote write"
@@ -132,7 +131,6 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
132131
IB_ACCESS_REMOTE_ATOMIC | IB_ACCESS_MW_BIND));
133132

134133
if (access & IB_ACCESS_ON_DEMAND) {
135-
put_pid(umem->pid);
136134
ret = ib_umem_odp_get(context, umem, access);
137135
if (ret) {
138136
kfree(umem);
@@ -148,7 +146,6 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
148146

149147
page_list = (struct page **) __get_free_page(GFP_KERNEL);
150148
if (!page_list) {
151-
put_pid(umem->pid);
152149
kfree(umem);
153150
return ERR_PTR(-ENOMEM);
154151
}
@@ -231,7 +228,6 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
231228
if (ret < 0) {
232229
if (need_release)
233230
__ib_umem_release(context->device, umem, 0);
234-
put_pid(umem->pid);
235231
kfree(umem);
236232
} else
237233
current->mm->pinned_vm = locked;
@@ -274,8 +270,7 @@ void ib_umem_release(struct ib_umem *umem)
274270

275271
__ib_umem_release(umem->context->device, umem, 1);
276272

277-
task = get_pid_task(umem->pid, PIDTYPE_PID);
278-
put_pid(umem->pid);
273+
task = get_pid_task(umem->context->tgid, PIDTYPE_PID);
279274
if (!task)
280275
goto out;
281276
mm = get_task_mm(task);

drivers/infiniband/hw/cxgb4/mem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,10 @@ struct ib_mr *c4iw_get_dma_mr(struct ib_pd *pd, int acc)
489489
err_dereg_mem:
490490
dereg_mem(&rhp->rdev, mhp->attr.stag, mhp->attr.pbl_size,
491491
mhp->attr.pbl_addr, mhp->dereg_skb, mhp->wr_waitp);
492-
err_free_wr_wait:
493-
c4iw_put_wr_wait(mhp->wr_waitp);
494492
err_free_skb:
495493
kfree_skb(mhp->dereg_skb);
494+
err_free_wr_wait:
495+
c4iw_put_wr_wait(mhp->wr_waitp);
496496
err_free_mhp:
497497
kfree(mhp);
498498
return ERR_PTR(ret);

drivers/infiniband/hw/hfi1/chip.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5944,6 +5944,7 @@ static void is_sendctxt_err_int(struct hfi1_devdata *dd,
59445944
u64 status;
59455945
u32 sw_index;
59465946
int i = 0;
5947+
unsigned long irq_flags;
59475948

59485949
sw_index = dd->hw_to_sw[hw_context];
59495950
if (sw_index >= dd->num_send_contexts) {
@@ -5953,10 +5954,12 @@ static void is_sendctxt_err_int(struct hfi1_devdata *dd,
59535954
return;
59545955
}
59555956
sci = &dd->send_contexts[sw_index];
5957+
spin_lock_irqsave(&dd->sc_lock, irq_flags);
59565958
sc = sci->sc;
59575959
if (!sc) {
59585960
dd_dev_err(dd, "%s: context %u(%u): no sc?\n", __func__,
59595961
sw_index, hw_context);
5962+
spin_unlock_irqrestore(&dd->sc_lock, irq_flags);
59605963
return;
59615964
}
59625965

@@ -5978,6 +5981,7 @@ static void is_sendctxt_err_int(struct hfi1_devdata *dd,
59785981
*/
59795982
if (sc->type != SC_USER)
59805983
queue_work(dd->pport->hfi1_wq, &sc->halt_work);
5984+
spin_unlock_irqrestore(&dd->sc_lock, irq_flags);
59815985

59825986
/*
59835987
* Update the counters for the corresponding status bits.

drivers/infiniband/hw/hns/hns_roce_cq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ struct ib_cq *hns_roce_ib_create_cq(struct ib_device *ib_dev,
377377

378378
hr_cq->set_ci_db = hr_cq->db.db_record;
379379
*hr_cq->set_ci_db = 0;
380+
hr_cq->db_en = 1;
380381
}
381382

382383
/* Init mmt table and write buff address to mtt table */

drivers/infiniband/hw/hns/hns_roce_hw_v1.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,7 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev)
722722
free_mr->mr_free_pd = to_hr_pd(pd);
723723
free_mr->mr_free_pd->ibpd.device = &hr_dev->ib_dev;
724724
free_mr->mr_free_pd->ibpd.uobject = NULL;
725+
free_mr->mr_free_pd->ibpd.__internal_mr = NULL;
725726
atomic_set(&free_mr->mr_free_pd->ibpd.usecnt, 0);
726727

727728
attr.qp_access_flags = IB_ACCESS_REMOTE_WRITE;
@@ -1036,7 +1037,7 @@ static void hns_roce_v1_mr_free_work_fn(struct work_struct *work)
10361037

10371038
do {
10381039
ret = hns_roce_v1_poll_cq(&mr_free_cq->ib_cq, ne, wc);
1039-
if (ret < 0) {
1040+
if (ret < 0 && hr_qp) {
10401041
dev_err(dev,
10411042
"(qp:0x%lx) starts, Poll cqe failed(%d) for mr 0x%x free! Remain %d cqe\n",
10421043
hr_qp->qpn, ret, hr_mr->key, ne);

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
142142
unsigned long flags;
143143
unsigned int ind;
144144
void *wqe = NULL;
145-
u32 tmp_len = 0;
146145
bool loopback;
146+
u32 tmp_len;
147147
int ret = 0;
148148
u8 *smac;
149149
int nreq;
@@ -189,6 +189,7 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
189189

190190
owner_bit =
191191
~(((qp->sq.head + nreq) >> ilog2(qp->sq.wqe_cnt)) & 0x1);
192+
tmp_len = 0;
192193

193194
/* Corresponding to the QP type, wqe process separately */
194195
if (ibqp->qp_type == IB_QPT_GSI) {
@@ -547,16 +548,20 @@ static int hns_roce_v2_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,
547548
}
548549

549550
if (i < hr_qp->rq.max_gs) {
550-
dseg[i].lkey = cpu_to_le32(HNS_ROCE_INVALID_LKEY);
551-
dseg[i].addr = 0;
551+
dseg->lkey = cpu_to_le32(HNS_ROCE_INVALID_LKEY);
552+
dseg->addr = 0;
552553
}
553554

554555
/* rq support inline data */
555-
sge_list = hr_qp->rq_inl_buf.wqe_list[ind].sg_list;
556-
hr_qp->rq_inl_buf.wqe_list[ind].sge_cnt = (u32)wr->num_sge;
557-
for (i = 0; i < wr->num_sge; i++) {
558-
sge_list[i].addr = (void *)(u64)wr->sg_list[i].addr;
559-
sge_list[i].len = wr->sg_list[i].length;
556+
if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_RQ_INLINE) {
557+
sge_list = hr_qp->rq_inl_buf.wqe_list[ind].sg_list;
558+
hr_qp->rq_inl_buf.wqe_list[ind].sge_cnt =
559+
(u32)wr->num_sge;
560+
for (i = 0; i < wr->num_sge; i++) {
561+
sge_list[i].addr =
562+
(void *)(u64)wr->sg_list[i].addr;
563+
sge_list[i].len = wr->sg_list[i].length;
564+
}
560565
}
561566

562567
hr_qp->rq.wrid[ind] = wr->wr_id;
@@ -613,6 +618,8 @@ static void hns_roce_free_cmq_desc(struct hns_roce_dev *hr_dev,
613618
dma_unmap_single(hr_dev->dev, ring->desc_dma_addr,
614619
ring->desc_num * sizeof(struct hns_roce_cmq_desc),
615620
DMA_BIDIRECTIONAL);
621+
622+
ring->desc_dma_addr = 0;
616623
kfree(ring->desc);
617624
}
618625

@@ -1081,6 +1088,7 @@ static int hns_roce_v2_profile(struct hns_roce_dev *hr_dev)
10811088
if (ret) {
10821089
dev_err(hr_dev->dev, "Configure global param fail, ret = %d.\n",
10831090
ret);
1091+
return ret;
10841092
}
10851093

10861094
/* Get pf resource owned by every pf */
@@ -1372,6 +1380,8 @@ static int hns_roce_v2_write_mtpt(void *mb_buf, struct hns_roce_mr *mr,
13721380

13731381
roce_set_bit(mpt_entry->byte_12_mw_pa, V2_MPT_BYTE_12_PA_S,
13741382
mr->type == MR_TYPE_MR ? 0 : 1);
1383+
roce_set_bit(mpt_entry->byte_12_mw_pa, V2_MPT_BYTE_12_INNER_PA_VLD_S,
1384+
1);
13751385
mpt_entry->byte_12_mw_pa = cpu_to_le32(mpt_entry->byte_12_mw_pa);
13761386

13771387
mpt_entry->len_l = cpu_to_le32(lower_32_bits(mr->size));
@@ -2169,6 +2179,7 @@ static void modify_qp_reset_to_init(struct ib_qp *ibqp,
21692179
struct hns_roce_v2_qp_context *context,
21702180
struct hns_roce_v2_qp_context *qpc_mask)
21712181
{
2182+
struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device);
21722183
struct hns_roce_qp *hr_qp = to_hr_qp(ibqp);
21732184

21742185
/*
@@ -2281,7 +2292,8 @@ static void modify_qp_reset_to_init(struct ib_qp *ibqp,
22812292
context->rq_db_record_addr = hr_qp->rdb.dma >> 32;
22822293
qpc_mask->rq_db_record_addr = 0;
22832294

2284-
roce_set_bit(context->byte_76_srqn_op_en, V2_QPC_BYTE_76_RQIE_S, 1);
2295+
roce_set_bit(context->byte_76_srqn_op_en, V2_QPC_BYTE_76_RQIE_S,
2296+
(hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_RQ_INLINE) ? 1 : 0);
22852297
roce_set_bit(qpc_mask->byte_76_srqn_op_en, V2_QPC_BYTE_76_RQIE_S, 0);
22862298

22872299
roce_set_field(context->byte_80_rnr_rx_cqn, V2_QPC_BYTE_80_RX_CQN_M,
@@ -4703,6 +4715,8 @@ static const struct pci_device_id hns_roce_hw_v2_pci_tbl[] = {
47034715
{0, }
47044716
};
47054717

4718+
MODULE_DEVICE_TABLE(pci, hns_roce_hw_v2_pci_tbl);
4719+
47064720
static int hns_roce_hw_v2_get_cfg(struct hns_roce_dev *hr_dev,
47074721
struct hnae3_handle *handle)
47084722
{

drivers/infiniband/hw/hns/hns_roce_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static int hns_roce_query_device(struct ib_device *ib_dev,
199199

200200
memset(props, 0, sizeof(*props));
201201

202-
props->sys_image_guid = cpu_to_be32(hr_dev->sys_image_guid);
202+
props->sys_image_guid = cpu_to_be64(hr_dev->sys_image_guid);
203203
props->max_mr_size = (u64)(~(0ULL));
204204
props->page_size_cap = hr_dev->caps.page_size_cap;
205205
props->vendor_id = hr_dev->vendor_id;

drivers/infiniband/hw/hns/hns_roce_qp.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev,
660660
goto err_rq_sge_list;
661661
}
662662
*hr_qp->rdb.db_record = 0;
663+
hr_qp->rdb_en = 1;
663664
}
664665

665666
/* Allocate QP buf */
@@ -955,7 +956,14 @@ int hns_roce_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
955956
}
956957

957958
if (cur_state == new_state && cur_state == IB_QPS_RESET) {
958-
ret = 0;
959+
if (hr_dev->caps.min_wqes) {
960+
ret = -EPERM;
961+
dev_err(dev, "cur_state=%d new_state=%d\n", cur_state,
962+
new_state);
963+
} else {
964+
ret = 0;
965+
}
966+
959967
goto out;
960968
}
961969

drivers/infiniband/hw/i40iw/i40iw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ struct i40iw_msix_vector {
207207
u32 irq;
208208
u32 cpu_affinity;
209209
u32 ceq_id;
210+
cpumask_t mask;
210211
};
211212

212213
struct l2params_work {

drivers/infiniband/hw/i40iw/i40iw_cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2093,7 +2093,7 @@ static int i40iw_addr_resolve_neigh_ipv6(struct i40iw_device *iwdev,
20932093
if (netif_is_bond_slave(netdev))
20942094
netdev = netdev_master_upper_dev_get(netdev);
20952095

2096-
neigh = dst_neigh_lookup(dst, &dst_addr);
2096+
neigh = dst_neigh_lookup(dst, dst_addr.sin6_addr.in6_u.u6_addr32);
20972097

20982098
rcu_read_lock();
20992099
if (neigh) {

drivers/infiniband/hw/i40iw/i40iw_hw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ void i40iw_process_aeq(struct i40iw_device *iwdev)
331331
switch (info->ae_id) {
332332
case I40IW_AE_LLP_FIN_RECEIVED:
333333
if (qp->term_flags)
334-
continue;
334+
break;
335335
if (atomic_inc_return(&iwqp->close_timer_started) == 1) {
336336
iwqp->hw_tcp_state = I40IW_TCP_STATE_CLOSE_WAIT;
337337
if ((iwqp->hw_tcp_state == I40IW_TCP_STATE_CLOSE_WAIT) &&
@@ -360,7 +360,7 @@ void i40iw_process_aeq(struct i40iw_device *iwdev)
360360
break;
361361
case I40IW_AE_LLP_CONNECTION_RESET:
362362
if (atomic_read(&iwqp->close_timer_started))
363-
continue;
363+
break;
364364
i40iw_cm_disconn(iwqp);
365365
break;
366366
case I40IW_AE_QP_SUSPEND_COMPLETE:

drivers/infiniband/hw/i40iw/i40iw_main.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,6 @@ static enum i40iw_status_code i40iw_configure_ceq_vector(struct i40iw_device *iw
687687
struct i40iw_msix_vector *msix_vec)
688688
{
689689
enum i40iw_status_code status;
690-
cpumask_t mask;
691690

692691
if (iwdev->msix_shared && !ceq_id) {
693692
tasklet_init(&iwdev->dpc_tasklet, i40iw_dpc, (unsigned long)iwdev);
@@ -697,9 +696,9 @@ static enum i40iw_status_code i40iw_configure_ceq_vector(struct i40iw_device *iw
697696
status = request_irq(msix_vec->irq, i40iw_ceq_handler, 0, "CEQ", iwceq);
698697
}
699698

700-
cpumask_clear(&mask);
701-
cpumask_set_cpu(msix_vec->cpu_affinity, &mask);
702-
irq_set_affinity_hint(msix_vec->irq, &mask);
699+
cpumask_clear(&msix_vec->mask);
700+
cpumask_set_cpu(msix_vec->cpu_affinity, &msix_vec->mask);
701+
irq_set_affinity_hint(msix_vec->irq, &msix_vec->mask);
703702

704703
if (status) {
705704
i40iw_pr_err("ceq irq config fail\n");

0 commit comments

Comments
 (0)