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

Commit 7e230177 authored by Mike Marciniszyn's avatar Mike Marciniszyn Committed by Roland Dreier
Browse files

IB/qib: Fix sparse RCU warnings in qib_keys.c



Commit 8aac4cc3 ("IB/qib: RCU locking for MR validation") introduced
new sparse warnings in qib_keys.c.

Acked-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 8aac4cc3
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -349,7 +349,9 @@ int qib_fast_reg_mr(struct qib_qp *qp, struct ib_send_wr *wr)
	if (pd->user || rkey == 0)
	if (pd->user || rkey == 0)
		goto bail;
		goto bail;


	mr = rkt->table[(rkey >> (32 - ib_qib_lkey_table_size))];
	mr = rcu_dereference_protected(
		rkt->table[(rkey >> (32 - ib_qib_lkey_table_size))],
		lockdep_is_held(&rkt->lock));
	if (unlikely(mr == NULL || qp->ibqp.pd != mr->pd))
	if (unlikely(mr == NULL || qp->ibqp.pd != mr->pd))
		goto bail;
		goto bail;


+2 −2
Original line number Original line Diff line number Diff line
@@ -650,7 +650,7 @@ struct qib_lkey_table {
	u32 next;               /* next unused index (speeds search) */
	u32 next;               /* next unused index (speeds search) */
	u32 gen;                /* generation count */
	u32 gen;                /* generation count */
	u32 max;                /* size of the table */
	u32 max;                /* size of the table */
	struct qib_mregion **table;
	struct qib_mregion __rcu **table;
};
};


struct qib_opcode_stats {
struct qib_opcode_stats {
@@ -732,7 +732,7 @@ struct qib_ibdev {
	struct list_head pending_mmaps;
	struct list_head pending_mmaps;
	spinlock_t mmap_offset_lock; /* protect mmap_offset */
	spinlock_t mmap_offset_lock; /* protect mmap_offset */
	u32 mmap_offset;
	u32 mmap_offset;
	struct qib_mregion *dma_mr;
	struct qib_mregion __rcu *dma_mr;


	/* QP numbers are shared by all IB ports */
	/* QP numbers are shared by all IB ports */
	struct qib_qpn_table qpn_table;
	struct qib_qpn_table qpn_table;