Lines Matching refs:ops
261 const struct devlink_ops *ops = devlink->ops; in devlink_nl_rate_parent_node_set() local
270 err = ops->rate_leaf_parent_set(devlink_rate, NULL, in devlink_nl_rate_parent_node_set()
274 err = ops->rate_node_parent_set(devlink_rate, NULL, in devlink_nl_rate_parent_node_set()
299 err = ops->rate_leaf_parent_set(devlink_rate, parent, in devlink_nl_rate_parent_node_set()
303 err = ops->rate_node_parent_set(devlink_rate, parent, in devlink_nl_rate_parent_node_set()
321 const struct devlink_ops *ops, in devlink_nl_rate_set() argument
333 err = ops->rate_leaf_tx_share_set(devlink_rate, devlink_rate->priv, in devlink_nl_rate_set()
336 err = ops->rate_node_tx_share_set(devlink_rate, devlink_rate->priv, in devlink_nl_rate_set()
346 err = ops->rate_leaf_tx_max_set(devlink_rate, devlink_rate->priv, in devlink_nl_rate_set()
349 err = ops->rate_node_tx_max_set(devlink_rate, devlink_rate->priv, in devlink_nl_rate_set()
359 err = ops->rate_leaf_tx_priority_set(devlink_rate, devlink_rate->priv, in devlink_nl_rate_set()
362 err = ops->rate_node_tx_priority_set(devlink_rate, devlink_rate->priv, in devlink_nl_rate_set()
373 err = ops->rate_leaf_tx_weight_set(devlink_rate, devlink_rate->priv, in devlink_nl_rate_set()
376 err = ops->rate_node_tx_weight_set(devlink_rate, devlink_rate->priv, in devlink_nl_rate_set()
395 static bool devlink_rate_set_ops_supported(const struct devlink_ops *ops, in devlink_rate_set_ops_supported() argument
402 if (attrs[DEVLINK_ATTR_RATE_TX_SHARE] && !ops->rate_leaf_tx_share_set) { in devlink_rate_set_ops_supported()
406 if (attrs[DEVLINK_ATTR_RATE_TX_MAX] && !ops->rate_leaf_tx_max_set) { in devlink_rate_set_ops_supported()
411 !ops->rate_leaf_parent_set) { in devlink_rate_set_ops_supported()
415 if (attrs[DEVLINK_ATTR_RATE_TX_PRIORITY] && !ops->rate_leaf_tx_priority_set) { in devlink_rate_set_ops_supported()
421 if (attrs[DEVLINK_ATTR_RATE_TX_WEIGHT] && !ops->rate_leaf_tx_weight_set) { in devlink_rate_set_ops_supported()
428 if (attrs[DEVLINK_ATTR_RATE_TX_SHARE] && !ops->rate_node_tx_share_set) { in devlink_rate_set_ops_supported()
432 if (attrs[DEVLINK_ATTR_RATE_TX_MAX] && !ops->rate_node_tx_max_set) { in devlink_rate_set_ops_supported()
437 !ops->rate_node_parent_set) { in devlink_rate_set_ops_supported()
441 if (attrs[DEVLINK_ATTR_RATE_TX_PRIORITY] && !ops->rate_node_tx_priority_set) { in devlink_rate_set_ops_supported()
447 if (attrs[DEVLINK_ATTR_RATE_TX_WEIGHT] && !ops->rate_node_tx_weight_set) { in devlink_rate_set_ops_supported()
465 const struct devlink_ops *ops; in devlink_nl_cmd_rate_set_doit() local
472 ops = devlink->ops; in devlink_nl_cmd_rate_set_doit()
473 if (!ops || !devlink_rate_set_ops_supported(ops, info, devlink_rate->type)) in devlink_nl_cmd_rate_set_doit()
476 err = devlink_nl_rate_set(devlink_rate, ops, info); in devlink_nl_cmd_rate_set_doit()
487 const struct devlink_ops *ops; in devlink_nl_cmd_rate_new_doit() local
490 ops = devlink->ops; in devlink_nl_cmd_rate_new_doit()
491 if (!ops || !ops->rate_node_new || !ops->rate_node_del) { in devlink_nl_cmd_rate_new_doit()
496 if (!devlink_rate_set_ops_supported(ops, info, DEVLINK_RATE_TYPE_NODE)) in devlink_nl_cmd_rate_new_doit()
517 err = ops->rate_node_new(rate_node, &rate_node->priv, info->extack); in devlink_nl_cmd_rate_new_doit()
521 err = devlink_nl_rate_set(rate_node, ops, info); in devlink_nl_cmd_rate_new_doit()
531 ops->rate_node_del(rate_node, rate_node->priv, info->extack); in devlink_nl_cmd_rate_new_doit()
555 err = devlink->ops->rate_node_del(rate_node, rate_node->priv, in devlink_nl_cmd_rate_del_doit()
697 const struct devlink_ops *ops = devlink->ops; in devl_rate_nodes_destroy() local
707 ops->rate_leaf_parent_set(devlink_rate, NULL, devlink_rate->priv, in devl_rate_nodes_destroy()
710 ops->rate_node_parent_set(devlink_rate, NULL, devlink_rate->priv, in devl_rate_nodes_destroy()
715 ops->rate_node_del(devlink_rate, devlink_rate->priv, NULL); in devl_rate_nodes_destroy()