Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 121bddf3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull rdma fixes from Doug Ledford:
 "This is probably our last -rc pull request. We don't have anything
  else outstanding at the moment anyway, and with the summer months on
  us and people taking trips, I expect the next weeks leading up to the
  merge window to be pretty calm and sedate.

  This has two simple, no brainer fixes for the EFA driver.

  Then it has ten not quite so simple fixes for the hfi1 driver. The
  problem with them is that they aren't simply one liner typo fixes.
  They're still fixes, but they're more complex issues like livelock
  under heavy load where the answer was to change work queue usage and
  spinlock usage to resolve the problem, or issues with orphaned
  requests during certain types of failures like link down which
  required some more complex work to fix too. They all look like
  legitimate fixes to me, they just aren't small like I wish they were.

  Summary:

   - 2 minor EFA fixes

   - 10 hfi1 fixes related to scaling issues"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
  RDMA/efa: Handle mmap insertions overflow
  RDMA/efa: Fix success return value in case of error
  IB/hfi1: Handle port down properly in pio
  IB/hfi1: Handle wakeup of orphaned QPs for pio
  IB/hfi1: Wakeup QPs orphaned on wait list after flush
  IB/hfi1: Use aborts to trigger RC throttling
  IB/hfi1: Create inline to get extended headers
  IB/hfi1: Silence txreq allocation warnings
  IB/hfi1: Avoid hardlockup with flushlist_lock
  IB/hfi1: Correct tid qp rcd to match verbs context
  IB/hfi1: Close PSM sdma_progress sleep window
  IB/hfi1: Validate fault injection opcode user input
