Lines Matching refs:nexthop

1100 	struct nsim_nexthop *nexthop;  in nsim_nexthop_create()  local
1104 nexthop = kzalloc(sizeof(*nexthop), GFP_KERNEL); in nsim_nexthop_create()
1105 if (!nexthop) in nsim_nexthop_create()
1108 nexthop->id = info->id; in nsim_nexthop_create()
1124 nexthop->is_resilient = true; in nsim_nexthop_create()
1128 kfree(nexthop); in nsim_nexthop_create()
1132 nexthop->occ = occ; in nsim_nexthop_create()
1133 return nexthop; in nsim_nexthop_create()
1136 static void nsim_nexthop_destroy(struct nsim_nexthop *nexthop) in nsim_nexthop_destroy() argument
1138 kfree(nexthop); in nsim_nexthop_destroy()
1169 const struct nsim_nexthop *nexthop, in nsim_nexthop_hw_flags_set() argument
1174 nexthop_set_hw_flags(net, nexthop->id, false, trap); in nsim_nexthop_hw_flags_set()
1176 if (!nexthop->is_resilient) in nsim_nexthop_hw_flags_set()
1179 for (i = 0; i < nexthop->occ; i++) in nsim_nexthop_hw_flags_set()
1180 nexthop_bucket_set_hw_flags(net, nexthop->id, i, false, trap); in nsim_nexthop_hw_flags_set()
1184 struct nsim_nexthop *nexthop, in nsim_nexthop_add() argument
1190 err = nsim_nexthop_account(data, nexthop->occ, true, extack); in nsim_nexthop_add()
1194 err = rhashtable_insert_fast(&data->nexthop_ht, &nexthop->ht_node, in nsim_nexthop_add()
1201 nsim_nexthop_hw_flags_set(net, nexthop, true); in nsim_nexthop_add()
1206 nsim_nexthop_account(data, nexthop->occ, false, extack); in nsim_nexthop_add()
1211 struct nsim_nexthop *nexthop, in nsim_nexthop_replace() argument
1218 err = nsim_nexthop_account(data, nexthop->occ, true, extack); in nsim_nexthop_replace()
1223 &nexthop_old->ht_node, &nexthop->ht_node, in nsim_nexthop_replace()
1230 nsim_nexthop_hw_flags_set(net, nexthop, true); in nsim_nexthop_replace()
1237 nsim_nexthop_account(data, nexthop->occ, false, extack); in nsim_nexthop_replace()
1244 struct nsim_nexthop *nexthop, *nexthop_old; in nsim_nexthop_insert() local
1247 nexthop = nsim_nexthop_create(data, info); in nsim_nexthop_insert()
1248 if (IS_ERR(nexthop)) in nsim_nexthop_insert()
1249 return PTR_ERR(nexthop); in nsim_nexthop_insert()
1254 err = nsim_nexthop_add(data, nexthop, info->extack); in nsim_nexthop_insert()
1256 err = nsim_nexthop_replace(data, nexthop, nexthop_old, in nsim_nexthop_insert()
1260 nsim_nexthop_destroy(nexthop); in nsim_nexthop_insert()
1268 struct nsim_nexthop *nexthop; in nsim_nexthop_remove() local
1270 nexthop = rhashtable_lookup_fast(&data->nexthop_ht, &info->id, in nsim_nexthop_remove()
1272 if (!nexthop) in nsim_nexthop_remove()
1275 rhashtable_remove_fast(&data->nexthop_ht, &nexthop->ht_node, in nsim_nexthop_remove()
1277 nsim_nexthop_account(data, nexthop->occ, false, info->extack); in nsim_nexthop_remove()
1278 nsim_nexthop_destroy(nexthop); in nsim_nexthop_remove()
1339 struct nsim_nexthop *nexthop = ptr; in nsim_nexthop_free() local
1344 nsim_nexthop_hw_flags_set(net, nexthop, false); in nsim_nexthop_free()
1345 nsim_nexthop_account(data, nexthop->occ, false, NULL); in nsim_nexthop_free()
1346 nsim_nexthop_destroy(nexthop); in nsim_nexthop_free()
1355 struct nsim_nexthop *nexthop; in nsim_nexthop_bucket_activity_write() local
1374 nexthop = rhashtable_lookup_fast(&data->nexthop_ht, &nhid, in nsim_nexthop_bucket_activity_write()
1376 if (!nexthop || !nexthop->is_resilient || in nsim_nexthop_bucket_activity_write()
1377 bucket_index >= nexthop->occ) { in nsim_nexthop_bucket_activity_write()
1382 activity = bitmap_zalloc(nexthop->occ, GFP_KERNEL); in nsim_nexthop_bucket_activity_write()
1389 nexthop_res_grp_activity_update(net, nhid, nexthop->occ, activity); in nsim_nexthop_bucket_activity_write()