IB/{rdmavt, hfi1, qib}: Add helpers to hide SWQE WR details

Add some helper functions to hide struct rvt_swqe details.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Michael J. Ruhl
2019-06-28 14:22:11 -04:00
committed by Jason Gunthorpe
parent d310c4bf8a
commit 2b0ad2da8f
6 changed files with 79 additions and 27 deletions

View File

@@ -219,6 +219,56 @@ struct rvt_krwq {
struct rvt_rwqe wq[];
};
/*
* rvt_get_swqe_ah - Return the pointer to the struct rvt_ah
* @swqe: valid Send WQE
*
*/
static inline struct rvt_ah *rvt_get_swqe_ah(struct rvt_swqe *swqe)
{
return ibah_to_rvtah(swqe->ud_wr.wr.ah);
}
/**
* rvt_get_swqe_ah_attr - Return the cached ah attribute information
* @swqe: valid Send WQE
*
*/
static inline struct rdma_ah_attr *rvt_get_swqe_ah_attr(struct rvt_swqe *swqe)
{
return swqe->ud_wr.attr;
}
/**
* rvt_get_swqe_remote_qpn - Access the remote QPN value
* @swqe: valid Send WQE
*
*/
static inline u32 rvt_get_swqe_remote_qpn(struct rvt_swqe *swqe)
{
return swqe->ud_wr.wr.remote_qpn;
}
/**
* rvt_get_swqe_remote_qkey - Acces the remote qkey value
* @swqe: valid Send WQE
*
*/
static inline u32 rvt_get_swqe_remote_qkey(struct rvt_swqe *swqe)
{
return swqe->ud_wr.wr.remote_qkey;
}
/**
* rvt_get_swqe_pkey_index - Access the pkey index
* @swqe: valid Send WQE
*
*/
static inline u16 rvt_get_swqe_pkey_index(struct rvt_swqe *swqe)
{
return swqe->ud_wr.wr.pkey_index;
}
struct rvt_rq {
struct rvt_rwq *wq;
struct rvt_krwq *kwq;