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()
153 rc = mctp_do_fragment_route(&rt->rt, skb, mtu, MCTP_TAG_OWNER); in mctp_test_fragment()
156 n = rt->pkts.qlen; in mctp_test_fragment()
169 skb2 = skb_dequeue(&rt->pkts); in mctp_test_fragment()
207 mctp_test_route_destroy(test, rt); in mctp_test_fragment()
237 struct mctp_test_route *rt; in mctp_test_rx_input() local
246 rt = mctp_test_create_route(&init_net, dev->mdev, 8, 68); in mctp_test_rx_input()
247 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, rt); in mctp_test_rx_input()
256 KUNIT_EXPECT_EQ(test, !!rt->pkts.qlen, params->input); in mctp_test_rx_input()
258 mctp_test_route_destroy(test, rt); in mctp_test_rx_input()
289 struct mctp_test_route *rt; in __mctp_route_test_init() local
297 rt = mctp_test_create_route(&init_net, dev->mdev, 8, 68); in __mctp_route_test_init()
298 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, rt); in __mctp_route_test_init()
310 *rtp = rt; in __mctp_route_test_init()
317 struct mctp_test_route *rt, in __mctp_route_test_fini() argument
321 mctp_test_route_destroy(test, rt); in __mctp_route_test_fini()
335 struct mctp_test_route *rt; in mctp_test_route_input_sk() local
342 __mctp_route_test_init(test, &dev, &rt, &sock); in mctp_test_route_input_sk()
350 rc = mctp_route_input(&rt->rt, skb); in mctp_test_route_input_sk()
367 __mctp_route_test_fini(test, dev, rt, sock); in mctp_test_route_input_sk()
405 struct mctp_test_route *rt; in mctp_test_route_input_sk_reasm() local
413 __mctp_route_test_init(test, &dev, &rt, &sock); in mctp_test_route_input_sk_reasm()
423 rc = mctp_route_input(&rt->rt, skb); in mctp_test_route_input_sk_reasm()
437 __mctp_route_test_fini(test, dev, rt, sock); in mctp_test_route_input_sk_reasm()
539 struct mctp_test_route *rt; in mctp_test_route_input_sk_keys() local
555 rt = mctp_test_create_route(&init_net, dev->mdev, 8, 68); in mctp_test_route_input_sk_keys()
556 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, rt); in mctp_test_route_input_sk_keys()
582 rc = mctp_route_input(&rt->rt, skb); in mctp_test_route_input_sk_keys()
596 __mctp_route_test_fini(test, dev, rt, sock); in mctp_test_route_input_sk_keys()