diff options
author | Jiri Pirko <jiri@mellanox.com> | 2017-10-13 14:00:58 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-16 21:00:40 +0100 |
commit | 855319becbcffec6988a4e781a861b69a71c5b58 (patch) | |
tree | e107ff9b687f26c094e8457d05e62492ff38a6e8 /include/net/pkt_sched.h | |
parent | 69d78ef25c7b0058674145500efb12255738ba8a (diff) | |
download | linux-855319becbcffec6988a4e781a861b69a71c5b58.tar.bz2 |
net: sched: store net pointer in block and introduce qdisc_net helper
Store net pointer in the block structure. Along the way, introduce
qdisc_net helper which allows to easily obtain net pointer for
qdisc instance.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/pkt_sched.h')
-rw-r--r-- | include/net/pkt_sched.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 259bc191ba59..2d234af15f3e 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h @@ -4,7 +4,9 @@ #include <linux/jiffies.h> #include <linux/ktime.h> #include <linux/if_vlan.h> +#include <linux/netdevice.h> #include <net/sch_generic.h> +#include <net/net_namespace.h> #include <uapi/linux/pkt_sched.h> #define DEFAULT_TX_QUEUE_LEN 1000 @@ -146,4 +148,9 @@ static inline bool is_classid_clsact_egress(u32 classid) TC_H_MIN(classid) == TC_H_MIN(TC_H_MIN_EGRESS); } +static inline struct net *qdisc_net(struct Qdisc *q) +{ + return dev_net(q->dev_queue->dev); +} + #endif |