Lines Matching refs:nexthop

30 #include <net/nexthop.h>
556 * up from several fib6_info structs (one for each nexthop), so we
785 /* If not all the nexthops are deleted, then only reduce the nexthop
1115 struct nsim_nexthop *nexthop;
1119 nexthop = kzalloc(sizeof(*nexthop), GFP_KERNEL);
1120 if (!nexthop)
1123 nexthop->id = info->id;
1125 /* Determine the number of nexthop entries the new nexthop will
1139 nexthop->is_resilient = true;
1142 NL_SET_ERR_MSG_MOD(info->extack, "Unsupported nexthop type");
1143 kfree(nexthop);
1147 nexthop->occ = occ;
1148 return nexthop;
1151 static void nsim_nexthop_destroy(struct nsim_nexthop *nexthop)
1153 kfree(nexthop);
1184 const struct nsim_nexthop *nexthop,
1189 nexthop_set_hw_flags(net, nexthop->id, false, trap);
1191 if (!nexthop->is_resilient)
1194 for (i = 0; i < nexthop->occ; i++)
1195 nexthop_bucket_set_hw_flags(net, nexthop->id, i, false, trap);
1199 struct nsim_nexthop *nexthop,
1205 err = nsim_nexthop_account(data, nexthop->occ, true, extack);
1209 err = rhashtable_insert_fast(&data->nexthop_ht, &nexthop->ht_node,
1212 NL_SET_ERR_MSG_MOD(extack, "Failed to insert nexthop");
1216 nsim_nexthop_hw_flags_set(net, nexthop, true);
1221 nsim_nexthop_account(data, nexthop->occ, false, extack);
1226 struct nsim_nexthop *nexthop,
1233 err = nsim_nexthop_account(data, nexthop->occ, true, extack);
1238 &nexthop_old->ht_node, &nexthop->ht_node,
1241 NL_SET_ERR_MSG_MOD(extack, "Failed to replace nexthop");
1245 nsim_nexthop_hw_flags_set(net, nexthop, true);
1252 nsim_nexthop_account(data, nexthop->occ, false, extack);
1259 struct nsim_nexthop *nexthop, *nexthop_old;
1262 nexthop = nsim_nexthop_create(data, info);
1263 if (IS_ERR(nexthop))
1264 return PTR_ERR(nexthop);
1269 err = nsim_nexthop_add(data, nexthop, info->extack);
1271 err = nsim_nexthop_replace(data, nexthop, nexthop_old,
1275 nsim_nexthop_destroy(nexthop);
1283 struct nsim_nexthop *nexthop;
1285 nexthop = rhashtable_lookup_fast(&data->nexthop_ht, &info->id,
1287 if (!nexthop)
1290 rhashtable_remove_fast(&data->nexthop_ht, &nexthop->ht_node,
1292 nsim_nexthop_account(data, nexthop->occ, false, info->extack);
1293 nsim_nexthop_destroy(nexthop);
1300 NL_SET_ERR_MSG_MOD(info->extack, "Failed to replace a resilient nexthop group");
1311 NL_SET_ERR_MSG_MOD(info->extack, "Failed to replace nexthop bucket");
1354 struct nsim_nexthop *nexthop = ptr;
1359 nsim_nexthop_hw_flags_set(net, nexthop, false);
1360 nsim_nexthop_account(data, nexthop->occ, false, NULL);
1361 nsim_nexthop_destroy(nexthop);
1370 struct nsim_nexthop *nexthop;
1389 nexthop = rhashtable_lookup_fast(&data->nexthop_ht, &nhid,
1391 if (!nexthop || !nexthop->is_resilient ||
1392 bucket_index >= nexthop->occ) {
1397 activity = bitmap_zalloc(nexthop->occ, GFP_KERNEL);
1404 nexthop_res_grp_activity_update(net, nhid, nexthop->occ, activity);
1590 pr_err("Failed to register nexthop notifier\n");