]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/core: Move the rdma_show_ib_cm_event() macro
authorChuck Lever <chuck.lever@oracle.com>
Mon, 17 Aug 2020 13:53:11 +0000 (09:53 -0400)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 24 Aug 2020 19:01:47 +0000 (16:01 -0300)
Refactor: Make it globally available in the utilities header.

Link: https://lore.kernel.org/r/159767239131.2968.9520990257041764685.stgit@klimt.1015granger.net
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/cma_trace.h
include/trace/events/rdma.h
include/trace/events/rpcrdma.h

index e6e20c36c538c58f6e6533e43032a24f24fe7904..e45264267bcc99f6929662bf3793ef52b055406d 100644 (file)
 #include <linux/tracepoint.h>
 #include <trace/events/rdma.h>
 
-/*
- * enum ib_cm_event_type, from include/rdma/ib_cm.h
- */
-#define IB_CM_EVENT_LIST                       \
-       ib_cm_event(REQ_ERROR)                  \
-       ib_cm_event(REQ_RECEIVED)               \
-       ib_cm_event(REP_ERROR)                  \
-       ib_cm_event(REP_RECEIVED)               \
-       ib_cm_event(RTU_RECEIVED)               \
-       ib_cm_event(USER_ESTABLISHED)           \
-       ib_cm_event(DREQ_ERROR)                 \
-       ib_cm_event(DREQ_RECEIVED)              \
-       ib_cm_event(DREP_RECEIVED)              \
-       ib_cm_event(TIMEWAIT_EXIT)              \
-       ib_cm_event(MRA_RECEIVED)               \
-       ib_cm_event(REJ_RECEIVED)               \
-       ib_cm_event(LAP_ERROR)                  \
-       ib_cm_event(LAP_RECEIVED)               \
-       ib_cm_event(APR_RECEIVED)               \
-       ib_cm_event(SIDR_REQ_ERROR)             \
-       ib_cm_event(SIDR_REQ_RECEIVED)          \
-       ib_cm_event_end(SIDR_REP_RECEIVED)
-
-#undef ib_cm_event
-#undef ib_cm_event_end
-
-#define ib_cm_event(x)         TRACE_DEFINE_ENUM(IB_CM_##x);
-#define ib_cm_event_end(x)     TRACE_DEFINE_ENUM(IB_CM_##x);
-
-IB_CM_EVENT_LIST
-
-#undef ib_cm_event
-#undef ib_cm_event_end
-
-#define ib_cm_event(x)         { IB_CM_##x, #x },
-#define ib_cm_event_end(x)     { IB_CM_##x, #x }
-
-#define rdma_show_ib_cm_event(x) \
-               __print_symbolic(x, IB_CM_EVENT_LIST)
-
 
 DECLARE_EVENT_CLASS(cma_fsm_class,
        TP_PROTO(
index aa19afc73a4e540570faf8980d733d3039592f80..81bb454fc2888b2cad354f2e60232c9074fadc6e 100644 (file)
@@ -6,7 +6,6 @@
 /*
  * enum ib_event_type, from include/rdma/ib_verbs.h
  */
-
 #define IB_EVENT_LIST                          \
        ib_event(CQ_ERR)                        \
        ib_event(QP_FATAL)                      \
@@ -90,6 +89,46 @@ IB_WC_STATUS_LIST
 #define rdma_show_wc_status(x) \
                __print_symbolic(x, IB_WC_STATUS_LIST)
 
+/*
+ * enum ib_cm_event_type, from include/rdma/ib_cm.h
+ */
+#define IB_CM_EVENT_LIST                       \
+       ib_cm_event(REQ_ERROR)                  \
+       ib_cm_event(REQ_RECEIVED)               \
+       ib_cm_event(REP_ERROR)                  \
+       ib_cm_event(REP_RECEIVED)               \
+       ib_cm_event(RTU_RECEIVED)               \
+       ib_cm_event(USER_ESTABLISHED)           \
+       ib_cm_event(DREQ_ERROR)                 \
+       ib_cm_event(DREQ_RECEIVED)              \
+       ib_cm_event(DREP_RECEIVED)              \
+       ib_cm_event(TIMEWAIT_EXIT)              \
+       ib_cm_event(MRA_RECEIVED)               \
+       ib_cm_event(REJ_RECEIVED)               \
+       ib_cm_event(LAP_ERROR)                  \
+       ib_cm_event(LAP_RECEIVED)               \
+       ib_cm_event(APR_RECEIVED)               \
+       ib_cm_event(SIDR_REQ_ERROR)             \
+       ib_cm_event(SIDR_REQ_RECEIVED)          \
+       ib_cm_event_end(SIDR_REP_RECEIVED)
+
+#undef ib_cm_event
+#undef ib_cm_event_end
+
+#define ib_cm_event(x)         TRACE_DEFINE_ENUM(IB_CM_##x);
+#define ib_cm_event_end(x)     TRACE_DEFINE_ENUM(IB_CM_##x);
+
+IB_CM_EVENT_LIST
+
+#undef ib_cm_event
+#undef ib_cm_event_end
+
+#define ib_cm_event(x)         { IB_CM_##x, #x },
+#define ib_cm_event_end(x)     { IB_CM_##x, #x }
+
+#define rdma_show_ib_cm_event(x) \
+               __print_symbolic(x, IB_CM_EVENT_LIST)
+
 /*
  * enum rdma_cm_event_type, from include/rdma/rdma_cm.h
  */
index abe9422256379a5f7b74953d76f63b36c7e710b3..b6aad52beb627ce0bfd6a1fdcef1ba8dcba0ea59 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/scatterlist.h>
 #include <linux/sunrpc/rpc_rdma_cid.h>
 #include <linux/tracepoint.h>
+#include <rdma/ib_cm.h>
 #include <trace/events/rdma.h>
 
 /**