]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: dsa: b53: Rework ARL bin logic
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 21 Apr 2020 03:26:54 +0000 (20:26 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 14 May 2020 08:54:22 +0000 (10:54 +0200)
commitd2266eab883b1093aa3a5b40b7f2f475bd865fcc
tree1e074e3896b172d1c59ca4a55d3485c2abe14a30
parent5f8d804ac0f650aac7107f607cb5ab098f2fbeba
net: dsa: b53: Rework ARL bin logic

BugLink: https://bugs.launchpad.net/bugs/1877461
[ Upstream commit 6344dbde6a27d10d16246d734b968f84887841e2 ]

When asking the ARL to read a MAC address, we will get a number of bins
returned in a single read. Out of those bins, there can essentially be 3
states:

- all bins are full, we have no space left, and we can either replace an
  existing address or return that full condition

- the MAC address was found, then we need to return its bin index and
  modify that one, and only that one

- the MAC address was not found and we have a least one bin free, we use
  that bin index location then

The code would unfortunately fail on all counts.

Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/dsa/b53/b53_common.c
drivers/net/dsa/b53/b53_regs.h