Lines Matching refs:shaper

139 		    const struct net_shaper *shaper,
149 net_shaper_fill_handle(msg, &shaper->parent,
151 net_shaper_fill_handle(msg, &shaper->handle,
153 ((shaper->bw_min || shaper->bw_max || shaper->burst) &&
154 nla_put_u32(msg, NET_SHAPER_A_METRIC, shaper->metric)) ||
155 (shaper->bw_min &&
156 nla_put_uint(msg, NET_SHAPER_A_BW_MIN, shaper->bw_min)) ||
157 (shaper->bw_max &&
158 nla_put_uint(msg, NET_SHAPER_A_BW_MAX, shaper->bw_max)) ||
159 (shaper->burst &&
160 nla_put_uint(msg, NET_SHAPER_A_BURST, shaper->burst)) ||
161 (shaper->priority &&
162 nla_put_u32(msg, NET_SHAPER_A_PRIORITY, shaper->priority)) ||
163 (shaper->weight &&
164 nla_put_u32(msg, NET_SHAPER_A_WEIGHT, shaper->weight)))
264 /* Allocate on demand the per device shaper's hierarchy container.
265 * Called under the net shaper lock
291 /* Prepare the hierarchy container to actually insert the given shaper, doing
324 NL_SET_ERR_MSG(extack, "Can't allocate new id for NODE shaper");
338 /* Mark 'tentative' shaper inside the hierarchy container.
346 NL_SET_ERR_MSG(extack, "Can't insert shaper into device store");
429 * NODE shaper creation (ID_UNSPEC) and reuse of existing
430 * shaper (any other value).
445 struct net_shaper *shaper)
451 ops->capabilities(binding, shaper->handle.scope, &caps);
477 if (shaper->handle.scope == NET_SHAPER_SCOPE_QUEUE &&
479 shaper->handle.id >= binding->netdev->real_num_tx_queues) {
482 shaper->handle.id,
491 if (shaper->burst || shaper->bw_min || shaper->bw_max) {
493 shaper->metric;
503 shaper->metric);
513 struct net_shaper *shaper,
519 /* The shaper handle is the only mandatory attribute. */
524 &shaper->handle);
528 if (shaper->handle.scope == NET_SHAPER_SCOPE_UNSPEC) {
534 * incrementally update the existing shaper configuration.
536 old = net_shaper_lookup(binding, &shaper->handle);
538 *shaper = *old;
542 shaper->metric = nla_get_u32(tb[NET_SHAPER_A_METRIC]);
545 shaper->bw_min = nla_get_uint(tb[NET_SHAPER_A_BW_MIN]);
548 shaper->bw_max = nla_get_uint(tb[NET_SHAPER_A_BW_MAX]);
551 shaper->burst = nla_get_uint(tb[NET_SHAPER_A_BURST]);
554 shaper->priority = nla_get_u32(tb[NET_SHAPER_A_PRIORITY]);
557 shaper->weight = nla_get_u32(tb[NET_SHAPER_A_WEIGHT]);
559 ret = net_shaper_validate_caps(binding, tb, info, shaper);
567 const struct net_shaper *shaper,
573 ops->capabilities(binding, shaper->handle.scope, &caps);
577 shaper->handle.scope);
590 struct net_shaper *shaper)
601 ret = net_shaper_parse_info(binding, tb, info, shaper, &exists);
605 if (shaper->handle.scope != NET_SHAPER_SCOPE_QUEUE) {
611 ret = net_shaper_validate_nesting(binding, shaper,
618 net_shaper_default_parent(&shaper->handle, &shaper->parent);
623 * the shaper's parent handle.
628 struct net_shaper *shaper)
633 ret = net_shaper_parse_info(binding, tb, info, shaper, &exists);
637 if (shaper->handle.scope != NET_SHAPER_SCOPE_NODE &&
638 shaper->handle.scope != NET_SHAPER_SCOPE_NETDEV) {
645 &shaper->parent);
649 if (shaper->parent.scope != NET_SHAPER_SCOPE_NODE &&
650 shaper->parent.scope != NET_SHAPER_SCOPE_NETDEV) {
730 struct net_shaper *shaper;
748 shaper = net_shaper_lookup(binding, &handle);
749 if (!shaper) {
757 ret = net_shaper_fill_one(msg, binding, shaper, info);
780 struct net_shaper *shaper;
790 for (; (shaper = xa_find(&hierarchy->shapers, &ctx->start_index,
792 ret = net_shaper_fill_one(skb, binding, shaper, info);
807 struct net_shaper shaper = {};
814 ret = net_shaper_parse_info(binding, info->attrs, info, &shaper,
820 net_shaper_default_parent(&shaper.handle, &shaper.parent);
829 handle = shaper.handle;
841 ret = ops->set(binding, &shaper, info->extack);
847 net_shaper_commit(binding, 1, &shaper);
855 struct net_shaper *shaper,
859 struct net_shaper_handle parent_handle, handle = shaper->handle;
864 parent_handle = shaper->parent;
871 kfree_rcu(shaper, rcu);
875 shaper = net_shaper_lookup(binding, &parent_handle);
876 if (shaper && !--shaper->leaves) {
931 NL_SET_ERR_MSG_FMT(extack, "Node shaper %d:%d does not exists",
954 NL_SET_ERR_MSG_FMT(extack, "Node parent shaper %d:%d does not exists",
965 /* For newly created node scope shaper, the following will
1010 const struct net_shaper *shaper,
1019 if (!shaper->leaves)
1023 node.handle = shaper->parent;
1028 /* A scope NODE shaper can be nested only to the NETDEV scope
1029 * shaper without creating the latter, this check may fail only
1036 leaves = kcalloc(shaper->leaves, sizeof(struct net_shaper),
1043 if (net_shaper_handle_cmp(&cur->parent, &shaper->handle))
1046 if (WARN_ON_ONCE(leaves_count == shaper->leaves)) {
1054 /* When re-linking to the netdev shaper, avoid the eventual, implicit,
1072 struct net_shaper *shaper;
1092 shaper = net_shaper_lookup(binding, &handle);
1093 if (!shaper) {
1099 ret = net_shaper_pre_del_node(binding, shaper, info->extack);
1104 ret = __net_shaper_delete(binding, shaper, info->extack);
1406 struct net_shaper *shaper;
1411 shaper = net_shaper_lookup(&binding, &handle);
1412 if (!shaper)
1415 /* Don't touch the H/W for the queue shaper, the drivers already
1418 parent_handle = shaper->parent;
1421 kfree_rcu(shaper, rcu);
1427 shaper = net_shaper_lookup(&binding, &parent_handle);
1428 if (shaper && !--shaper->leaves)
1429 __net_shaper_delete(&binding, shaper, NULL);