diff options
author | Jiri Pirko <jiri@mellanox.com> | 2018-07-23 09:23:05 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-23 20:44:12 -0700 |
commit | f71e0ca4db187af7c44987e9d21e9042c3046070 (patch) | |
tree | 850a18e148bfd97fc67450e3568406ca3e1e784b /include/net/sch_generic.h | |
parent | net: sched: push ops lookup bits into tcf_proto_lookup_ops() (diff) | |
download | wireguard-linux-f71e0ca4db187af7c44987e9d21e9042c3046070.tar.xz wireguard-linux-f71e0ca4db187af7c44987e9d21e9042c3046070.zip |
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>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r-- | include/net/sch_generic.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 7432100027b7..86f4651784e8 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -300,7 +300,6 @@ typedef void tcf_chain_head_change_t(struct tcf_proto *tp_head, void *priv); struct tcf_chain { struct tcf_proto __rcu *filter_chain; - struct list_head filter_chain_list; struct list_head list; struct tcf_block *block; u32 index; /* chain index */ @@ -318,6 +317,10 @@ struct tcf_block { bool keep_dst; unsigned int offloadcnt; /* Number of oddloaded filters */ unsigned int nooffloaddevcnt; /* Number of devs unable to do offload */ + struct { + struct tcf_chain *chain; + struct list_head filter_chain_list; + } chain0; }; static inline void tcf_block_offload_inc(struct tcf_block *block, u32 *flags) |