]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: calculate vcap offsets correctly for full and quarter entries
authorXiaoliang Yang <xiaoliang.yang_1@nxp.com>
Tue, 29 Sep 2020 22:27:29 +0000 (01:27 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Sep 2020 01:26:24 +0000 (18:26 -0700)
commite6092c9cee6d60ffaf299620e80de7ccd71d83c0
tree250a927cac4e37c6aa7a3b00beb1a569586dfd74
parent323deb5fe1310cdc2cc8b1d1bce73c0c0ce7f10d
net: mscc: ocelot: calculate vcap offsets correctly for full and quarter entries

When calculating the offsets for the current entry within the row and
placing them inside struct vcap_data, the function assumes half key
entry (2 keys per row).

This patch modifies the vcap_data_offset_get() function to calculate a
correct data offset when the setting VCAP Type-Group of a key to
VCAP_TG_FULL or VCAP_TG_QUARTER.

This is needed because, for example, VCAP ES0 only supports full keys.

Also rename the 'count' variable to 'num_entries_per_row' to make the
function just one tiny bit easier to follow.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/ocelot_vcap.c