Skip to content

Commit

Permalink
net: mvpp2: cls: Only select applicable flows of classification offload
Browse files Browse the repository at this point in the history
The way we currently handle classification offload and RSS is by having
dedicated lookup sequences in the flow table, each being selected
depending on several fields being present in the packet header.

We need to make sure the classification operation we want to perform can
be done in each flow we want to insert it into. As an example,
classifying on VLAN tag can only be done on flows used for tagged
traffic.

This commit makes sure we don't insert rules in flows we aren't
compatible with.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Maxime Chevallier authored and David S. Miller committed Jun 19, 2019
1 parent c641af4 commit 834df6e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,9 @@ static int mvpp2_port_flt_rfs_rule_insert(struct mvpp2_port *port,
if (!flow)
return 0;

if ((rule->hek_fields & flow->supported_hash_opts) != rule->hek_fields)
continue;

index = MVPP2_CLS_FLT_C2_RFS(port->id, flow->flow_id, rule->loc);

mvpp2_cls_flow_read(priv, index, &fe);
Expand Down

0 comments on commit 834df6e

Please sign in to comment.