File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ static const char *type2str(enum rdma_restrack_type type)
32
32
[RDMA_RESTRACK_QP ] = "QP" ,
33
33
[RDMA_RESTRACK_CM_ID ] = "CM_ID" ,
34
34
[RDMA_RESTRACK_MR ] = "MR" ,
35
+ [RDMA_RESTRACK_CTX ] = "CTX" ,
35
36
};
36
37
37
38
return names [type ];
@@ -130,6 +131,8 @@ static struct ib_device *res_to_dev(struct rdma_restrack_entry *res)
130
131
res )-> id .device ;
131
132
case RDMA_RESTRACK_MR :
132
133
return container_of (res , struct ib_mr , res )-> device ;
134
+ case RDMA_RESTRACK_CTX :
135
+ return container_of (res , struct ib_ucontext , res )-> device ;
133
136
default :
134
137
WARN_ONCE (true, "Wrong resource tracking type %u\n" , res -> type );
135
138
return NULL ;
@@ -149,6 +152,8 @@ static bool res_is_user(struct rdma_restrack_entry *res)
149
152
return !res -> kern_name ;
150
153
case RDMA_RESTRACK_MR :
151
154
return container_of (res , struct ib_mr , res )-> pd -> uobject ;
155
+ case RDMA_RESTRACK_CTX :
156
+ return true;
152
157
default :
153
158
WARN_ONCE (true, "Wrong resource tracking type %u\n" , res -> type );
154
159
return false;
Original file line number Diff line number Diff line change @@ -1505,6 +1505,10 @@ struct ib_ucontext {
1505
1505
#endif
1506
1506
1507
1507
struct ib_rdmacg_object cg_obj ;
1508
+ /*
1509
+ * Implementation details of the RDMA core, don't use in drivers:
1510
+ */
1511
+ struct rdma_restrack_entry res ;
1508
1512
};
1509
1513
1510
1514
struct ib_uobject {
Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ enum rdma_restrack_type {
38
38
* @RDMA_RESTRACK_MR: Memory Region (MR)
39
39
*/
40
40
RDMA_RESTRACK_MR ,
41
+ /**
42
+ * @RDMA_RESTRACK_CTX: Verbs contexts (CTX)
43
+ */
44
+ RDMA_RESTRACK_CTX ,
41
45
/**
42
46
* @RDMA_RESTRACK_MAX: Last entry, used for array dclarations
43
47
*/
You can’t perform that action at this time.
0 commit comments