Lines Matching full:rt
127 struct mctp_test_route *rt; in mctp_route_test_alloc() local
129 rt = kzalloc_obj(*rt); in mctp_route_test_alloc()
130 if (!rt) in mctp_route_test_alloc()
133 INIT_LIST_HEAD(&rt->rt.list); in mctp_route_test_alloc()
134 refcount_set(&rt->rt.refs, 1); in mctp_route_test_alloc()
135 rt->rt.output = mctp_test_dst_output; in mctp_route_test_alloc()
137 return rt; in mctp_route_test_alloc()
145 struct mctp_test_route *rt; in mctp_test_create_route_direct() local
147 rt = mctp_route_test_alloc(); in mctp_test_create_route_direct()
148 if (!rt) in mctp_test_create_route_direct()
151 rt->rt.min = eid; in mctp_test_create_route_direct()
152 rt->rt.max = eid; in mctp_test_create_route_direct()
153 rt->rt.mtu = mtu; in mctp_test_create_route_direct()
154 rt->rt.type = RTN_UNSPEC; in mctp_test_create_route_direct()
155 rt->rt.dst_type = MCTP_ROUTE_DIRECT; in mctp_test_create_route_direct()
158 rt->rt.dev = dev; in mctp_test_create_route_direct()
160 list_add_rcu(&rt->rt.list, &net->mctp.routes); in mctp_test_create_route_direct()
162 return rt; in mctp_test_create_route_direct()
171 struct mctp_test_route *rt; in mctp_test_create_route_gw() local
173 rt = mctp_route_test_alloc(); in mctp_test_create_route_gw()
174 if (!rt) in mctp_test_create_route_gw()
177 rt->rt.min = eid; in mctp_test_create_route_gw()
178 rt->rt.max = eid; in mctp_test_create_route_gw()
179 rt->rt.mtu = mtu; in mctp_test_create_route_gw()
180 rt->rt.type = RTN_UNSPEC; in mctp_test_create_route_gw()
181 rt->rt.dst_type = MCTP_ROUTE_GATEWAY; in mctp_test_create_route_gw()
182 rt->rt.gateway.eid = gw; in mctp_test_create_route_gw()
183 rt->rt.gateway.net = netid; in mctp_test_create_route_gw()
185 list_add_rcu(&rt->rt.list, &net->mctp.routes); in mctp_test_create_route_gw()
187 return rt; in mctp_test_create_route_gw()
211 void mctp_test_route_destroy(struct kunit *test, struct mctp_test_route *rt) in mctp_test_route_destroy() argument
216 list_del_rcu(&rt->rt.list); in mctp_test_route_destroy()
219 if (rt->rt.dst_type == MCTP_ROUTE_DIRECT && rt->rt.dev) in mctp_test_route_destroy()
220 mctp_dev_put(rt->rt.dev); in mctp_test_route_destroy()
222 refs = refcount_read(&rt->rt.refs); in mctp_test_route_destroy()
225 kfree_rcu(&rt->rt, rcu); in mctp_test_route_destroy()