diff options
author | Maxime Chevallier <maxime.chevallier@bootlin.com> | 2019-05-24 13:05:50 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-26 02:38:15 +0300 |
commit | ae8e1d5e5651f66e1d6a33c51df0425cea61d2f5 (patch) | |
tree | d88e0ab58aa5e74078cc713385379be12c8fa3d4 /drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | |
parent | 6dca9360a9d7a15cef215cea4a55575dbfd2ebdd (diff) | |
download | linux-ae8e1d5e5651f66e1d6a33c51df0425cea61d2f5.tar.xz |
net: mvpp2: cls: Use the correct number of rules in various places
As of today, the classification offload implementation only supports 4
different rules to be offloaded. This number has been hardcoded in the
rule insertion function, and the wrong define is being used elsewhere.
Use the correct #define everywhere to make sure we always check for the
correct number of rules.
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c')
-rw-r--r-- | drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c index d046f7a1dcf5..9ce73297276e 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c @@ -1212,7 +1212,7 @@ int mvpp2_ethtool_cls_rule_get(struct mvpp2_port *port, { struct mvpp2_ethtool_fs *efs; - if (rxnfc->fs.location >= MVPP2_N_RFS_RULES) + if (rxnfc->fs.location >= MVPP2_N_RFS_ENTRIES_PER_FLOW) return -EINVAL; efs = port->rfs_rules[rxnfc->fs.location]; @@ -1232,7 +1232,7 @@ int mvpp2_ethtool_cls_rule_ins(struct mvpp2_port *port, struct mvpp2_ethtool_fs *efs, *old_efs; int ret = 0; - if (info->fs.location >= 4 || + if (info->fs.location >= MVPP2_N_RFS_ENTRIES_PER_FLOW || info->fs.location < 0) return -EINVAL; |