aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/verbs.h
diff options
context:
space:
mode:
authorMike Marciniszyn <mike.marciniszyn@intel.com>2018-02-01 10:52:35 -0800
committerJason Gunthorpe <jgg@mellanox.com>2018-02-01 15:43:30 -0700
commit78d3633ba9c2351fc869271ee00284f46e6b15b2 (patch)
treee491cd82c0c3de6b950b89fb46fc2829e8f9c5b4 /drivers/infiniband/hw/hfi1/verbs.h
parentIB/hfi1: Convert PortXmitWait/PortVLXmitWait counters to flit times (diff)
downloadlinux-dev-78d3633ba9c2351fc869271ee00284f46e6b15b2.tar.xz
linux-dev-78d3633ba9c2351fc869271ee00284f46e6b15b2.zip
IB/hfi1: Remove blind constants from 16B update
These values were introduced as part of the 16B code to account for the varying size of the LRH between the differing packet formats. Replace the blind constants with defines based on FIELD_SIZEOF() calls. Fixes: 5b6cabb0db77 ("IB/hfi1: Add 16B RC/UC support") Reviewed-by: Don Hiatt <don.hiatt@intel.com> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/verbs.h')
-rw-r--r--drivers/infiniband/hw/hfi1/verbs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/verbs.h b/drivers/infiniband/hw/hfi1/verbs.h
index 4ea040df334b..2d787b8346ca 100644
--- a/drivers/infiniband/hw/hfi1/verbs.h
+++ b/drivers/infiniband/hw/hfi1/verbs.h
@@ -105,6 +105,11 @@ enum {
HFI1_HAS_GRH = (1 << 0),
};
+#define LRH_16B_BYTES (FIELD_SIZEOF(struct hfi1_16b_header, lrh))
+#define LRH_16B_DWORDS (LRH_16B_BYTES / sizeof(u32))
+#define LRH_9B_BYTES (FIELD_SIZEOF(struct ib_header, lrh))
+#define LRH_9B_DWORDS (LRH_9B_BYTES / sizeof(u32))
+
struct hfi1_16b_header {
u32 lrh[4];
union {