netprio_cgroup: keep track of whether prio is set or not

netprio_cgroup keeps prio config per cgroup-netdev pair and doesn't
distinguish between unconfigured and explicit 0 priority.  To
implement hierarchy support, it's necessary to know whether a given
pair has explicit configuration or not.

This patch adds netprio_map->aux[] which is indexed by cgroup->id and
currently only contains one bool - is_local.  netprio[_set]_prio() is
updated to handle @is_local.  is_local is set iff the pair has
explicit config.  write_priomap() now clears is_local if a negative
value is written and sets on positive.  With cgrp_css_free() also
updated to clear it, is_local is set for a cgroup-netdev pair iff the
pair is online and a positive prio has been configured via
"net_prio.ifpriomap".

is_local is visible to userland via cgroup file "net_prio.is_local".

This currently doesn't change any behavior.  It will be used to
implement hierarchy support.

Signed-off-by: Tejun Heo <tj@kernel.org>
2 files changed