Lines Matching refs:nexthop
1104 struct nsim_nexthop *nexthop; in nsim_nexthop_create() local
1108 nexthop = kzalloc(sizeof(*nexthop), GFP_KERNEL); in nsim_nexthop_create()
1109 if (!nexthop) in nsim_nexthop_create()
1112 nexthop->id = info->id; in nsim_nexthop_create()
1128 nexthop->is_resilient = true; in nsim_nexthop_create()
1132 kfree(nexthop); in nsim_nexthop_create()
1136 nexthop->occ = occ; in nsim_nexthop_create()
1137 return nexthop; in nsim_nexthop_create()
1140 static void nsim_nexthop_destroy(struct nsim_nexthop *nexthop) in nsim_nexthop_destroy() argument
1142 kfree(nexthop); in nsim_nexthop_destroy()
1173 const struct nsim_nexthop *nexthop, in nsim_nexthop_hw_flags_set() argument
1178 nexthop_set_hw_flags(net, nexthop->id, false, trap); in nsim_nexthop_hw_flags_set()
1180 if (!nexthop->is_resilient) in nsim_nexthop_hw_flags_set()
1183 for (i = 0; i < nexthop->occ; i++) in nsim_nexthop_hw_flags_set()
1184 nexthop_bucket_set_hw_flags(net, nexthop->id, i, false, trap); in nsim_nexthop_hw_flags_set()
1188 struct nsim_nexthop *nexthop, in nsim_nexthop_add() argument
1194 err = nsim_nexthop_account(data, nexthop->occ, true, extack); in nsim_nexthop_add()
1198 err = rhashtable_insert_fast(&data->nexthop_ht, &nexthop->ht_node, in nsim_nexthop_add()
1205 nsim_nexthop_hw_flags_set(net, nexthop, true); in nsim_nexthop_add()
1210 nsim_nexthop_account(data, nexthop->occ, false, extack); in nsim_nexthop_add()
1215 struct nsim_nexthop *nexthop, in nsim_nexthop_replace() argument
1222 err = nsim_nexthop_account(data, nexthop->occ, true, extack); in nsim_nexthop_replace()
1227 &nexthop_old->ht_node, &nexthop->ht_node, in nsim_nexthop_replace()
1234 nsim_nexthop_hw_flags_set(net, nexthop, true); in nsim_nexthop_replace()
1241 nsim_nexthop_account(data, nexthop->occ, false, extack); in nsim_nexthop_replace()
1248 struct nsim_nexthop *nexthop, *nexthop_old; in nsim_nexthop_insert() local
1251 nexthop = nsim_nexthop_create(data, info); in nsim_nexthop_insert()
1252 if (IS_ERR(nexthop)) in nsim_nexthop_insert()
1253 return PTR_ERR(nexthop); in nsim_nexthop_insert()
1258 err = nsim_nexthop_add(data, nexthop, info->extack); in nsim_nexthop_insert()
1260 err = nsim_nexthop_replace(data, nexthop, nexthop_old, in nsim_nexthop_insert()
1264 nsim_nexthop_destroy(nexthop); in nsim_nexthop_insert()
1272 struct nsim_nexthop *nexthop; in nsim_nexthop_remove() local
1274 nexthop = rhashtable_lookup_fast(&data->nexthop_ht, &info->id, in nsim_nexthop_remove()
1276 if (!nexthop) in nsim_nexthop_remove()
1279 rhashtable_remove_fast(&data->nexthop_ht, &nexthop->ht_node, in nsim_nexthop_remove()
1281 nsim_nexthop_account(data, nexthop->occ, false, info->extack); in nsim_nexthop_remove()
1282 nsim_nexthop_destroy(nexthop); in nsim_nexthop_remove()
1343 struct nsim_nexthop *nexthop = ptr; in nsim_nexthop_free() local
1348 nsim_nexthop_hw_flags_set(net, nexthop, false); in nsim_nexthop_free()
1349 nsim_nexthop_account(data, nexthop->occ, false, NULL); in nsim_nexthop_free()
1350 nsim_nexthop_destroy(nexthop); in nsim_nexthop_free()
1359 struct nsim_nexthop *nexthop; in nsim_nexthop_bucket_activity_write() local
1378 nexthop = rhashtable_lookup_fast(&data->nexthop_ht, &nhid, in nsim_nexthop_bucket_activity_write()
1380 if (!nexthop || !nexthop->is_resilient || in nsim_nexthop_bucket_activity_write()
1381 bucket_index >= nexthop->occ) { in nsim_nexthop_bucket_activity_write()
1386 activity = bitmap_zalloc(nexthop->occ, GFP_KERNEL); in nsim_nexthop_bucket_activity_write()
1393 nexthop_res_grp_activity_update(net, nhid, nexthop->occ, activity); in nsim_nexthop_bucket_activity_write()