summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/netronome/nfp/flower
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2017-08-07 10:15:27 +0200
committerDavid S. Miller <davem@davemloft.net>2017-08-07 09:42:36 -0700
commit37cba6b3f86b24d82f27713b3154657ecc95f678 (patch)
tree6e20c54d3d39b19ec6aef74140559f4c44e18064 /drivers/net/ethernet/netronome/nfp/flower
parent3fbae382f7dd81c4e43b76169e08cc0d440e760b (diff)
nfp: change flows in apps that offload ndo_setup_tc
Change the flows a bit in preparation of follow-up changes in ndo_setup_tc args. Also, change the error code to align with the rest of the drivers. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/flower')
-rw-r--r--drivers/net/ethernet/netronome/nfp/flower/offload.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c
index d045cf8c140a..58af438a95c1 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/offload.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c
@@ -388,14 +388,10 @@ int nfp_flower_setup_tc(struct nfp_app *app, struct net_device *netdev,
enum tc_setup_type type, u32 handle, __be16 proto,
struct tc_to_netdev *tc)
{
- if (TC_H_MAJ(handle) != TC_H_MAJ(TC_H_INGRESS))
+ if (type != TC_SETUP_CLSFLOWER ||
+ TC_H_MAJ(handle) != TC_H_MAJ(TC_H_INGRESS) ||
+ !eth_proto_is_802_3(proto))
return -EOPNOTSUPP;
- if (!eth_proto_is_802_3(proto))
- return -EOPNOTSUPP;
-
- if (type != TC_SETUP_CLSFLOWER)
- return -EINVAL;
-
return nfp_flower_repr_offload(app, netdev, tc->cls_flower);
}