net: mvpp2: cls: Use iterators to go through the cls_table
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Wed, 27 Mar 2019 08:44:14 +0000 (09:44 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Mar 2019 18:10:58 +0000 (11:10 -0700)
commite4bfb4aced83dbff6b84b7153483c038eed99939
tree345f08cfd0917dd584d3123838c098fc92a61b4b
parentb607cc61be41a86019bb669930f6334c8c73994c
net: mvpp2: cls: Use iterators to go through the cls_table

The cls_table is a global read-only table containing the different
parameters that are used by various tables in the classifier. It
describes the links between the Header Parser, the decoding table and
the flow_table.

There are several possible way we want to iterate over that table,
depending on wich classifier engine we want to configure. For the Header
Parser, we want to iterate over each entry. For the Decoding table, we
want to iterate over each entry having a unique flow_id. Finally, when
configuring an ethtool flow, we want to iterate over each entry having a
unique flow_id and that has a given flow_type.

This commit introduces some iterator to both provide syntactic sugar and
also clarify the way we want to iterate over the table.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h