Commit 861932ec authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

net: sched: Add helpers to identify classids

Offloading drivers need to understand what qdisc class a filter is added
to. Currently they only need to identify ingress, clsact->ingress and
clsact->egress. So provide these helpers.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c5ebc440
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <linux/ktime.h> #include <linux/ktime.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <net/sch_generic.h> #include <net/sch_generic.h>
#include <uapi/linux/pkt_sched.h>
#define DEFAULT_TX_QUEUE_LEN 1000 #define DEFAULT_TX_QUEUE_LEN 1000
...@@ -132,4 +133,17 @@ static inline unsigned int psched_mtu(const struct net_device *dev) ...@@ -132,4 +133,17 @@ static inline unsigned int psched_mtu(const struct net_device *dev)
return dev->mtu + dev->hard_header_len; return dev->mtu + dev->hard_header_len;
} }
static inline bool is_classid_clsact_ingress(u32 classid)
{
/* This also returns true for ingress qdisc */
return TC_H_MAJ(classid) == TC_H_MAJ(TC_H_CLSACT) &&
TC_H_MIN(classid) != TC_H_MIN(TC_H_MIN_EGRESS);
}
static inline bool is_classid_clsact_egress(u32 classid)
{
return TC_H_MAJ(classid) == TC_H_MAJ(TC_H_CLSACT) &&
TC_H_MIN(classid) == TC_H_MIN(TC_H_MIN_EGRESS);
}
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment