net: sched: Avoid implicit chain 0 creation
authorJiri Pirko <jiri@mellanox.com>
Mon, 23 Jul 2018 07:23:05 +0000 (09:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Jul 2018 03:44:12 +0000 (20:44 -0700)
commitf71e0ca4db187af7c44987e9d21e9042c3046070
tree850a18e148bfd97fc67450e3568406ca3e1e784b
parentf34e8bff58f071e1a3452a5a6e29dac218c83f69
net: sched: Avoid implicit chain 0 creation

Currently, chain 0 is implicitly created during block creation. However
that does not align with chain object exposure, creation and destruction
api introduced later on. So make the chain 0 behave the same way as any
other chain and only create it when it is needed. Since chain 0 is
somehow special as the qdiscs need to hold pointer to the first chain
tp, this requires to move the chain head change callback infra to the
block structure.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sch_generic.h
net/sched/cls_api.c