summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/hfi1/hfi.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/hfi1/hfi.h')
-rw-r--r--drivers/infiniband/hw/hfi1/hfi.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h
index ba6dd2c3aa6a..4a8e5930d539 100644
--- a/drivers/infiniband/hw/hfi1/hfi.h
+++ b/drivers/infiniband/hw/hfi1/hfi.h
@@ -201,8 +201,6 @@ struct hfi1_ctxtdata {
volatile __le64 *rcvhdrtail_kvaddr;
/* when waiting for rcv or pioavail */
wait_queue_head_t wait;
- /* rcvhdrq size (for freeing) */
- size_t rcvhdrq_size;
/* number of rcvhdrq entries */
u16 rcvhdrq_cnt;
/* size of each of the rcvhdrq entries */
@@ -324,6 +322,19 @@ struct hfi1_ctxtdata {
u8 vnic_q_idx;
};
+/**
+ * rcvhdrq_size - return total size in bytes for header queue
+ * @rcd: the receive context
+ *
+ * rcvhdrqentsize is in DWs, so we have to convert to bytes
+ *
+ */
+static inline u32 rcvhdrq_size(struct hfi1_ctxtdata *rcd)
+{
+ return PAGE_ALIGN(rcd->rcvhdrq_cnt *
+ rcd->rcvhdrqentsize * sizeof(u32));
+}
+
/*
* Represents a single packet at a high level. Put commonly computed things in
* here so we do not have to keep doing them over and over. The rule of thumb is