parents c036f7da 7a5834e4
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -139,9 +139,11 @@ int efa_com_destroy_qp(struct efa_com_dev *edev,
			       sizeof(qp_cmd),
			       (struct efa_admin_acq_entry *)&cmd_completion,
			       sizeof(cmd_completion));
	if (err)
	if (err) {
		ibdev_err(edev->efa_dev, "Failed to destroy qp-%u [%d]\n",
			  qp_cmd.qp_handle, err);
		return err;
	}

	return 0;
}
@@ -199,9 +201,11 @@ int efa_com_destroy_cq(struct efa_com_dev *edev,
			       (struct efa_admin_acq_entry *)&destroy_resp,
			       sizeof(destroy_resp));

	if (err)
	if (err) {
		ibdev_err(edev->efa_dev, "Failed to destroy CQ-%u [%d]\n",
			  params->cq_idx, err);
		return err;
	}

	return 0;
}
@@ -273,10 +277,12 @@ int efa_com_dereg_mr(struct efa_com_dev *edev,
			       sizeof(mr_cmd),
			       (struct efa_admin_acq_entry *)&cmd_completion,
			       sizeof(cmd_completion));
	if (err)
	if (err) {
		ibdev_err(edev->efa_dev,
			  "Failed to de-register mr(lkey-%u) [%d]\n",
			  mr_cmd.l_key, err);
		return err;
	}

	return 0;
}
@@ -327,9 +333,11 @@ int efa_com_destroy_ah(struct efa_com_dev *edev,
			       sizeof(ah_cmd),
			       (struct efa_admin_acq_entry *)&cmd_completion,
			       sizeof(cmd_completion));
	if (err)
	if (err) {
		ibdev_err(edev->efa_dev, "Failed to destroy ah-%d pd-%d [%d]\n",
			  ah_cmd.ah, ah_cmd.pd, err);
		return err;
	}

	return 0;
}
@@ -387,10 +395,12 @@ static int efa_com_get_feature_ex(struct efa_com_dev *edev,
			       get_resp,
			       sizeof(*get_resp));

	if (err)
	if (err) {
		ibdev_err(edev->efa_dev,
			  "Failed to submit get_feature command %d [%d]\n",
			  feature_id, err);
		return err;
	}

	return 0;
}
@@ -534,10 +544,12 @@ static int efa_com_set_feature_ex(struct efa_com_dev *edev,
			       (struct efa_admin_acq_entry *)set_resp,
			       sizeof(*set_resp));

	if (err)
	if (err) {
		ibdev_err(edev->efa_dev,
			  "Failed to submit set_feature command %d error: %d\n",
			  feature_id, err);
		return err;
	}

	return 0;
}
+16 −5
Original line number Diff line number Diff line
@@ -204,6 +204,7 @@ static u64 mmap_entry_insert(struct efa_dev *dev, struct efa_ucontext *ucontext,
			     void *obj, u64 address, u64 length, u8 mmap_flag)
{
	struct efa_mmap_entry *entry;
	u32 next_mmap_page;
	int err;

	entry = kmalloc(sizeof(*entry), GFP_KERNEL);
@@ -216,15 +217,19 @@ static u64 mmap_entry_insert(struct efa_dev *dev, struct efa_ucontext *ucontext,
	entry->mmap_flag = mmap_flag;

	xa_lock(&ucontext->mmap_xa);
	if (check_add_overflow(ucontext->mmap_xa_page,
			       (u32)(length >> PAGE_SHIFT),
			       &next_mmap_page))
		goto err_unlock;

	entry->mmap_page = ucontext->mmap_xa_page;
	ucontext->mmap_xa_page += DIV_ROUND_UP(length, PAGE_SIZE);
	ucontext->mmap_xa_page = next_mmap_page;
	err = __xa_insert(&ucontext->mmap_xa, entry->mmap_page, entry,
			  GFP_KERNEL);
	if (err)
		goto err_unlock;

	xa_unlock(&ucontext->mmap_xa);
	if (err){
		kfree(entry);
		return EFA_MMAP_INVALID;
	}

	ibdev_dbg(
		&dev->ibdev,
@@ -232,6 +237,12 @@ static u64 mmap_entry_insert(struct efa_dev *dev, struct efa_ucontext *ucontext,
		entry->obj, entry->address, entry->length, get_mmap_key(entry));

	return get_mmap_key(entry);

err_unlock:
	xa_unlock(&ucontext->mmap_xa);
	kfree(entry);
	return EFA_MMAP_INVALID;

}

int efa_query_device(struct ib_device *ibdev,
+13 −0
Original line number Diff line number Diff line
@@ -14031,6 +14031,19 @@ static void init_kdeth_qp(struct hfi1_devdata *dd)
		  RCV_BTH_QP_KDETH_QP_SHIFT);
}

/**
 * hfi1_get_qp_map
 * @dd: device data
 * @idx: index to read
 */
u8 hfi1_get_qp_map(struct hfi1_devdata *dd, u8 idx)
{
	u64 reg = read_csr(dd, RCV_QP_MAP_TABLE + (idx / 8) * 8);

	reg >>= (idx % 8) * 8;
	return reg;
}

/**
 * init_qpmap_table
 * @dd - device data
+1 −0
Original line number Diff line number Diff line
@@ -1445,6 +1445,7 @@ void clear_all_interrupts(struct hfi1_devdata *dd);
void remap_intr(struct hfi1_devdata *dd, int isrc, int msix_intr);
void remap_sdma_interrupts(struct hfi1_devdata *dd, int engine, int msix_intr);
void reset_interrupts(struct hfi1_devdata *dd);
u8 hfi1_get_qp_map(struct hfi1_devdata *dd, u8 idx);

/*
 * Interrupt source table.
+5 −0
Original line number Diff line number Diff line
@@ -153,6 +153,7 @@ static ssize_t fault_opcodes_write(struct file *file, const char __user *buf,
		char *dash;
		unsigned long range_start, range_end, i;
		bool remove = false;
		unsigned long bound = 1U << BITS_PER_BYTE;

		end = strchr(ptr, ',');
		if (end)
@@ -178,6 +179,10 @@ static ssize_t fault_opcodes_write(struct file *file, const char __user *buf,
				    BITS_PER_BYTE);
			break;
		}
		/* Check the inputs */
		if (range_start >= bound || range_end >= bound)
			break;

		for (i = range_start; i <= range_end; i++) {
			if (remove)
				clear_bit(i, fault->opcodes);
Loading