Commit e2d324af authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull rdma fixes from Jason Gunthorpe:

 - syzkaller found a WARN_ON in rxe due to poor lifecycle management of
   resources linked to skbs

 - Missing error path handling in erdma qp creation

 - Initialize the qp number for the GSI QP in erdma

 - Mismatching of DIP, SCC and QP numbers in hns

 - SRQ bug fixes in bnxt_re

 - Memory leak and possibly uninited memory in bnxt_re

 - Remove retired irdma maintainer

 - Fix kfree() for kvalloc() in ODP

 - Fix memory leak in hns

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
  RDMA/hns: Fix dip entries leak on devices newer than hip09
  RDMA/core: Free pfn_list with appropriate kvfree call
  MAINTAINERS: Remove bouncing irdma maintainer
  RDMA/bnxt_re: Fix to initialize the PBL array
  RDMA/bnxt_re: Fix a possible memory leak in the driver
  RDMA/bnxt_re: Fix to remove workload check in SRQ limit path
  RDMA/bnxt_re: Fix to do SRQ armena by default
  RDMA/hns: Fix querying wrong SCC context for DIP algorithm
  RDMA/erdma: Fix unset QPN of GSI QP
  RDMA/erdma: Fix ignored return value of init_kernel_qp
  RDMA/rxe: Flush delayed SKBs while releasing RXE resources
parents c37d2bc9 fa2e2d31
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -12281,7 +12281,6 @@ F: include/linux/avf/virtchnl.h
F:	include/linux/net/intel/*/
INTEL ETHERNET PROTOCOL DRIVER FOR RDMA
M:	Mustafa Ismail <mustafa.ismail@intel.com>
M:	Tatyana Nikolova <tatyana.e.nikolova@intel.com>
L:	linux-rdma@vger.kernel.org
S:	Supported
+2 −2
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ static int ib_init_umem_odp(struct ib_umem_odp *umem_odp,

out_free_map:
	if (ib_uses_virt_dma(dev))
		kfree(map->pfn_list);
		kvfree(map->pfn_list);
	else
		hmm_dma_map_free(dev->dma_device, map);
	return ret;
@@ -287,7 +287,7 @@ static void ib_umem_odp_free(struct ib_umem_odp *umem_odp)
	mutex_unlock(&umem_odp->umem_mutex);
	mmu_interval_notifier_remove(&umem_odp->notifier);
	if (ib_uses_virt_dma(dev))
		kfree(umem_odp->map.pfn_list);
		kvfree(umem_odp->map.pfn_list);
	else
		hmm_dma_map_free(dev->dma_device, &umem_odp->map);
}
+2 −6
Original line number Diff line number Diff line
@@ -1921,7 +1921,6 @@ int bnxt_re_modify_srq(struct ib_srq *ib_srq, struct ib_srq_attr *srq_attr,
	struct bnxt_re_srq *srq = container_of(ib_srq, struct bnxt_re_srq,
					       ib_srq);
	struct bnxt_re_dev *rdev = srq->rdev;
	int rc;

	switch (srq_attr_mask) {
	case IB_SRQ_MAX_WR:
@@ -1933,11 +1932,8 @@ int bnxt_re_modify_srq(struct ib_srq *ib_srq, struct ib_srq_attr *srq_attr,
			return -EINVAL;

		srq->qplib_srq.threshold = srq_attr->srq_limit;
		rc = bnxt_qplib_modify_srq(&rdev->qplib_res, &srq->qplib_srq);
		if (rc) {
			ibdev_err(&rdev->ibdev, "Modify HW SRQ failed!");
			return rc;
		}
		bnxt_qplib_srq_arm_db(&srq->qplib_srq.dbinfo, srq->qplib_srq.threshold);

		/* On success, update the shadow */
		srq->srq_limit = srq_attr->srq_limit;
		/* No need to Build and send response back to udata */
