aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/cm_msgs.h
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2020-01-16 13:00:32 -0400
committerJason Gunthorpe <jgg@mellanox.com>2020-01-25 15:05:59 -0400
commitd05d4ac4c9316a2e2ea5be434a7f7a021ec44a3c (patch)
tree54270a5bc3cdda9dbca6e10d090dbbd3f1bafc00 /drivers/infiniband/core/cm_msgs.h
parentRDMA/cm: Add accessors for CM_REQ transport_type (diff)
downloadlinux-dev-d05d4ac4c9316a2e2ea5be434a7f7a021ec44a3c.tar.xz
linux-dev-d05d4ac4c9316a2e2ea5be434a7f7a021ec44a3c.zip
RDMA/cm: Add SET/GET implementations to hide IBA wire format
There is no separation between RDMA-CM wire format as it is declared in IBTA and kernel logic which implements needed support. Such situation causes to many mistakes in conversion between big-endian (wire format) and CPU format used by kernel. It also mixes RDMA core code with combination of uXX and beXX variables. The idea that all accesses to IBA definitions will go through special GET/SET macros to ensure that no conversion mistakes are made. The shifting and masking required to read the value is automatically deduced using the field offset description from the tables in the IBA specification. This starts with the CM MADs described in IBTA release 1.3 volume 1. To confirm that the new macros behave the same as the old accessors a self-test is included in this patch. Each macro replacing a straightforward struct field compile-time tests that the new field has the same offsetof() and width as the old field. For the fields with accessor functions a runtime test, the 'all ones' value is placed in a dummy message and read back in several ways to confirm that both approaches give identical results. Later patches in this series delete the self test. This creates a tested table of new field name, old field name(s) and some meta information like BE coding for the functions which will be used in the next patches. Link: https://lore.kernel.org/r/20200116170037.30109-3-jgg@ziepe.ca Link: https://lore.kernel.org/r/20191212093830.316934-5-leon@kernel.org Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Tested-by: Leon Romanovsky <leonro@mellanox.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/cm_msgs.h')
-rw-r--r--drivers/infiniband/core/cm_msgs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h
index 9af9a3212074..bf62461d801f 100644
--- a/drivers/infiniband/core/cm_msgs.h
+++ b/drivers/infiniband/core/cm_msgs.h
@@ -8,6 +8,7 @@
#ifndef CM_MSGS_H
#define CM_MSGS_H
+#include <rdma/ibta_vol1_c12.h>
#include <rdma/ib_mad.h>
#include <rdma/ib_cm.h>