Skip to content

Commit e10db79

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Doug Ledford: "We have 5 small fixes for this pull request. One is a performance regression, so not necessarily strictly a fix, but it was small and reasonable and claimed to avoid thrashing in the scheduler, so I took it. The remaining are all legitimate fixes that match the "we take fixes any time" criteria. Summary: - One performance regression for hfi1 - One kasan fix for hfi1 - A couple mlx5 fixes - A core oops fix" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: IB/core: Fix oops in netdev_next_upper_dev_rcu() IB/mlx5: Block DEVX umem from the non applicable cases IB/mlx5: Fix implicit ODP interrupted page fault IB/hfi1: Fix an out-of-bounds access in get_hw_stats IB/hfi1: Fix a latency issue for small messages
2 parents e861e11 + 37fbd83 commit e10db79

File tree

7 files changed

+22
-8
lines changed

7 files changed

+22
-8
lines changed

drivers/infiniband/core/roce_gid_mgmt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ is_upper_ndev_bond_master_filter(struct ib_device *ib_dev, u8 port,
267267
struct net_device *cookie_ndev = cookie;
268268
bool match = false;
269269

270+
if (!rdma_ndev)
271+
return false;
272+
270273
rcu_read_lock();
271274
if (netif_is_bond_master(cookie_ndev) &&
272275
rdma_is_upper_dev_rcu(rdma_ndev, cookie_ndev))

drivers/infiniband/hw/hfi1/chip.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12500,7 +12500,8 @@ static int init_cntrs(struct hfi1_devdata *dd)
1250012500
}
1250112501

1250212502
/* allocate space for the counter values */
12503-
dd->cntrs = kcalloc(dd->ndevcntrs, sizeof(u64), GFP_KERNEL);
12503+
dd->cntrs = kcalloc(dd->ndevcntrs + num_driver_cntrs, sizeof(u64),
12504+
GFP_KERNEL);
1250412505
if (!dd->cntrs)
1250512506
goto bail;
1250612507

drivers/infiniband/hw/hfi1/hfi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ struct hfi1_ib_stats {
155155
extern struct hfi1_ib_stats hfi1_stats;
156156
extern const struct pci_error_handlers hfi1_pci_err_handler;
157157

158+
extern int num_driver_cntrs;
159+
158160
/*
159161
* First-cut criterion for "device is active" is
160162
* two thousand dwords combined Tx, Rx traffic per

drivers/infiniband/hw/hfi1/qp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,13 @@ int hfi1_setup_wqe(struct rvt_qp *qp, struct rvt_swqe *wqe, bool *call_send)
340340
default:
341341
break;
342342
}
343+
344+
/*
345+
* System latency between send and schedule is large enough that
346+
* forcing call_send to true for piothreshold packets is necessary.
347+
*/
348+
if (wqe->length <= piothreshold)
349+
*call_send = true;
343350
return 0;
344351
}
345352

drivers/infiniband/hw/hfi1/verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ static const char * const driver_cntr_names[] = {
14791479
static DEFINE_MUTEX(cntr_names_lock); /* protects the *_cntr_names bufers */
14801480
static const char **dev_cntr_names;
14811481
static const char **port_cntr_names;
1482-
static int num_driver_cntrs = ARRAY_SIZE(driver_cntr_names);
1482+
int num_driver_cntrs = ARRAY_SIZE(driver_cntr_names);
14831483
static int num_dev_cntrs;
14841484
static int num_port_cntrs;
14851485
static int cntr_names_initialized;

drivers/infiniband/hw/mlx5/devx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,9 @@ static int devx_umem_get(struct mlx5_ib_dev *dev, struct ib_ucontext *ucontext,
10661066

10671067
err = uverbs_get_flags32(&access, attrs,
10681068
MLX5_IB_ATTR_DEVX_UMEM_REG_ACCESS,
1069-
IB_ACCESS_SUPPORTED);
1069+
IB_ACCESS_LOCAL_WRITE |
1070+
IB_ACCESS_REMOTE_WRITE |
1071+
IB_ACCESS_REMOTE_READ);
10701072
if (err)
10711073
return err;
10721074

drivers/infiniband/hw/mlx5/odp.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,22 +506,21 @@ void mlx5_ib_free_implicit_mr(struct mlx5_ib_mr *imr)
506506
static int pagefault_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr,
507507
u64 io_virt, size_t bcnt, u32 *bytes_mapped)
508508
{
509+
int npages = 0, current_seq, page_shift, ret, np;
510+
bool implicit = false;
509511
struct ib_umem_odp *odp_mr = to_ib_umem_odp(mr->umem);
510512
u64 access_mask = ODP_READ_ALLOWED_BIT;
511-
int npages = 0, page_shift, np;
512513
u64 start_idx, page_mask;
513514
struct ib_umem_odp *odp;
514-
int current_seq;
515515
size_t size;
516-
int ret;
517516

518517
if (!odp_mr->page_list) {
519518
odp = implicit_mr_get_data(mr, io_virt, bcnt);
520519

521520
if (IS_ERR(odp))
522521
return PTR_ERR(odp);
523522
mr = odp->private;
524-
523+
implicit = true;
525524
} else {
526525
odp = odp_mr;
527526
}
@@ -600,7 +599,7 @@ static int pagefault_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr,
600599

601600
out:
602601
if (ret == -EAGAIN) {
603-
if (mr->parent || !odp->dying) {
602+
if (implicit || !odp->dying) {
604603
unsigned long timeout =
605604
msecs_to_jiffies(MMU_NOTIFIER_TIMEOUT);
606605

0 commit comments

Comments
 (0)