From: Jiri Pirko <j...@mellanox.com> There is going to be need to be able to obtain net structure for a qdisc. So introduce helper to do it.
Signed-off-by: Jiri Pirko <j...@mellanox.com> --- include/net/pkt_sched.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 2579c20..da85ad0 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> #define DEFAULT_TX_QUEUE_LEN 1000 @@ -132,4 +134,9 @@ static inline unsigned int psched_mtu(const struct net_device *dev) return dev->mtu + dev->hard_header_len; } +static inline struct net *qdisc_net(struct Qdisc *q) +{ + return dev_net(q->dev_queue->dev); +} + #endif -- 2.9.3