Lines Matching full:rt
109 struct mctp_test_route *rt; in mctp_route_test_alloc() local
111 rt = kzalloc(sizeof(*rt), GFP_KERNEL); in mctp_route_test_alloc()
112 if (!rt) in mctp_route_test_alloc()
115 INIT_LIST_HEAD(&rt->rt.list); in mctp_route_test_alloc()
116 refcount_set(&rt->rt.refs, 1); in mctp_route_test_alloc()
117 rt->rt.output = mctp_test_dst_output; in mctp_route_test_alloc()
119 return rt; in mctp_route_test_alloc()
127 struct mctp_test_route *rt; in mctp_test_create_route_direct() local
129 rt = mctp_route_test_alloc(); in mctp_test_create_route_direct()
130 if (!rt) in mctp_test_create_route_direct()
133 rt->rt.min = eid; in mctp_test_create_route_direct()
134 rt->rt.max = eid; in mctp_test_create_route_direct()
135 rt->rt.mtu = mtu; in mctp_test_create_route_direct()
136 rt->rt.type = RTN_UNSPEC; in mctp_test_create_route_direct()
137 rt->rt.dst_type = MCTP_ROUTE_DIRECT; in mctp_test_create_route_direct()
140 rt->rt.dev = dev; in mctp_test_create_route_direct()
142 list_add_rcu(&rt->rt.list, &net->mctp.routes); in mctp_test_create_route_direct()
144 return rt; in mctp_test_create_route_direct()
153 struct mctp_test_route *rt; in mctp_test_create_route_gw() local
155 rt = mctp_route_test_alloc(); in mctp_test_create_route_gw()
156 if (!rt) in mctp_test_create_route_gw()
159 rt->rt.min = eid; in mctp_test_create_route_gw()
160 rt->rt.max = eid; in mctp_test_create_route_gw()
161 rt->rt.mtu = mtu; in mctp_test_create_route_gw()
162 rt->rt.type = RTN_UNSPEC; in mctp_test_create_route_gw()
163 rt->rt.dst_type = MCTP_ROUTE_GATEWAY; in mctp_test_create_route_gw()
164 rt->rt.gateway.eid = gw; in mctp_test_create_route_gw()
165 rt->rt.gateway.net = netid; in mctp_test_create_route_gw()
167 list_add_rcu(&rt->rt.list, &net->mctp.routes); in mctp_test_create_route_gw()
169 return rt; in mctp_test_create_route_gw()
197 void mctp_test_route_destroy(struct kunit *test, struct mctp_test_route *rt) in mctp_test_route_destroy() argument
202 list_del_rcu(&rt->rt.list); in mctp_test_route_destroy()
205 if (rt->rt.dst_type == MCTP_ROUTE_DIRECT && rt->rt.dev) in mctp_test_route_destroy()
206 mctp_dev_put(rt->rt.dev); in mctp_test_route_destroy()
208 refs = refcount_read(&rt->rt.refs); in mctp_test_route_destroy()
211 kfree_rcu(&rt->rt, rcu); in mctp_test_route_destroy()