[PATCH] IB/mthca: Add SRQ implementation
Add mthca support for shared receive queues (SRQs), including userspace SRQs. Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
committed by
Roland Dreier
parent
d20a401928
commit
ec34a922d2
@@ -197,6 +197,29 @@ struct mthca_cq {
|
||||
wait_queue_head_t wait;
|
||||
};
|
||||
|
||||
struct mthca_srq {
|
||||
struct ib_srq ibsrq;
|
||||
spinlock_t lock;
|
||||
atomic_t refcount;
|
||||
int srqn;
|
||||
int max;
|
||||
int max_gs;
|
||||
int wqe_shift;
|
||||
int first_free;
|
||||
int last_free;
|
||||
u16 counter; /* Arbel only */
|
||||
int db_index; /* Arbel only */
|
||||
__be32 *db; /* Arbel only */
|
||||
void *last;
|
||||
|
||||
int is_direct;
|
||||
u64 *wrid;
|
||||
union mthca_buf queue;
|
||||
struct mthca_mr mr;
|
||||
|
||||
wait_queue_head_t wait;
|
||||
};
|
||||
|
||||
struct mthca_wq {
|
||||
spinlock_t lock;
|
||||
int max;
|
||||
@@ -277,6 +300,11 @@ static inline struct mthca_cq *to_mcq(struct ib_cq *ibcq)
|
||||
return container_of(ibcq, struct mthca_cq, ibcq);
|
||||
}
|
||||
|
||||
static inline struct mthca_srq *to_msrq(struct ib_srq *ibsrq)
|
||||
{
|
||||
return container_of(ibsrq, struct mthca_srq, ibsrq);
|
||||
}
|
||||
|
||||
static inline struct mthca_qp *to_mqp(struct ib_qp *ibqp)
|
||||
{
|
||||
return container_of(ibqp, struct mthca_qp, ibqp);
|
||||
|
Reference in New Issue
Block a user