Lines Matching refs:devlink
78 nsim_dev_take_snapshot(struct devlink *devlink, in nsim_dev_take_snapshot() argument
101 struct devlink *devlink; in nsim_dev_take_snapshot_write() local
106 devlink = priv_to_devlink(nsim_dev); in nsim_dev_take_snapshot_write()
108 err = nsim_dev_take_snapshot(devlink, NULL, NULL, &dummy_data); in nsim_dev_take_snapshot_write()
112 err = devlink_region_snapshot_id_get(devlink, &id); in nsim_dev_take_snapshot_write()
120 devlink_region_snapshot_id_put(devlink, id); in nsim_dev_take_snapshot_write()
429 static int nsim_dev_resources_register(struct devlink *devlink) in nsim_dev_resources_register() argument
439 err = devl_resource_register(devlink, "IPv4", (u64)-1, in nsim_dev_resources_register()
448 err = devl_resource_register(devlink, "fib", (u64)-1, in nsim_dev_resources_register()
456 err = devl_resource_register(devlink, "fib-rules", (u64)-1, in nsim_dev_resources_register()
465 err = devl_resource_register(devlink, "IPv6", (u64)-1, in nsim_dev_resources_register()
474 err = devl_resource_register(devlink, "fib", (u64)-1, in nsim_dev_resources_register()
482 err = devl_resource_register(devlink, "fib-rules", (u64)-1, in nsim_dev_resources_register()
491 err = devl_resource_register(devlink, "nexthops", (u64)-1, in nsim_dev_resources_register()
502 devl_resources_unregister(devlink); in nsim_dev_resources_register()
522 struct devlink *devlink) in nsim_devlink_set_params_init_values() argument
527 devl_param_driverinit_value_set(devlink, in nsim_devlink_set_params_init_values()
531 devl_param_driverinit_value_set(devlink, in nsim_devlink_set_params_init_values()
536 static void nsim_devlink_param_load_driverinit_values(struct devlink *devlink) in nsim_devlink_param_load_driverinit_values() argument
538 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_devlink_param_load_driverinit_values()
542 err = devl_param_driverinit_value_get(devlink, in nsim_devlink_param_load_driverinit_values()
547 err = devl_param_driverinit_value_get(devlink, in nsim_devlink_param_load_driverinit_values()
563 struct devlink *devlink) in nsim_dev_dummy_region_init() argument
566 devl_region_create(devlink, &dummy_region_ops, in nsim_dev_dummy_region_init()
585 struct devlink *devlink = priv_to_devlink(nsim_dev); in nsim_esw_legacy_enable() local
588 devl_rate_nodes_destroy(devlink); in nsim_esw_legacy_enable()
620 static int nsim_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode, in nsim_devlink_eswitch_mode_set() argument
623 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_devlink_eswitch_mode_set()
636 static int nsim_devlink_eswitch_mode_get(struct devlink *devlink, u16 *mode) in nsim_devlink_eswitch_mode_get() argument
638 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_devlink_eswitch_mode_get()
785 struct devlink *devlink = priv_to_devlink(nsim_dev); in nsim_dev_trap_report() local
818 devlink_trap_report(devlink, skb, nsim_trap_item->trap_ctx, in nsim_dev_trap_report()
860 static int nsim_dev_traps_init(struct devlink *devlink) in nsim_dev_traps_init() argument
863 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_dev_traps_init()
895 err = devl_trap_policers_register(devlink, nsim_trap_policers_arr, in nsim_dev_traps_init()
900 err = devl_trap_groups_register(devlink, nsim_trap_groups_arr, in nsim_dev_traps_init()
905 err = devl_traps_register(devlink, nsim_traps_arr, in nsim_dev_traps_init()
919 devl_trap_groups_unregister(devlink, nsim_trap_groups_arr, in nsim_dev_traps_init()
922 devl_trap_policers_unregister(devlink, nsim_trap_policers_arr, in nsim_dev_traps_init()
933 static void nsim_dev_traps_exit(struct devlink *devlink) in nsim_dev_traps_exit() argument
935 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_dev_traps_exit()
939 devl_traps_unregister(devlink, nsim_traps_arr, in nsim_dev_traps_exit()
941 devl_trap_groups_unregister(devlink, nsim_trap_groups_arr, in nsim_dev_traps_exit()
943 devl_trap_policers_unregister(devlink, nsim_trap_policers_arr, in nsim_dev_traps_exit()
954 static int nsim_dev_reload_down(struct devlink *devlink, bool netns_change, in nsim_dev_reload_down() argument
958 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_dev_reload_down()
972 static int nsim_dev_reload_up(struct devlink *devlink, enum devlink_reload_action action, in nsim_dev_reload_up() argument
976 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_dev_reload_up()
991 static int nsim_dev_info_get(struct devlink *devlink, in nsim_dev_info_get() argument
1009 static int nsim_dev_flash_update(struct devlink *devlink, in nsim_dev_flash_update() argument
1013 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_dev_flash_update()
1020 devlink_flash_update_status_notify(devlink, in nsim_dev_flash_update()
1027 devlink_flash_update_status_notify(devlink, "Flashing", in nsim_dev_flash_update()
1035 devlink_flash_update_status_notify(devlink, "Flashing", in nsim_dev_flash_update()
1039 devlink_flash_update_timeout_notify(devlink, "Flash select", in nsim_dev_flash_update()
1041 devlink_flash_update_status_notify(devlink, "Flashing done", in nsim_dev_flash_update()
1062 static int nsim_dev_devlink_trap_init(struct devlink *devlink, in nsim_dev_devlink_trap_init() argument
1066 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_dev_devlink_trap_init()
1080 nsim_dev_devlink_trap_action_set(struct devlink *devlink, in nsim_dev_devlink_trap_action_set() argument
1085 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_dev_devlink_trap_action_set()
1100 nsim_dev_devlink_trap_group_set(struct devlink *devlink, in nsim_dev_devlink_trap_group_set() argument
1105 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_dev_devlink_trap_group_set()
1114 nsim_dev_devlink_trap_policer_set(struct devlink *devlink, in nsim_dev_devlink_trap_policer_set() argument
1119 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_dev_devlink_trap_policer_set()
1130 nsim_dev_devlink_trap_policer_counter_get(struct devlink *devlink, in nsim_dev_devlink_trap_policer_counter_get() argument
1134 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_dev_devlink_trap_policer_counter_get()
1246 struct nsim_dev *nsim_dev = devlink_priv(node->devlink); in nsim_rate_node_new()
1311 nsim_dev_devlink_trap_drop_counter_get(struct devlink *devlink, in nsim_dev_devlink_trap_drop_counter_get() argument
1315 struct nsim_dev *nsim_dev = devlink_priv(devlink); in nsim_dev_devlink_trap_drop_counter_get()
1464 struct devlink *devlink; in nsim_dev_reload_create() local
1467 devlink = priv_to_devlink(nsim_dev); in nsim_dev_reload_create()
1468 nsim_dev = devlink_priv(devlink); in nsim_dev_reload_create()
1473 nsim_devlink_param_load_driverinit_values(devlink); in nsim_dev_reload_create()
1475 err = nsim_dev_dummy_region_init(nsim_dev, devlink); in nsim_dev_reload_create()
1479 err = nsim_dev_traps_init(devlink); in nsim_dev_reload_create()
1483 nsim_dev->fib_data = nsim_fib_create(devlink, extack); in nsim_dev_reload_create()
1489 err = nsim_dev_health_init(nsim_dev, devlink); in nsim_dev_reload_create()
1519 nsim_fib_destroy(devlink, nsim_dev->fib_data); in nsim_dev_reload_create()
1521 nsim_dev_traps_exit(devlink); in nsim_dev_reload_create()
1530 struct devlink *devlink; in nsim_drv_probe() local
1533 devlink = devlink_alloc_ns(&nsim_dev_devlink_ops, sizeof(*nsim_dev), in nsim_drv_probe()
1535 if (!devlink) in nsim_drv_probe()
1537 devl_lock(devlink); in nsim_drv_probe()
1538 nsim_dev = devlink_priv(devlink); in nsim_drv_probe()
1559 err = devl_register(devlink); in nsim_drv_probe()
1563 err = nsim_dev_resources_register(devlink); in nsim_drv_probe()
1567 err = devl_params_register(devlink, nsim_devlink_params, in nsim_drv_probe()
1571 nsim_devlink_set_params_init_values(nsim_dev, devlink); in nsim_drv_probe()
1573 err = nsim_dev_dummy_region_init(nsim_dev, devlink); in nsim_drv_probe()
1577 err = nsim_dev_traps_init(devlink); in nsim_drv_probe()
1585 nsim_dev->fib_data = nsim_fib_create(devlink, NULL); in nsim_drv_probe()
1591 err = nsim_dev_health_init(nsim_dev, devlink); in nsim_drv_probe()
1612 devl_unlock(devlink); in nsim_drv_probe()
1624 nsim_fib_destroy(devlink, nsim_dev->fib_data); in nsim_drv_probe()
1628 nsim_dev_traps_exit(devlink); in nsim_drv_probe()
1632 devl_params_unregister(devlink, nsim_devlink_params, in nsim_drv_probe()
1635 devl_resources_unregister(devlink); in nsim_drv_probe()
1637 devl_unregister(devlink); in nsim_drv_probe()
1641 devl_unlock(devlink); in nsim_drv_probe()
1642 devlink_free(devlink); in nsim_drv_probe()
1649 struct devlink *devlink = priv_to_devlink(nsim_dev); in nsim_dev_reload_destroy() local
1651 if (devlink_is_reload_failed(devlink)) in nsim_dev_reload_destroy()
1665 nsim_fib_destroy(devlink, nsim_dev->fib_data); in nsim_dev_reload_destroy()
1666 nsim_dev_traps_exit(devlink); in nsim_dev_reload_destroy()
1673 struct devlink *devlink = priv_to_devlink(nsim_dev); in nsim_drv_remove() local
1675 devl_lock(devlink); in nsim_drv_remove()
1680 devl_params_unregister(devlink, nsim_devlink_params, in nsim_drv_remove()
1682 devl_resources_unregister(devlink); in nsim_drv_remove()
1683 devl_unregister(devlink); in nsim_drv_remove()
1686 devl_unlock(devlink); in nsim_drv_remove()
1687 devlink_free(devlink); in nsim_drv_remove()
1740 struct devlink *devlink = priv_to_devlink(nsim_dev); in nsim_drv_configure_vfs() local
1743 devl_lock(devlink); in nsim_drv_configure_vfs()
1769 devl_unlock(devlink); in nsim_drv_configure_vfs()