]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'mlxsw-trap-adjacency'
authorDavid S. Miller <davem@davemloft.net>
Wed, 22 Sep 2021 13:35:02 +0000 (14:35 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Sep 2021 13:35:02 +0000 (14:35 +0100)
commit2ac525f51cec1ab1e12c03e5b798754c86e493b9
tree210a0d939a1388788fc0945e2f143b606d7a7f41
parentf718c0b7ba7c28bf8aaf3bc7ba7366f35e558f3c
parent17d038739b0b07bf4af7e671209332f5e84c3531
Merge branch 'mlxsw-trap-adjacency'

Ido Schimmel says:

====================
mlxsw: Alter trap adjacency entry allocation scheme

In commit 59ee36561ecc ("mlxsw: Add specific trap for packets routed via
invalid nexthops"), mlxsw started allocating a new adjacency entry
during driver initialization, to trap packets routed via invalid
nexthops.

This behavior was later altered in commit 47384bae9e47 ("mlxsw:
spectrum_router: Allocate discard adjacency entry when needed") to only
allocate the entry upon the first route that requires it. The motivation
for the change is explained in the commit message.

The problem with the current behavior is that the entry shows up as a
"leak" in a new BPF resource monitoring tool [1]. This is caused by the
asymmetry of the allocation/free scheme. While the entry is allocated
upon the first route that requires it, it is only freed during
de-initialization of the driver.

Instead, this patchset tracks the number of active nexthop groups and
allocates the adjacency entry upon the creation of the first group. The
entry is freed when the number of active groups reaches zero.

Patch #1 adds the new entry.

Patch #2 converts mlxsw to start using the new entry and removes the old
one.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>