Lines Matching refs:index

77 static struct mpls_route *mpls_route_input_rcu(struct net *net, unsigned index)
81 if (index < net->mpls.platform_labels) {
84 rt = rcu_dereference(platform_label[index]);
223 static struct mpls_nh *mpls_get_nexthop(struct mpls_route *rt, u8 index)
225 return (struct mpls_nh *)((u8 *)rt->rt_nh + index * rt->rt_nh_size);
536 static void mpls_notify_route(struct net *net, unsigned index,
546 if (rt && (index >= MPLS_LABEL_FIRST_UNRESERVED))
547 rtmsg_lfib(event, index, rt, nlh, net, portid, nlm_flags);
550 static void mpls_route_update(struct net *net, unsigned index,
560 rt = rtnl_dereference(platform_label[index]);
561 rcu_assign_pointer(platform_label[index], new);
563 mpls_notify_route(net, index, rt, new, info);
573 unsigned index;
577 for (index = MPLS_LABEL_FIRST_UNRESERVED; index < platform_labels;
578 index++) {
579 if (!rtnl_dereference(platform_label[index]))
580 return index;
937 static bool mpls_label_ok(struct net *net, unsigned int *index,
943 if (*index < MPLS_LABEL_FIRST_UNRESERVED) {
950 if (is_ok && *index >= net->mpls.platform_labels) {
956 *index = array_index_nospec(*index, net->mpls.platform_labels);
968 unsigned index;
972 index = cfg->rc_label;
975 if ((index == LABEL_NOT_SPECIFIED) &&
977 index = find_free_label(net);
980 if (!mpls_label_ok(net, &index, extack))
992 old = rtnl_dereference(platform_label[index]);
1038 mpls_route_update(net, index, rt, &cfg->rc_nlinfo);
1052 unsigned index;
1055 index = cfg->rc_label;
1057 if (!mpls_label_ok(net, &index, extack))
1060 mpls_route_update(net, index, NULL, &cfg->rc_nlinfo);
1501 unsigned index;
1504 for (index = 0; index < net->mpls.platform_labels; index++) {
1505 struct mpls_route *rt = rtnl_dereference(platform_label[index]);
1527 mpls_route_update(net, index, NULL, NULL);
1571 mpls_route_update(net, index, rt, NULL);
1581 unsigned index;
1585 for (index = 0; index < net->mpls.platform_labels; index++) {
1586 struct mpls_route *rt = rtnl_dereference(platform_label[index]);
1817 int index;
1879 for (index = 0; index <= RTA_MAX; index++) {
1880 struct nlattr *nla = tb[index];
1884 switch (index) {
2192 unsigned int index;
2212 index = cb->args[0];
2213 if (index < MPLS_LABEL_FIRST_UNRESERVED)
2214 index = MPLS_LABEL_FIRST_UNRESERVED;
2222 for (; index < platform_labels; index++) {
2225 rt = rtnl_dereference(platform_label[index]);
2235 index, rt, flags) < 0)
2238 cb->args[0] = index;
2535 unsigned index;
2579 for (index = limit; index < old_limit; index++)
2580 mpls_route_update(net, index, NULL, NULL);
2714 unsigned int index;
2732 for (index = 0; index < platform_labels; index++) {
2733 struct mpls_route *rt = rtnl_dereference(platform_label[index]);
2734 RCU_INIT_POINTER(platform_label[index], NULL);
2735 mpls_notify_route(net, index, rt, NULL, NULL);