Lines Matching refs:rt

8 	struct mctp_route	rt;  member
12 static int mctp_test_route_output(struct mctp_route *rt, struct sk_buff *skb) in mctp_test_route_output() argument
14 struct mctp_test_route *test_rt = container_of(rt, struct mctp_test_route, rt); in mctp_test_route_output()
24 struct mctp_test_route *rt; in mctp_route_test_alloc() local
26 rt = kzalloc(sizeof(*rt), GFP_KERNEL); in mctp_route_test_alloc()
27 if (!rt) in mctp_route_test_alloc()
30 INIT_LIST_HEAD(&rt->rt.list); in mctp_route_test_alloc()
31 refcount_set(&rt->rt.refs, 1); in mctp_route_test_alloc()
32 rt->rt.output = mctp_test_route_output; in mctp_route_test_alloc()
34 skb_queue_head_init(&rt->pkts); in mctp_route_test_alloc()
36 return rt; in mctp_route_test_alloc()
44 struct mctp_test_route *rt; in mctp_test_create_route() local
46 rt = mctp_route_test_alloc(); in mctp_test_create_route()
47 if (!rt) in mctp_test_create_route()
50 rt->rt.min = eid; in mctp_test_create_route()
51 rt->rt.max = eid; in mctp_test_create_route()
52 rt->rt.mtu = mtu; in mctp_test_create_route()
53 rt->rt.type = RTN_UNSPEC; in mctp_test_create_route()
56 rt->rt.dev = dev; in mctp_test_create_route()
58 list_add_rcu(&rt->rt.list, &net->mctp.routes); in mctp_test_create_route()
60 return rt; in mctp_test_create_route()
64 struct mctp_test_route *rt) in mctp_test_route_destroy() argument
69 list_del_rcu(&rt->rt.list); in mctp_test_route_destroy()
72 skb_queue_purge(&rt->pkts); in mctp_test_route_destroy()
73 if (rt->rt.dev) in mctp_test_route_destroy()
74 mctp_dev_put(rt->rt.dev); in mctp_test_route_destroy()
76 refs = refcount_read(&rt->rt.refs); in mctp_test_route_destroy()
79 kfree_rcu(&rt->rt, rcu); in mctp_test_route_destroy()
133 struct mctp_test_route *rt; in mctp_test_fragment() local
150 rt = mctp_test_create_route(&init_net, NULL, 10, mtu); in mctp_test_fragment()
151 KUNIT_ASSERT_TRUE(test, rt); in mctp_test_fragment()
156 refcount_inc(&rt->rt.refs); in mctp_test_fragment()
158 rc = mctp_do_fragment_route(&rt->rt, skb, mtu, MCTP_TAG_OWNER); in mctp_test_fragment()
161 n = rt->pkts.qlen; in mctp_test_fragment()
174 skb2 = skb_dequeue(&rt->pkts); in mctp_test_fragment()
212 mctp_test_route_destroy(test, rt); in mctp_test_fragment()
242 struct mctp_test_route *rt; in mctp_test_rx_input() local
251 rt = mctp_test_create_route(&init_net, dev->mdev, 8, 68); in mctp_test_rx_input()
252 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, rt); in mctp_test_rx_input()
261 KUNIT_EXPECT_EQ(test, !!rt->pkts.qlen, params->input); in mctp_test_rx_input()
263 mctp_test_route_destroy(test, rt); in mctp_test_rx_input()
294 struct mctp_test_route *rt; in __mctp_route_test_init() local
302 rt = mctp_test_create_route(&init_net, dev->mdev, 8, 68); in __mctp_route_test_init()
303 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, rt); in __mctp_route_test_init()
315 *rtp = rt; in __mctp_route_test_init()
322 struct mctp_test_route *rt, in __mctp_route_test_fini() argument
326 mctp_test_route_destroy(test, rt); in __mctp_route_test_fini()
340 struct mctp_test_route *rt; in mctp_test_route_input_sk() local
347 __mctp_route_test_init(test, &dev, &rt, &sock); in mctp_test_route_input_sk()
355 rc = mctp_route_input(&rt->rt, skb); in mctp_test_route_input_sk()
372 __mctp_route_test_fini(test, dev, rt, sock); in mctp_test_route_input_sk()
409 struct mctp_test_route *rt; in mctp_test_route_input_sk_reasm() local
417 __mctp_route_test_init(test, &dev, &rt, &sock); in mctp_test_route_input_sk_reasm()
427 rc = mctp_route_input(&rt->rt, skb); in mctp_test_route_input_sk_reasm()
441 __mctp_route_test_fini(test, dev, rt, sock); in mctp_test_route_input_sk_reasm()