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>
This commit is contained in:

committed by
David S. Miller

parent
7690f2a51d
commit
a2e8da9378
@@ -127,7 +127,7 @@ static int nfp_bpf_setup_tc(struct nfp_app *app, struct net_device *netdev,
|
||||
struct nfp_net *nn = netdev_priv(netdev);
|
||||
|
||||
if (type != TC_SETUP_CLSBPF || !nfp_net_ebpf_capable(nn) ||
|
||||
TC_H_MAJ(cls_bpf->common.handle) != TC_H_MAJ(TC_H_INGRESS) ||
|
||||
is_classid_clsact_ingress(cls_bpf->common.classid) ||
|
||||
cls_bpf->common.protocol != htons(ETH_P_ALL) ||
|
||||
cls_bpf->common.chain_index)
|
||||
return -EOPNOTSUPP;
|
||||
|
@@ -390,7 +390,7 @@ int nfp_flower_setup_tc(struct nfp_app *app, struct net_device *netdev,
|
||||
struct tc_cls_flower_offload *cls_flower = type_data;
|
||||
|
||||
if (type != TC_SETUP_CLSFLOWER ||
|
||||
TC_H_MAJ(cls_flower->common.handle) != TC_H_MAJ(TC_H_INGRESS) ||
|
||||
is_classid_clsact_ingress(cls_flower->common.classid) ||
|
||||
!eth_proto_is_802_3(cls_flower->common.protocol) ||
|
||||
cls_flower->common.chain_index)
|
||||
return -EOPNOTSUPP;
|
||||
|
Reference in New Issue
Block a user