+23 −0
Original line number Diff line number Diff line
@@ -2017,6 +2017,28 @@ static void bnxt_re_free_nqr_mem(struct bnxt_re_dev *rdev)
	rdev->nqr = NULL;
}

/* When DEL_GID fails, driver is not freeing GID ctx memory.
 * To avoid the memory leak, free the memory during unload
 */
static void bnxt_re_free_gid_ctx(struct bnxt_re_dev *rdev)
{
	struct bnxt_qplib_sgid_tbl *sgid_tbl = &rdev->qplib_res.sgid_tbl;
	struct bnxt_re_gid_ctx *ctx, **ctx_tbl;
	int i;

	if (!sgid_tbl->active)
		return;

	ctx_tbl = sgid_tbl->ctx;
	for (i = 0; i < sgid_tbl->max; i++) {
		if (sgid_tbl->hw_id[i] == 0xFFFF)
			continue;

		ctx = ctx_tbl[i];
		kfree(ctx);
	}
}

static void bnxt_re_dev_uninit(struct bnxt_re_dev *rdev, u8 op_type)
{
	u8 type;
@@ -2030,6 +2052,7 @@ static void bnxt_re_dev_uninit(struct bnxt_re_dev *rdev, u8 op_type)
	if (test_and_clear_bit(BNXT_RE_FLAG_QOS_WORK_REG, &rdev->flags))
		cancel_delayed_work_sync(&rdev->worker);

	bnxt_re_free_gid_ctx(rdev);
	if (test_and_clear_bit(BNXT_RE_FLAG_RESOURCES_INITIALIZED,
			       &rdev->flags))
		bnxt_re_cleanup_res(rdev);
+1 −29
Original line number Diff line number Diff line
@@ -705,9 +705,7 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res,
	srq->dbinfo.db = srq->dpi->dbr;
	srq->dbinfo.max_slot = 1;
	srq->dbinfo.priv_db = res->dpi_tbl.priv_db;
	if (srq->threshold)
	bnxt_qplib_armen_db(&srq->dbinfo, DBC_DBC_TYPE_SRQ_ARMENA);
	srq->arm_req = false;

	return 0;
fail:
@@ -717,24 +715,6 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res,
	return rc;
}

int bnxt_qplib_modify_srq(struct bnxt_qplib_res *res,
			  struct bnxt_qplib_srq *srq)
{
	struct bnxt_qplib_hwq *srq_hwq = &srq->hwq;
	u32 count;

	count = __bnxt_qplib_get_avail(srq_hwq);
	if (count > srq->threshold) {
		srq->arm_req = false;
		bnxt_qplib_srq_arm_db(&srq->dbinfo, srq->threshold);
	} else {
		/* Deferred arming */
		srq->arm_req = true;
	}

	return 0;
}

int bnxt_qplib_query_srq(struct bnxt_qplib_res *res,
			 struct bnxt_qplib_srq *srq)
{
@@ -776,7 +756,6 @@ int bnxt_qplib_post_srq_recv(struct bnxt_qplib_srq *srq,
	struct bnxt_qplib_hwq *srq_hwq = &srq->hwq;
	struct rq_wqe *srqe;
	struct sq_sge *hw_sge;
	u32 count = 0;
	int i, next;

	spin_lock(&srq_hwq->lock);
@@ -808,15 +787,8 @@ int bnxt_qplib_post_srq_recv(struct bnxt_qplib_srq *srq,

	bnxt_qplib_hwq_incr_prod(&srq->dbinfo, srq_hwq, srq->dbinfo.max_slot);

	spin_lock(&srq_hwq->lock);
	count = __bnxt_qplib_get_avail(srq_hwq);
	spin_unlock(&srq_hwq->lock);
	/* Ring DB */
	bnxt_qplib_ring_prod_db(&srq->dbinfo, DBC_DBC_TYPE_SRQ);
	if (srq->arm_req == true && count > srq->threshold) {
		srq->arm_req = false;
		bnxt_qplib_srq_arm_db(&srq->dbinfo, srq->threshold);
	}

	return 0;
}
Loading