summaryrefslogtreecommitdiff
path: root/include/rdma
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@nvidia.com>2022-01-05 10:04:56 +0200
committerJason Gunthorpe <jgg@nvidia.com>2022-01-05 15:18:36 -0400
commitd82e2b27ad3a4fdd745332e0c310ae05660a1bf1 (patch)
tree6adcef70aeb411f28c086c1f4466a46877397a19 /include/rdma
parentd8b0afd29c1d6d61890f259360388bde57f5dc90 (diff)
downloadlwn-d82e2b27ad3a4fdd745332e0c310ae05660a1bf1.tar.gz
lwn-d82e2b27ad3a4fdd745332e0c310ae05660a1bf1.zip
RDMA/mad: Delete duplicated init_query_mad functions
Several drivers used same function to initialize query MAD, so move that function to global header file. Link: https://lore.kernel.org/r/af6f35c590ff5ef56d0137351b8b295af0f7c13c.1641369858.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Håkon Bugge <haakon.bugge@oracle.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_smi.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/rdma/ib_smi.h b/include/rdma/ib_smi.h
index fdb8633cbaff..fc16b826b2c1 100644
--- a/include/rdma/ib_smi.h
+++ b/include/rdma/ib_smi.h
@@ -144,5 +144,15 @@ ib_get_smp_direction(struct ib_smp *smp)
#define IB_NOTICE_TRAP_DR_NOTICE 0x80
#define IB_NOTICE_TRAP_DR_TRUNC 0x40
-
+/**
+ * ib_init_query_mad - Initialize query MAD.
+ * @mad: MAD to initialize.
+ */
+static inline void ib_init_query_mad(struct ib_smp *mad)
+{
+ mad->base_version = IB_MGMT_BASE_VERSION;
+ mad->mgmt_class = IB_MGMT_CLASS_SUBN_LID_ROUTED;
+ mad->class_version = 1;
+ mad->method = IB_MGMT_METHOD_GET;
+}
#endif /* IB_SMI_H */