
From: wenglianfa <wenglianfa@huawei.com> In the patch related to SRQ resource tracing, members are added to the structure, which causes Kapi incompatibility. To solve this problem, perform the following operations: First, make sure that the data structure of the new member has little impact and the risk is controllable, then Use the __GENKSYMS__ macro to shield the new structure members and place the new members at the end of the data structure. Fixes: d7b7ce53b3be ("RDMA/hns: Support SRQ restrack ops for hns driver") Fixes: 788310f83ffc ("RDMA/core: Add support to dump SRQ resource in RAW format") Fixes: 31cc28f1894f ("RDMA/core: Add dedicated SRQ resource tracker function") Fixes: f54d69b7874e ("RDMA/nldev: Add QP numbers to SRQ information") Fixes: 6102284160fd ("RDMA/nldev: Return SRQ information") Fixes: 4e38b5a1267f ("RDMA/restrack: Add support to get resource tracking for SRQ") Fixes: 0c32db26a6c4 ("RDMA/nldev: Return context information") Signed-off-by: wenglianfa <wenglianfa@huawei.com> --- include/rdma/ib_verbs.h | 9 +++++++-- include/rdma/restrack.h | 2 ++ include/uapi/rdma/rdma_netlink.h | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index fc32b16d5bb3..db46f3150b99 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1608,10 +1608,12 @@ struct ib_srq { }; } ext; +#ifndef __GENKSYMS__ /* * Implementation details of the RDMA core, don't use in drivers: */ struct rdma_restrack_entry res; +#endif }; enum ib_raw_packet_caps { @@ -2548,8 +2550,6 @@ struct ib_device_ops { int (*fill_res_qp_entry)(struct sk_buff *msg, struct ib_qp *ibqp); int (*fill_res_qp_entry_raw)(struct sk_buff *msg, struct ib_qp *ibqp); int (*fill_res_cm_id_entry)(struct sk_buff *msg, struct rdma_cm_id *id); - int (*fill_res_srq_entry)(struct sk_buff *msg, struct ib_srq *ib_srq); - int (*fill_res_srq_entry_raw)(struct sk_buff *msg, struct ib_srq *ib_srq); /* Device lifecycle callbacks */ /* @@ -2619,6 +2619,11 @@ struct ib_device_ops { DECLARE_RDMA_OBJ_SIZE(ib_srq); DECLARE_RDMA_OBJ_SIZE(ib_ucontext); DECLARE_RDMA_OBJ_SIZE(ib_xrcd); + +#ifndef __GENKSYMS__ + int (*fill_res_srq_entry)(struct sk_buff *msg, struct ib_srq *ib_srq); + int (*fill_res_srq_entry_raw)(struct sk_buff *msg, struct ib_srq *ib_srq); +#endif }; struct ib_core_device { diff --git a/include/rdma/restrack.h b/include/rdma/restrack.h index bdfb6fce0bed..57fca78afc47 100644 --- a/include/rdma/restrack.h +++ b/include/rdma/restrack.h @@ -49,10 +49,12 @@ enum rdma_restrack_type { * @RDMA_RESTRACK_COUNTER: Statistic Counter */ RDMA_RESTRACK_COUNTER, +#ifndef __GENKSYMS__ /** * @RDMA_RESTRACK_SRQ: Shared receive queue (SRQ) */ RDMA_RESTRACK_SRQ, +#endif /** * @RDMA_RESTRACK_MAX: Last entry, used for array dclarations */ diff --git a/include/uapi/rdma/rdma_netlink.h b/include/uapi/rdma/rdma_netlink.h index 05392cd8e627..5ab830103e32 100644 --- a/include/uapi/rdma/rdma_netlink.h +++ b/include/uapi/rdma/rdma_netlink.h @@ -293,11 +293,13 @@ enum rdma_nldev_command { RDMA_NLDEV_CMD_RES_MR_GET_RAW, +#ifndef __GENKSYMS__ RDMA_NLDEV_CMD_RES_CTX_GET, /* can dump */ RDMA_NLDEV_CMD_RES_SRQ_GET, /* can dump */ RDMA_NLDEV_CMD_RES_SRQ_GET_RAW, +#endif RDMA_NLDEV_NUM_OPS }; @@ -539,6 +541,7 @@ enum rdma_nldev_attr { RDMA_NLDEV_ATTR_RES_RAW, /* binary */ +#ifndef __GENKSYMS__ RDMA_NLDEV_ATTR_RES_CTX, /* nested table */ RDMA_NLDEV_ATTR_RES_CTX_ENTRY, /* nested table */ @@ -548,6 +551,7 @@ enum rdma_nldev_attr { RDMA_NLDEV_ATTR_MIN_RANGE, /* u32 */ RDMA_NLDEV_ATTR_MAX_RANGE, /* u32 */ +#endif /* * Always the end */ -- 2.33.0