Commit b0dfa64d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull rdma fixes from Jason Gunthorpe:
 "Several recent regressions and some bug fixes:

   - Typo corrupting the max_recv_sge for cxgb4

   - Regression from re-using kernel enums as a HW AbI in vmw_pvrdma

   - Sleeping inside a spinlock in hns

   - Revert the attempt to fix devlink deadlocks as the fix is more buggy

   - Typo in sysfs_emit_at conversions

   - Revert the removal of VLAN support in rxe"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
  Revert "RDMA/rxe: Remove VLAN code leftovers from RXE"
  RDMA/usnic: Fix misuse of sysfs_emit_at
  Revert "RDMA/mlx5: Fix devlink deadlock on net namespace deletion"
  RDMA/hns: Use mutex instead of spinlock for ida allocation
  RDMA/vmw_pvrdma: Fix network_hdr_type reported in WC
  RDMA/cxgb4: Fix the reported max_recv_sge value
parents 25221c99 f1b0a8ea
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2474,7 +2474,7 @@ int c4iw_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
	init_attr->cap.max_send_wr = qhp->attr.sq_num_entries;
	init_attr->cap.max_recv_wr = qhp->attr.rq_num_entries;
	init_attr->cap.max_send_sge = qhp->attr.sq_max_sges;
	init_attr->cap.max_recv_sge = qhp->attr.sq_max_sges;
	init_attr->cap.max_recv_sge = qhp->attr.rq_max_sges;
	init_attr->cap.max_inline_data = T4_MAX_SEND_INLINE;
	init_attr->sq_sig_type = qhp->sq_sig_all ? IB_SIGNAL_ALL_WR : 0;
	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -532,7 +532,7 @@ struct hns_roce_qp_table {
	struct hns_roce_hem_table	sccc_table;
	struct mutex			scc_mutex;
	struct hns_roce_bank bank[HNS_ROCE_QP_BANK_NUM];
	spinlock_t bank_lock;
	struct mutex bank_mutex;
};

struct hns_roce_cq_table {
+6 −5
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ static int alloc_qpn(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp)

		hr_qp->doorbell_qpn = 1;
	} else {
		spin_lock(&qp_table->bank_lock);
		mutex_lock(&qp_table->bank_mutex);
		bankid = get_least_load_bankid_for_qp(qp_table->bank);

		ret = alloc_qpn_with_bankid(&qp_table->bank[bankid], bankid,
@@ -217,12 +217,12 @@ static int alloc_qpn(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp)
		if (ret) {
			ibdev_err(&hr_dev->ib_dev,
				  "failed to alloc QPN, ret = %d\n", ret);
			spin_unlock(&qp_table->bank_lock);
			mutex_unlock(&qp_table->bank_mutex);
			return ret;
		}

		qp_table->bank[bankid].inuse++;
		spin_unlock(&qp_table->bank_lock);
		mutex_unlock(&qp_table->bank_mutex);

		hr_qp->doorbell_qpn = (u32)num;
	}
@@ -408,9 +408,9 @@ static void free_qpn(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp)

	ida_free(&hr_dev->qp_table.bank[bankid].ida, hr_qp->qpn >> 3);

	spin_lock(&hr_dev->qp_table.bank_lock);
	mutex_lock(&hr_dev->qp_table.bank_mutex);
	hr_dev->qp_table.bank[bankid].inuse--;
	spin_unlock(&hr_dev->qp_table.bank_lock);
	mutex_unlock(&hr_dev->qp_table.bank_mutex);
}

static int set_rq_size(struct hns_roce_dev *hr_dev, struct ib_qp_cap *cap,
@@ -1371,6 +1371,7 @@ int hns_roce_init_qp_table(struct hns_roce_dev *hr_dev)
	unsigned int i;

	mutex_init(&qp_table->scc_mutex);
	mutex_init(&qp_table->bank_mutex);
	xa_init(&hr_dev->qp_table_xa);

	reserved_from_bot = hr_dev->caps.reserved_qps;
+2 −4
Original line number Diff line number Diff line
@@ -3311,8 +3311,7 @@ static int mlx5_add_netdev_notifier(struct mlx5_ib_dev *dev, u8 port_num)
	int err;

	dev->port[port_num].roce.nb.notifier_call = mlx5_netdev_event;
	err = register_netdevice_notifier_net(mlx5_core_net(dev->mdev),
					      &dev->port[port_num].roce.nb);
	err = register_netdevice_notifier(&dev->port[port_num].roce.nb);
	if (err) {
		dev->port[port_num].roce.nb.notifier_call = NULL;
		return err;
@@ -3324,8 +3323,7 @@ static int mlx5_add_netdev_notifier(struct mlx5_ib_dev *dev, u8 port_num)
static void mlx5_remove_netdev_notifier(struct mlx5_ib_dev *dev, u8 port_num)
{
	if (dev->port[port_num].roce.nb.notifier_call) {
		unregister_netdevice_notifier_net(mlx5_core_net(dev->mdev),
						  &dev->port[port_num].roce.nb);
		unregister_netdevice_notifier(&dev->port[port_num].roce.nb);
		dev->port[port_num].roce.nb.notifier_call = NULL;
	}
}
+3 −4
Original line number Diff line number Diff line
@@ -224,14 +224,13 @@ static ssize_t summary_show(struct usnic_ib_qp_grp *qp_grp, char *buf)
		res_chunk = qp_grp->res_chunk_list[i];
		for (j = 0; j < res_chunk->cnt; j++) {
			vnic_res = res_chunk->res[j];
			len += sysfs_emit_at(
				buf, len, "%s[%d] ",
			len += sysfs_emit_at(buf, len, " %s[%d]",
				usnic_vnic_res_type_to_str(vnic_res->type),
				vnic_res->vnic_idx);
		}
	}

	len = sysfs_emit_at(buf, len, "\n");
	len += sysfs_emit_at(buf, len, "\n");

	return len;
}
Loading