summaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2017-08-09 14:30:33 +0200
committerDavid S. Miller <davem@davemloft.net>2017-08-11 13:47:01 -0700
commita2e8da9378cc09e2e922a0b3d481bd9d07c3d245 (patch)
treeb6db00631229583093c1a9a48cb15b2be9e05065 /net/dsa
parent7690f2a51d8afe51ac97e7fae66b081f192a7158 (diff)
downloadop-kernel-dev-a2e8da9378cc09e2e922a0b3d481bd9d07c3d245.zip
op-kernel-dev-a2e8da9378cc09e2e922a0b3d481bd9d07c3d245.tar.gz
net: sched: use newly added classid identity helpers
Instead of checking handle, which does not have the inner class information and drivers wrongly assume clsact->egress as ingress, use the newly introduced classid identification helpers. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/slave.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 8c79011..78e78a6 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -914,7 +914,14 @@ static void dsa_slave_del_cls_matchall(struct net_device *dev,
static int dsa_slave_setup_tc_cls_matchall(struct net_device *dev,
struct tc_cls_matchall_offload *cls)
{
- bool ingress = TC_H_MAJ(cls->common.handle) == TC_H_MAJ(TC_H_INGRESS);
+ bool ingress;
+
+ if (is_classid_clsact_ingress(cls->common.classid))
+ ingress = true;
+ else if (is_classid_clsact_egress(cls->common.classid))
+ ingress = false;
+ else
+ return -EOPNOTSUPP;
if (cls->common.chain_index)
return -EOPNOTSUPP;
OpenPOWER on IntegriCloud