]> git.baikalelectronics.ru Git - kernel.git/commit
net: marvell: prestera: add hardware router objects accounting
authorYevhen Orlov <yevhen.orlov@plvision.eu>
Mon, 27 Dec 2021 21:52:29 +0000 (23:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Dec 2021 13:12:09 +0000 (13:12 +0000)
commit306c60610cc8263dc3b2a9a6cbc67c2a0264591c
treea1cc0c3701c6e6e65869413a49df10c82494d0f4
parenta7362ba7123a55431da1c3401991dd4d8a917662
net: marvell: prestera: add hardware router objects accounting

Add prestera_router_hw.c. This file contains functions, which track HW
objects relations and links. This include implicity creation of objects,
that needed by requested one and implicity removing of objects, which
reference counter is became zero.

We need this layer, because kernel callbacks not always mapped to
creation of single HW object. So let it be two different layers - one
for subscribing and parsing kernel structures, and another
(prestera_router_hw.c) for HW objects relations tracking.

There is two types of objects on router_hw layer:
 - Explicit objects (rif_entry) : created by higher layer.
 - Implicit objects (vr) : created on demand by explicit objects.

Co-developed-by: Taras Chornyi <tchornyi@marvell.com>
Signed-off-by: Taras Chornyi <tchornyi@marvell.com>
Co-developed-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Signed-off-by: Yevhen Orlov <yevhen.orlov@plvision.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/prestera/Makefile
drivers/net/ethernet/marvell/prestera/prestera_router.c
drivers/net/ethernet/marvell/prestera/prestera_router_hw.c [new file with mode: 0644]
drivers/net/ethernet/marvell/prestera/prestera_router_hw.h [new file with mode: 0644]