Lines Matching refs:net

41 		       struct nlmsghdr *nlh, struct net *net, u32 portid,
44 static struct mpls_route *mpls_route_input_rcu(struct net *net, unsigned index) in mpls_route_input_rcu() argument
48 if (index < net->mpls.platform_labels) { in mpls_route_input_rcu()
50 rcu_dereference(net->mpls.platform_label); in mpls_route_input_rcu()
139 struct net *net = dev_net(dev); in mpls_forward() local
175 rt = mpls_route_input_rcu(net, dec.label); in mpls_forward()
279 static void mpls_notify_route(struct net *net, unsigned index, in mpls_notify_route() argument
290 rtmsg_lfib(event, index, rt, nlh, net, portid, nlm_flags); in mpls_notify_route()
293 static void mpls_route_update(struct net *net, unsigned index, in mpls_route_update() argument
302 platform_label = rtnl_dereference(net->mpls.platform_label); in mpls_route_update()
309 mpls_notify_route(net, index, old, new, info); in mpls_route_update()
315 static unsigned find_free_label(struct net *net) in find_free_label() argument
321 platform_label = rtnl_dereference(net->mpls.platform_label); in find_free_label()
322 platform_labels = net->mpls.platform_labels; in find_free_label()
333 struct net *net = cfg->rc_nlinfo.nl_net; in mpls_route_add() local
345 index = find_free_label(net); in mpls_route_add()
353 if (index >= net->mpls.platform_labels) in mpls_route_add()
361 dev = dev_get_by_index(net, cfg->rc_ifindex); in mpls_route_add()
381 platform_label = rtnl_dereference(net->mpls.platform_label); in mpls_route_add()
407 mpls_route_update(net, index, NULL, rt, &cfg->rc_nlinfo); in mpls_route_add()
420 struct net *net = cfg->rc_nlinfo.nl_net; in mpls_route_del() local
431 if (index >= net->mpls.platform_labels) in mpls_route_del()
434 mpls_route_update(net, index, NULL, NULL, &cfg->rc_nlinfo); in mpls_route_del()
522 struct net *net = dev_net(dev); in mpls_ifdown() local
526 platform_label = rtnl_dereference(net->mpls.platform_label); in mpls_ifdown()
527 for (index = 0; index < net->mpls.platform_labels; index++) { in mpls_ifdown()
861 struct net *net = sock_net(skb->sk); in mpls_dump_routes() local
872 platform_label = rtnl_dereference(net->mpls.platform_label); in mpls_dump_routes()
873 platform_labels = net->mpls.platform_labels; in mpls_dump_routes()
904 struct nlmsghdr *nlh, struct net *net, u32 portid, in rtmsg_lfib() argument
922 rtnl_notify(skb, net, portid, RTNLGRP_MPLS_ROUTE, nlh, GFP_KERNEL); in rtmsg_lfib()
927 rtnl_set_sk_err(net, RTNLGRP_MPLS_ROUTE, err); in rtmsg_lfib()
930 static int resize_platform_label_table(struct net *net, size_t limit) in resize_platform_label_table() argument
950 struct net_device *lo = net->loopback_dev; in resize_platform_label_table()
960 struct net_device *lo = net->loopback_dev; in resize_platform_label_table()
972 old = rtnl_dereference(net->mpls.platform_label); in resize_platform_label_table()
973 old_limit = net->mpls.platform_labels; in resize_platform_label_table()
977 mpls_route_update(net, index, NULL, NULL, NULL); in resize_platform_label_table()
1000 net->mpls.platform_labels = limit; in resize_platform_label_table()
1001 rcu_assign_pointer(net->mpls.platform_label, labels); in resize_platform_label_table()
1025 struct net *net = table->data; in mpls_platform_labels() local
1026 int platform_labels = net->mpls.platform_labels; in mpls_platform_labels()
1040 ret = resize_platform_label_table(net, platform_labels); in mpls_platform_labels()
1056 static int mpls_net_init(struct net *net) in mpls_net_init() argument
1060 net->mpls.platform_labels = 0; in mpls_net_init()
1061 net->mpls.platform_label = NULL; in mpls_net_init()
1067 table[0].data = net; in mpls_net_init()
1068 net->mpls.ctl = register_net_sysctl(net, "net/mpls", table); in mpls_net_init()
1069 if (net->mpls.ctl == NULL) in mpls_net_init()
1075 static void mpls_net_exit(struct net *net) in mpls_net_exit() argument
1082 table = net->mpls.ctl->ctl_table_arg; in mpls_net_exit()
1083 unregister_net_sysctl_table(net->mpls.ctl); in mpls_net_exit()
1096 platform_label = rtnl_dereference(net->mpls.platform_label); in mpls_net_exit()
1097 platform_labels = net->mpls.platform_labels; in mpls_net_exit()