OSDN Git Service

net: sched: use block index as a handle instead of qdisc when block is shared
authorJiri Pirko <jiri@mellanox.com>
Wed, 17 Jan 2018 10:46:51 +0000 (11:46 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Jan 2018 19:53:57 +0000 (14:53 -0500)
commit7960d1daf278cbe23bb48974fe6ae6a1e44c3c15
tree8372dff3b1b3c49916b48db78c56b93fd6dfe611
parentcaa7260156eb3a1496348a2c69fa68e85183d5d7
net: sched: use block index as a handle instead of qdisc when block is shared

As the tcm_ifindex with value TCM_IFINDEX_MAGIC_BLOCK is invalid ifindex,
use it to indicate that we work with block, instead of qdisc.
So if tcm_ifindex is set to TCM_IFINDEX_MAGIC_BLOCK, tcm_parent is used
to carry block_index.

If the block is set to be shared between at least 2 qdiscs, it is
forbidden to use the qdisc handle to add/delete filters. In that case,
userspace has to pass block_index.

Also, for dump of the filters, in case the block is shared in between at
least 2 qdiscs, the each filter is dumped with tcm_ifindex value
TCM_IFINDEX_MAGIC_BLOCK and tcm_parent set to block_index. That gives
the user clear indication, that the filter belongs to a shared block
and not only to one qdisc under which it is dumped.

Suggested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/rtnetlink.h
net/sched/cls_api.c