From: Jiri Pirko <jiri@resnulli.us>
To: Ido Schimmel <idosch@idosch.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
jiri@nvidia.com, mlxsw@nvidia.com,
Ido Schimmel <idosch@nvidia.com>
Subject: Re: [PATCH net-next 1/2] mlxsw: spectrum_router: Add trap adjacency entry upon first nexthop group
Date: Wed, 22 Sep 2021 10:43:52 +0200 [thread overview]
Message-ID: <YUrsyHrL961YqPZ8@nanopsycho> (raw)
In-Reply-To: <20210922073642.796559-2-idosch@idosch.org>
Wed, Sep 22, 2021 at 09:36:41AM CEST, idosch@idosch.org wrote:
>From: Ido Schimmel <idosch@nvidia.com>
>
>In commit 0c3cbbf96def ("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 983db6198f0d ("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, track the number of active nexthop groups and allocate the
>adjacency entry upon the creation of the first group. Free it when the
>number of active groups reaches zero.
>
>The next patch will convert mlxsw to start using the new entry and
>remove the old one.
>
>[1] https://github.com/Mellanox/mlxsw/tree/master/Debugging/libbpf-tools/resmon
>
>Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
next prev parent reply other threads:[~2021-09-22 8:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-22 7:36 [PATCH net-next 0/2] mlxsw: Alter trap adjacency entry allocation scheme Ido Schimmel
2021-09-22 7:36 ` [PATCH net-next 1/2] mlxsw: spectrum_router: Add trap adjacency entry upon first nexthop group Ido Schimmel
2021-09-22 8:43 ` Jiri Pirko [this message]
2021-09-22 7:36 ` [PATCH net-next 2/2] mlxsw: spectrum_router: Start using new trap adjacency entry Ido Schimmel
2021-09-22 8:44 ` Jiri Pirko
2021-09-22 13:40 ` [PATCH net-next 0/2] mlxsw: Alter trap adjacency entry allocation scheme patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YUrsyHrL961YqPZ8@nanopsycho \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=idosch@idosch.org \
--cc=idosch@nvidia.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox