net: mvpp2: cls: right-justify the C2 TCAM keys
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Tue, 18 Jun 2019 14:55:18 +0000 (16:55 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jun 2019 02:26:05 +0000 (22:26 -0400)
commit12b8e2dd01ce642ce968819078f5f2798227087a
tree82c39ab85088ea6b67bb0c304191136ed7b377e6
parent834df6ea955559af06fcbe36c767d25e0e9364ee
net: mvpp2: cls: right-justify the C2 TCAM keys

The C2 TCAM used for classification uses a key (Header Extracted Key)
built by concatenating several fields extracted from the packet header.

After a lot of trial-and-error and some guess work, it seems the HEK is
right justified, with the first fields being stored in the MSB, then
concatenated up until the LSB.

Until now, this doesn't cause any issue since all HEK fields we use are
full bytes. However this is an issue for the upcoming VLAN id and pri
extraction, which aren't full bytes.

Rework the way we built that TCAM key, by changing the order in which we
append the fields.

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