From: Petr Machata <petrm@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
<netdev@vger.kernel.org>
Cc: Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>,
"Amit Cohen" <amcohen@nvidia.com>, <mlxsw@nvidia.com>
Subject: [PATCH net-next 0/8] mlxsw: Cleanups in router code
Date: Fri, 9 Jun 2023 19:32:05 +0200 [thread overview]
Message-ID: <cover.1686330238.git.petrm@nvidia.com> (raw)
This patchset moves some router-related code from spectrum.c to
spectrum_router.c where it should be. It also simplifies handlers of
netevent notifications.
- Patch #1 caches router pointer in a dedicated variable. This obviates the
need to access the same as mlxsw_sp->router, making lines shorter, and
permitting a future patch to add code that fits within 80 character
limit.
- Patch #2 moves IP / IPv6 validation notifier blocks from spectrum.c
to spectrum_router, where the handlers are anyway.
- In patch #3, pass router pointer to scheduler of deferred work directly,
instead of having it deduce it on its own.
- This makes the router pointer available in the handler function
mlxsw_sp_router_netevent_event(), so in patch #4, use it directly,
instead of finding it through mlxsw_sp_port.
- In patch #5, extend mlxsw_sp_router_schedule_work() so that the
NETEVENT_NEIGH_UPDATE handler can use it directly instead of inlining
equivalent code.
- In patches #6 and #7, add helpers for two common operations involving
a backing netdev of a RIF. This makes it unnecessary for the function
mlxsw_sp_rif_dev() to be visible outside of the router module, so in
patch #8, hide it.
Petr Machata (8):
mlxsw: spectrum_router: mlxsw_sp_router_fini(): Extract a helper
variable
mlxsw: spectrum_router: Move here inetaddr validator notifiers
mlxsw: spectrum_router: Pass router to mlxsw_sp_router_schedule_work()
directly
mlxsw: spectrum_router: Use the available router pointer for netevent
handling
mlxsw: spectrum_router: Reuse work neighbor initialization in work
scheduler
mlxsw: Convert RIF-has-netdevice queries to a dedicated helper
mlxsw: Convert does-RIF-have-this-netdev queries to a dedicated helper
mlxsw: spectrum_router: Privatize mlxsw_sp_rif_dev()
.../net/ethernet/mellanox/mlxsw/spectrum.c | 18 +--
.../net/ethernet/mellanox/mlxsw/spectrum.h | 4 -
.../ethernet/mellanox/mlxsw/spectrum_dpipe.c | 2 +-
.../net/ethernet/mellanox/mlxsw/spectrum_mr.c | 19 ++-
.../ethernet/mellanox/mlxsw/spectrum_router.c | 123 +++++++++++-------
.../ethernet/mellanox/mlxsw/spectrum_router.h | 6 +-
6 files changed, 90 insertions(+), 82 deletions(-)
--
2.40.1
next reply other threads:[~2023-06-09 17:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 17:32 Petr Machata [this message]
2023-06-09 17:32 ` [PATCH net-next 1/8] mlxsw: spectrum_router: mlxsw_sp_router_fini(): Extract a helper variable Petr Machata
2023-06-09 19:05 ` Simon Horman
2023-06-09 17:32 ` [PATCH net-next 2/8] mlxsw: spectrum_router: Move here inetaddr validator notifiers Petr Machata
2023-06-09 19:05 ` Simon Horman
2023-06-09 17:32 ` [PATCH net-next 3/8] mlxsw: spectrum_router: Pass router to mlxsw_sp_router_schedule_work() directly Petr Machata
2023-06-09 19:05 ` Simon Horman
2023-06-09 17:32 ` [PATCH net-next 4/8] mlxsw: spectrum_router: Use the available router pointer for netevent handling Petr Machata
2023-06-09 19:06 ` Simon Horman
2023-06-09 17:32 ` [PATCH net-next 5/8] mlxsw: spectrum_router: Reuse work neighbor initialization in work scheduler Petr Machata
2023-06-09 19:06 ` Simon Horman
2023-06-09 17:32 ` [PATCH net-next 6/8] mlxsw: Convert RIF-has-netdevice queries to a dedicated helper Petr Machata
2023-06-09 19:06 ` Simon Horman
2023-06-09 17:32 ` [PATCH net-next 7/8] mlxsw: Convert does-RIF-have-this-netdev " Petr Machata
2023-06-09 19:07 ` Simon Horman
2023-06-09 17:32 ` [PATCH net-next 8/8] mlxsw: spectrum_router: Privatize mlxsw_sp_rif_dev() Petr Machata
2023-06-09 20:08 ` Simon Horman
2023-06-12 9:00 ` [PATCH net-next 0/8] mlxsw: Cleanups in router code 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=cover.1686330238.git.petrm@nvidia.com \
--to=petrm@nvidia.com \
--cc=amcohen@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).