net: ethernet: ti: cpsw_ale: Fix cpsw_ale_get_field()/cpsw_ale_set_field()
authorTanmay Patil <t-patil@ti.com>
Wed, 12 Jul 2023 11:06:57 +0000 (16:36 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Jul 2023 07:36:43 +0000 (08:36 +0100)
commitb685f1a58956fa36cc01123f253351b25bfacfda
treedfa0396cd38aa8f4b34838d9769e5547f51258aa
parent9845217d60d01d151b45842ef2017a65e8f39f5a
net: ethernet: ti: cpsw_ale: Fix cpsw_ale_get_field()/cpsw_ale_set_field()

CPSW ALE has 75 bit ALE entries which are stored within three 32 bit words.
The cpsw_ale_get_field() and cpsw_ale_set_field() functions assume that the
field will be strictly contained within one word. However, this is not
guaranteed to be the case and it is possible for ALE field entries to span
across up to two words at the most.

Fix the methods to handle getting/setting fields spanning up to two words.

Fixes: db82173f23c5 ("netdev: driver: ethernet: add cpsw address lookup engine support")
Signed-off-by: Tanmay Patil <t-patil@ti.com>
[s-vadapalli@ti.com: rephrased commit message and added Fixes tag]
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw_ale.c