Lines Matching refs:nexthop

1115 	struct nsim_nexthop *nexthop;  in nsim_nexthop_create()  local
1119 nexthop = kzalloc(sizeof(*nexthop), GFP_KERNEL); in nsim_nexthop_create()
1120 if (!nexthop) in nsim_nexthop_create()
1123 nexthop->id = info->id; in nsim_nexthop_create()
1139 nexthop->is_resilient = true; in nsim_nexthop_create()
1143 kfree(nexthop); in nsim_nexthop_create()
1147 nexthop->occ = occ; in nsim_nexthop_create()
1148 return nexthop; in nsim_nexthop_create()
1151 static void nsim_nexthop_destroy(struct nsim_nexthop *nexthop) in nsim_nexthop_destroy() argument
1153 kfree(nexthop); in nsim_nexthop_destroy()
1184 const struct nsim_nexthop *nexthop, in nsim_nexthop_hw_flags_set() argument
1189 nexthop_set_hw_flags(net, nexthop->id, false, trap); in nsim_nexthop_hw_flags_set()
1191 if (!nexthop->is_resilient) in nsim_nexthop_hw_flags_set()
1194 for (i = 0; i < nexthop->occ; i++) in nsim_nexthop_hw_flags_set()
1195 nexthop_bucket_set_hw_flags(net, nexthop->id, i, false, trap); in nsim_nexthop_hw_flags_set()
1199 struct nsim_nexthop *nexthop, in nsim_nexthop_add() argument
1205 err = nsim_nexthop_account(data, nexthop->occ, true, extack); in nsim_nexthop_add()
1209 err = rhashtable_insert_fast(&data->nexthop_ht, &nexthop->ht_node, in nsim_nexthop_add()
1216 nsim_nexthop_hw_flags_set(net, nexthop, true); in nsim_nexthop_add()
1221 nsim_nexthop_account(data, nexthop->occ, false, extack); in nsim_nexthop_add()
1226 struct nsim_nexthop *nexthop, in nsim_nexthop_replace() argument
1233 err = nsim_nexthop_account(data, nexthop->occ, true, extack); in nsim_nexthop_replace()
1238 &nexthop_old->ht_node, &nexthop->ht_node, in nsim_nexthop_replace()
1245 nsim_nexthop_hw_flags_set(net, nexthop, true); in nsim_nexthop_replace()
1252 nsim_nexthop_account(data, nexthop->occ, false, extack); in nsim_nexthop_replace()
1259 struct nsim_nexthop *nexthop, *nexthop_old; in nsim_nexthop_insert() local
1262 nexthop = nsim_nexthop_create(data, info); in nsim_nexthop_insert()
1263 if (IS_ERR(nexthop)) in nsim_nexthop_insert()
1264 return PTR_ERR(nexthop); in nsim_nexthop_insert()
1269 err = nsim_nexthop_add(data, nexthop, info->extack); in nsim_nexthop_insert()
1271 err = nsim_nexthop_replace(data, nexthop, nexthop_old, in nsim_nexthop_insert()
1275 nsim_nexthop_destroy(nexthop); in nsim_nexthop_insert()
1283 struct nsim_nexthop *nexthop; in nsim_nexthop_remove() local
1285 nexthop = rhashtable_lookup_fast(&data->nexthop_ht, &info->id, in nsim_nexthop_remove()
1287 if (!nexthop) in nsim_nexthop_remove()
1290 rhashtable_remove_fast(&data->nexthop_ht, &nexthop->ht_node, in nsim_nexthop_remove()
1292 nsim_nexthop_account(data, nexthop->occ, false, info->extack); in nsim_nexthop_remove()
1293 nsim_nexthop_destroy(nexthop); in nsim_nexthop_remove()
1354 struct nsim_nexthop *nexthop = ptr; in nsim_nexthop_free() local
1359 nsim_nexthop_hw_flags_set(net, nexthop, false); in nsim_nexthop_free()
1360 nsim_nexthop_account(data, nexthop->occ, false, NULL); in nsim_nexthop_free()
1361 nsim_nexthop_destroy(nexthop); in nsim_nexthop_free()
1370 struct nsim_nexthop *nexthop; in nsim_nexthop_bucket_activity_write() local
1391 nexthop = rhashtable_lookup_fast(&data->nexthop_ht, &nhid, in nsim_nexthop_bucket_activity_write()
1393 if (!nexthop || !nexthop->is_resilient || in nsim_nexthop_bucket_activity_write()
1394 bucket_index >= nexthop->occ) { in nsim_nexthop_bucket_activity_write()
1399 activity = bitmap_zalloc(nexthop->occ, GFP_KERNEL); in nsim_nexthop_bucket_activity_write()
1406 nexthop_res_grp_activity_update(net, nhid, nexthop->occ, activity); in nsim_nexthop_bucket_activity_write()