/net/devlink/ |
D | core.c | 19 void *devlink_priv(struct devlink *devlink) in devlink_priv() argument 21 return &devlink->priv; in devlink_priv() 25 struct devlink *priv_to_devlink(void *priv) in priv_to_devlink() 27 return container_of(priv, struct devlink, priv); in priv_to_devlink() 31 struct device *devlink_to_dev(const struct devlink *devlink) in devlink_to_dev() argument 33 return devlink->dev; in devlink_to_dev() 37 struct net *devlink_net(const struct devlink *devlink) in devlink_net() argument 39 return read_pnet(&devlink->_net); in devlink_net() 43 void devl_assert_locked(struct devlink *devlink) in devl_assert_locked() argument 45 lockdep_assert_held(&devlink->lock); in devl_assert_locked() [all …]
|
D | trap.c | 73 devlink_trap_policer_item_lookup(struct devlink *devlink, u32 id) in devlink_trap_policer_item_lookup() argument 77 list_for_each_entry(policer_item, &devlink->trap_policer_list, list) { in devlink_trap_policer_item_lookup() 86 devlink_trap_item_lookup(struct devlink *devlink, const char *name) in devlink_trap_item_lookup() argument 90 list_for_each_entry(trap_item, &devlink->trap_list, list) { in devlink_trap_item_lookup() 99 devlink_trap_item_get_from_info(struct devlink *devlink, in devlink_trap_item_get_from_info() argument 108 return devlink_trap_item_lookup(devlink, nla_data(attr)); in devlink_trap_item_get_from_info() 211 static int devlink_trap_stats_put(struct sk_buff *msg, struct devlink *devlink, in devlink_trap_stats_put() argument 219 if (devlink->ops->trap_drop_counter_get) { in devlink_trap_stats_put() 220 err = devlink->ops->trap_drop_counter_get(devlink, in devlink_trap_stats_put() 233 if (devlink->ops->trap_drop_counter_get && in devlink_trap_stats_put() [all …]
|
D | dev.c | 46 devlink_reload_action_is_supported(struct devlink *devlink, enum devlink_reload_action action) in devlink_reload_action_is_supported() argument 48 return test_bit(action, &devlink->ops->reload_actions); in devlink_reload_action_is_supported() 52 devlink_reload_limit_is_supported(struct devlink *devlink, enum devlink_reload_limit limit) in devlink_reload_limit_is_supported() argument 54 return test_bit(limit, &devlink->ops->reload_limits); in devlink_reload_limit_is_supported() 78 devlink_reload_stats_put(struct sk_buff *msg, struct devlink *devlink, bool is_remote) in devlink_reload_stats_put() argument 94 !devlink_reload_action_is_supported(devlink, i)) || in devlink_reload_stats_put() 114 !devlink_reload_limit_is_supported(devlink, j)) || in devlink_reload_stats_put() 120 value = devlink->stats.reload_stats[stat_idx]; in devlink_reload_stats_put() 122 value = devlink->stats.remote_reload_stats[stat_idx]; in devlink_reload_stats_put() 141 static int devlink_nl_fill(struct sk_buff *msg, struct devlink *devlink, in devlink_nl_fill() argument [all …]
|
D | devl_internal.h | 30 struct devlink { struct 84 #define devlinks_xa_for_each_registered_get(net, index, devlink) \ argument 85 for (index = 0; (devlink = devlinks_xa_find_get(net, &index)); index++) 87 struct devlink *devlinks_xa_find_get(struct net *net, unsigned long *indexp); 89 static inline bool devl_is_registered(struct devlink *devlink) in devl_is_registered() argument 91 devl_assert_locked(devlink); in devl_is_registered() 92 return xa_get_mark(&devlinks, devlink->index, DEVLINK_REGISTERED); in devl_is_registered() 120 struct devlink *devlink, 124 struct devlink * 139 devlink_nl_put_handle(struct sk_buff *msg, struct devlink *devlink) in devlink_nl_put_handle() argument [all …]
|
D | resource.c | 39 devlink_resource_find(struct devlink *devlink, in devlink_resource_find() argument 47 resource_list = &devlink->resource_list; in devlink_resource_find() 55 child_resource = devlink_resource_find(devlink, resource, in devlink_resource_find() 110 struct devlink *devlink = info->user_ptr[0]; in devlink_nl_cmd_resource_set() local 121 resource = devlink_resource_find(devlink, NULL, resource_id); in devlink_nl_cmd_resource_set() 165 static int devlink_resource_put(struct devlink *devlink, struct sk_buff *skb, in devlink_resource_put() argument 203 if (devlink_resource_put(devlink, skb, child_resource)) in devlink_resource_put() 222 struct devlink *devlink = info->user_ptr[0]; in devlink_resource_fill() local 232 resource = list_first_entry(&devlink->resource_list, in devlink_resource_fill() 246 if (devlink_nl_put_handle(skb, devlink)) in devlink_resource_fill() [all …]
|
D | sb.c | 24 static struct devlink_sb *devlink_sb_get_by_index(struct devlink *devlink, in devlink_sb_get_by_index() argument 29 list_for_each_entry(devlink_sb, &devlink->sb_list, list) { in devlink_sb_get_by_index() 36 static bool devlink_sb_index_exists(struct devlink *devlink, in devlink_sb_index_exists() argument 39 return devlink_sb_get_by_index(devlink, sb_index); in devlink_sb_index_exists() 42 static struct devlink_sb *devlink_sb_get_from_attrs(struct devlink *devlink, in devlink_sb_get_from_attrs() argument 49 devlink_sb = devlink_sb_get_by_index(devlink, sb_index); in devlink_sb_get_from_attrs() 57 static struct devlink_sb *devlink_sb_get_from_info(struct devlink *devlink, in devlink_sb_get_from_info() argument 60 return devlink_sb_get_from_attrs(devlink, info->attrs); in devlink_sb_get_from_info() 167 static int devlink_nl_sb_fill(struct sk_buff *msg, struct devlink *devlink, in devlink_nl_sb_fill() argument 178 if (devlink_nl_put_handle(msg, devlink)) in devlink_nl_sb_fill() [all …]
|
D | region.c | 10 struct devlink *devlink; member 35 devlink_region_get_by_name(struct devlink *devlink, const char *region_name) in devlink_region_get_by_name() argument 39 list_for_each_entry(region, &devlink->region_list, list) in devlink_region_get_by_name() 72 struct devlink *devlink, in devlink_nl_region_snapshot_id_put() argument 95 struct devlink *devlink, in devlink_nl_region_snapshots_id_put() argument 108 err = devlink_nl_region_snapshot_id_put(msg, devlink, snapshot); in devlink_nl_region_snapshots_id_put() 121 static int devlink_nl_region_fill(struct sk_buff *msg, struct devlink *devlink, in devlink_nl_region_fill() argument 133 err = devlink_nl_put_handle(msg, devlink); in devlink_nl_region_fill() 159 err = devlink_nl_region_snapshots_id_put(msg, devlink, region); in devlink_nl_region_fill() 176 struct devlink *devlink = region->devlink; in devlink_nl_region_notify_build() local [all …]
|
D | param.c | 150 static int devlink_param_get(struct devlink *devlink, in devlink_param_get() argument 156 return param->get(devlink, param->id, ctx); in devlink_param_get() 159 static int devlink_param_set(struct devlink *devlink, in devlink_param_set() argument 165 return param->set(devlink, param->id, ctx); in devlink_param_set() 237 static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink, in devlink_nl_param_fill() argument 267 err = devlink_param_get(devlink, param, &ctx); in devlink_nl_param_fill() 279 if (devlink_nl_put_handle(msg, devlink)) in devlink_nl_param_fill() 330 static void devlink_param_notify(struct devlink *devlink, in devlink_param_notify() argument 346 if (!devl_is_registered(devlink)) in devlink_param_notify() 352 err = devlink_nl_param_fill(msg, devlink, port_index, param_item, cmd, in devlink_param_notify() [all …]
|
D | rate.c | 22 devlink_rate_leaf_get_from_info(struct devlink *devlink, struct genl_info *info) in devlink_rate_leaf_get_from_info() argument 27 devlink_port = devlink_port_get_from_attrs(devlink, info->attrs); in devlink_rate_leaf_get_from_info() 35 devlink_rate_node_get_by_name(struct devlink *devlink, const char *node_name) in devlink_rate_node_get_by_name() argument 39 list_for_each_entry(devlink_rate, &devlink->rate_list, list) { in devlink_rate_node_get_by_name() 48 devlink_rate_node_get_from_attrs(struct devlink *devlink, struct nlattr **attrs) in devlink_rate_node_get_from_attrs() argument 61 return devlink_rate_node_get_by_name(devlink, rate_node_name); in devlink_rate_node_get_from_attrs() 65 devlink_rate_node_get_from_info(struct devlink *devlink, struct genl_info *info) in devlink_rate_node_get_from_info() argument 67 return devlink_rate_node_get_from_attrs(devlink, info->attrs); in devlink_rate_node_get_from_info() 71 devlink_rate_get_from_info(struct devlink *devlink, struct genl_info *info) in devlink_rate_get_from_info() argument 76 return devlink_rate_leaf_get_from_info(devlink, info); in devlink_rate_get_from_info() [all …]
|
D | health.c | 58 struct devlink *devlink; member 92 devlink_health_reporter_find_by_name(struct devlink *devlink, in devlink_health_reporter_find_by_name() argument 95 return __devlink_health_reporter_find_by_name(&devlink->reporter_list, in devlink_health_reporter_find_by_name() 108 __devlink_health_reporter_create(struct devlink *devlink, in __devlink_health_reporter_create() argument 123 reporter->devlink = devlink; in __devlink_health_reporter_create() 146 devl_assert_locked(port->devlink); in devl_port_health_reporter_create() 152 reporter = __devlink_health_reporter_create(port->devlink, ops, in devl_port_health_reporter_create() 169 struct devlink *devlink = port->devlink; in devlink_port_health_reporter_create() local 171 devl_lock(devlink); in devlink_port_health_reporter_create() 174 devl_unlock(devlink); in devlink_port_health_reporter_create() [all …]
|
D | linecard.c | 10 devlink_linecard_get_by_index(struct devlink *devlink, in devlink_linecard_get_by_index() argument 15 list_for_each_entry(devlink_linecard, &devlink->linecard_list, list) { in devlink_linecard_get_by_index() 22 static bool devlink_linecard_index_exists(struct devlink *devlink, in devlink_linecard_index_exists() argument 25 return devlink_linecard_get_by_index(devlink, linecard_index); in devlink_linecard_index_exists() 29 devlink_linecard_get_from_attrs(struct devlink *devlink, struct nlattr **attrs) in devlink_linecard_get_from_attrs() argument 35 linecard = devlink_linecard_get_by_index(devlink, linecard_index); in devlink_linecard_get_from_attrs() 44 devlink_linecard_get_from_info(struct devlink *devlink, struct genl_info *info) in devlink_linecard_get_from_info() argument 46 return devlink_linecard_get_from_attrs(devlink, info->attrs); in devlink_linecard_get_from_info() 49 static int devlink_nl_put_nested_handle(struct sk_buff *msg, struct devlink *devlink) in devlink_nl_put_nested_handle() argument 56 if (devlink_nl_put_handle(msg, devlink)) in devlink_nl_put_nested_handle() [all …]
|
D | dpipe.c | 217 struct devlink *devlink = info->user_ptr[0]; in devlink_dpipe_tables_fill() local 241 if (devlink_nl_put_handle(skb, devlink)) in devlink_dpipe_tables_fill() 294 struct devlink *devlink = info->user_ptr[0]; in devlink_nl_cmd_dpipe_table_get() local 301 &devlink->dpipe_table_list, in devlink_nl_cmd_dpipe_table_get() 453 const char *table_name, struct devlink *devlink) in devlink_dpipe_table_find() argument 458 lockdep_is_held(&devlink->lock)) { in devlink_dpipe_table_find() 467 struct devlink *devlink; in devlink_dpipe_entry_ctx_prepare() local 483 devlink = dump_ctx->info->user_ptr[0]; in devlink_dpipe_entry_ctx_prepare() 484 if (devlink_nl_put_handle(dump_ctx->skb, devlink)) in devlink_dpipe_entry_ctx_prepare() 568 struct devlink *devlink = info->user_ptr[0]; in devlink_nl_cmd_dpipe_entries_get() local [all …]
|
D | netlink.c | 100 struct devlink * 103 struct devlink *devlink; in devlink_get_from_attrs_lock() local 114 devlinks_xa_for_each_registered_get(net, index, devlink) { in devlink_get_from_attrs_lock() 115 devl_lock(devlink); in devlink_get_from_attrs_lock() 116 if (devl_is_registered(devlink) && in devlink_get_from_attrs_lock() 117 strcmp(devlink->dev->bus->name, busname) == 0 && in devlink_get_from_attrs_lock() 118 strcmp(dev_name(devlink->dev), devname) == 0) in devlink_get_from_attrs_lock() 119 return devlink; in devlink_get_from_attrs_lock() 120 devl_unlock(devlink); in devlink_get_from_attrs_lock() 121 devlink_put(devlink); in devlink_get_from_attrs_lock() [all …]
|
D | port.c | 26 struct devlink_port *devlink_port_get_by_index(struct devlink *devlink, in devlink_port_get_by_index() argument 29 return xa_load(&devlink->ports, port_index); in devlink_port_get_by_index() 32 struct devlink_port *devlink_port_get_from_attrs(struct devlink *devlink, in devlink_port_get_from_attrs() argument 39 devlink_port = devlink_port_get_by_index(devlink, port_index); in devlink_port_get_from_attrs() 47 struct devlink_port *devlink_port_get_from_info(struct devlink *devlink, in devlink_port_get_from_info() argument 50 return devlink_port_get_from_attrs(devlink, info->attrs); in devlink_port_get_from_info() 187 if (devlink_nl_put_handle(msg, devlink_port->devlink)) in devlink_nl_port_handle_fill() 196 struct devlink *devlink = devlink_port->devlink; in devlink_nl_port_handle_size() local 198 return nla_total_size(strlen(devlink->dev->bus->name) + 1) /* DEVLINK_ATTR_BUS_NAME */ in devlink_nl_port_handle_size() 199 + nla_total_size(strlen(dev_name(devlink->dev)) + 1) /* DEVLINK_ATTR_DEV_NAME */ in devlink_nl_port_handle_size() [all …]
|
/net/dsa/ |
D | devlink.c | 11 static int dsa_devlink_info_get(struct devlink *dl, in dsa_devlink_info_get() 23 static int dsa_devlink_sb_pool_get(struct devlink *dl, in dsa_devlink_sb_pool_get() 36 static int dsa_devlink_sb_pool_set(struct devlink *dl, unsigned int sb_index, in dsa_devlink_sb_pool_set() 115 static int dsa_devlink_sb_occ_snapshot(struct devlink *dl, in dsa_devlink_sb_occ_snapshot() 126 static int dsa_devlink_sb_occ_max_clear(struct devlink *dl, in dsa_devlink_sb_occ_max_clear() 184 int dsa_devlink_param_get(struct devlink *dl, u32 id, in dsa_devlink_param_get() 196 int dsa_devlink_param_set(struct devlink *dl, u32 id, in dsa_devlink_param_set() 212 return devlink_params_register(ds->devlink, params, params_count); in dsa_devlink_params_register() 220 devlink_params_unregister(ds->devlink, params, params_count); in dsa_devlink_params_unregister() 231 return devlink_resource_register(ds->devlink, resource_name, in dsa_devlink_resource_register() [all …]
|
D | Makefile | 11 devlink.o \
|
/net/core/ |
D | drop_monitor.c | 117 void (*hw_trap_probe)(void *ignore, const struct devlink *devlink, 437 net_dm_hw_trap_summary_probe(void *ignore, const struct devlink *devlink, in net_dm_hw_trap_summary_probe() argument 961 net_dm_hw_trap_packet_probe(void *ignore, const struct devlink *devlink, in net_dm_hw_trap_packet_probe() argument
|
/net/ethtool/ |
D | ioctl.c | 39 struct devlink *devlink; member 46 static struct devlink *netdev_to_devlink_get(struct net_device *dev) in netdev_to_devlink_get() 50 return devlink_try_get(dev->devlink_port->devlink); in netdev_to_devlink_get() 762 rsp->devlink = netdev_to_devlink_get(dev); in ethtool_get_drvinfo() 2252 req->devlink = netdev_to_devlink_get(dev); in ethtool_flash_device() 3098 if (state->devlink) in dev_ethtool() 3099 rc = devlink_compat_flash_update(state->devlink, in dev_ethtool() 3103 if (state->devlink) in dev_ethtool() 3104 devlink_compat_running_version(state->devlink, in dev_ethtool() 3115 if (state->devlink) in dev_ethtool() [all …]
|
/net/ |
D | Makefile | 26 obj-$(CONFIG_NET_DEVLINK) += devlink/
|