@@ -903,6 +903,35 @@ static int bnxt_re_fill_res_mr_entry(struct sk_buff *msg, struct ib_mr *ib_mr)
903
903
return - EMSGSIZE ;
904
904
}
905
905
906
+ static int bnxt_re_fill_res_mr_entry_raw (struct sk_buff * msg , struct ib_mr * ib_mr )
907
+ {
908
+ struct bnxt_re_dev * rdev ;
909
+ struct bnxt_re_mr * mr ;
910
+ int err , len ;
911
+ void * data ;
912
+
913
+ mr = container_of (ib_mr , struct bnxt_re_mr , ib_mr );
914
+ rdev = mr -> rdev ;
915
+
916
+ err = bnxt_re_read_context_allowed (rdev );
917
+ if (err )
918
+ return err ;
919
+
920
+ len = bnxt_qplib_is_chip_gen_p7 (rdev -> chip_ctx ) ? BNXT_RE_CONTEXT_TYPE_MRW_SIZE_P7 :
921
+ BNXT_RE_CONTEXT_TYPE_MRW_SIZE_P5 ;
922
+ data = kzalloc (len , GFP_KERNEL );
923
+ if (!data )
924
+ return - ENOMEM ;
925
+
926
+ err = bnxt_qplib_read_context (& rdev -> rcfw , CMDQ_READ_CONTEXT_TYPE_MRW ,
927
+ mr -> qplib_mr .lkey , len , data );
928
+ if (!err )
929
+ err = nla_put (msg , RDMA_NLDEV_ATTR_RES_RAW , len , data );
930
+
931
+ kfree (data );
932
+ return err ;
933
+ }
934
+
906
935
static int bnxt_re_fill_res_cq_entry (struct sk_buff * msg , struct ib_cq * ib_cq )
907
936
{
908
937
struct bnxt_qplib_hwq * cq_hwq ;
@@ -933,6 +962,36 @@ static int bnxt_re_fill_res_cq_entry(struct sk_buff *msg, struct ib_cq *ib_cq)
933
962
return - EMSGSIZE ;
934
963
}
935
964
965
+ static int bnxt_re_fill_res_cq_entry_raw (struct sk_buff * msg , struct ib_cq * ib_cq )
966
+ {
967
+ struct bnxt_re_dev * rdev ;
968
+ struct bnxt_re_cq * cq ;
969
+ int err , len ;
970
+ void * data ;
971
+
972
+ cq = container_of (ib_cq , struct bnxt_re_cq , ib_cq );
973
+ rdev = cq -> rdev ;
974
+
975
+ err = bnxt_re_read_context_allowed (rdev );
976
+ if (err )
977
+ return err ;
978
+
979
+ len = bnxt_qplib_is_chip_gen_p7 (rdev -> chip_ctx ) ? BNXT_RE_CONTEXT_TYPE_CQ_SIZE_P7 :
980
+ BNXT_RE_CONTEXT_TYPE_CQ_SIZE_P5 ;
981
+ data = kzalloc (len , GFP_KERNEL );
982
+ if (!data )
983
+ return - ENOMEM ;
984
+
985
+ err = bnxt_qplib_read_context (& rdev -> rcfw ,
986
+ CMDQ_READ_CONTEXT_TYPE_CQ ,
987
+ cq -> qplib_cq .id , len , data );
988
+ if (!err )
989
+ err = nla_put (msg , RDMA_NLDEV_ATTR_RES_RAW , len , data );
990
+
991
+ kfree (data );
992
+ return err ;
993
+ }
994
+
936
995
static int bnxt_re_fill_res_qp_entry (struct sk_buff * msg , struct ib_qp * ib_qp )
937
996
{
938
997
struct bnxt_qplib_qp * qplib_qp ;
@@ -977,6 +1036,31 @@ static int bnxt_re_fill_res_qp_entry(struct sk_buff *msg, struct ib_qp *ib_qp)
977
1036
return - EMSGSIZE ;
978
1037
}
979
1038
1039
+ static int bnxt_re_fill_res_qp_entry_raw (struct sk_buff * msg , struct ib_qp * ibqp )
1040
+ {
1041
+ struct bnxt_re_dev * rdev = to_bnxt_re_dev (ibqp -> device , ibdev );
1042
+ int err , len ;
1043
+ void * data ;
1044
+
1045
+ err = bnxt_re_read_context_allowed (rdev );
1046
+ if (err )
1047
+ return err ;
1048
+
1049
+ len = bnxt_qplib_is_chip_gen_p7 (rdev -> chip_ctx ) ? BNXT_RE_CONTEXT_TYPE_QPC_SIZE_P7 :
1050
+ BNXT_RE_CONTEXT_TYPE_QPC_SIZE_P5 ;
1051
+ data = kzalloc (len , GFP_KERNEL );
1052
+ if (!data )
1053
+ return - ENOMEM ;
1054
+
1055
+ err = bnxt_qplib_read_context (& rdev -> rcfw , CMDQ_READ_CONTEXT_TYPE_QPC ,
1056
+ ibqp -> qp_num , len , data );
1057
+ if (!err )
1058
+ err = nla_put (msg , RDMA_NLDEV_ATTR_RES_RAW , len , data );
1059
+
1060
+ kfree (data );
1061
+ return err ;
1062
+ }
1063
+
980
1064
static int bnxt_re_fill_res_srq_entry (struct sk_buff * msg , struct ib_srq * ib_srq )
981
1065
{
982
1066
struct nlattr * table_attr ;
@@ -1003,6 +1087,36 @@ static int bnxt_re_fill_res_srq_entry(struct sk_buff *msg, struct ib_srq *ib_srq
1003
1087
return - EMSGSIZE ;
1004
1088
}
1005
1089
1090
+ static int bnxt_re_fill_res_srq_entry_raw (struct sk_buff * msg , struct ib_srq * ib_srq )
1091
+ {
1092
+ struct bnxt_re_dev * rdev ;
1093
+ struct bnxt_re_srq * srq ;
1094
+ int err , len ;
1095
+ void * data ;
1096
+
1097
+ srq = container_of (ib_srq , struct bnxt_re_srq , ib_srq );
1098
+ rdev = srq -> rdev ;
1099
+
1100
+ err = bnxt_re_read_context_allowed (rdev );
1101
+ if (err )
1102
+ return err ;
1103
+
1104
+ len = bnxt_qplib_is_chip_gen_p7 (rdev -> chip_ctx ) ? BNXT_RE_CONTEXT_TYPE_SRQ_SIZE_P7 :
1105
+ BNXT_RE_CONTEXT_TYPE_SRQ_SIZE_P5 ;
1106
+
1107
+ data = kzalloc (len , GFP_KERNEL );
1108
+ if (!data )
1109
+ return - ENOMEM ;
1110
+
1111
+ err = bnxt_qplib_read_context (& rdev -> rcfw , CMDQ_READ_CONTEXT_TYPE_SRQ ,
1112
+ srq -> qplib_srq .id , len , data );
1113
+ if (!err )
1114
+ err = nla_put (msg , RDMA_NLDEV_ATTR_RES_RAW , len , data );
1115
+
1116
+ kfree (data );
1117
+ return err ;
1118
+ }
1119
+
1006
1120
static const struct ib_device_ops bnxt_re_dev_ops = {
1007
1121
.owner = THIS_MODULE ,
1008
1122
.driver_id = RDMA_DRIVER_BNXT_RE ,
@@ -1063,9 +1177,13 @@ static const struct ib_device_ops bnxt_re_dev_ops = {
1063
1177
1064
1178
static const struct ib_device_ops restrack_ops = {
1065
1179
.fill_res_cq_entry = bnxt_re_fill_res_cq_entry ,
1180
+ .fill_res_cq_entry_raw = bnxt_re_fill_res_cq_entry_raw ,
1066
1181
.fill_res_qp_entry = bnxt_re_fill_res_qp_entry ,
1182
+ .fill_res_qp_entry_raw = bnxt_re_fill_res_qp_entry_raw ,
1067
1183
.fill_res_mr_entry = bnxt_re_fill_res_mr_entry ,
1184
+ .fill_res_mr_entry_raw = bnxt_re_fill_res_mr_entry_raw ,
1068
1185
.fill_res_srq_entry = bnxt_re_fill_res_srq_entry ,
1186
+ .fill_res_srq_entry_raw = bnxt_re_fill_res_srq_entry_raw ,
1069
1187
};
1070
1188
1071
1189
static int bnxt_re_register_ib (struct bnxt_re_dev * rdev )
0 commit comments