Skip to content

mlxsw: Cleanups in router code

Petr Machata netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 8 repliesApplied 8/8

Patches in v1 All 8 applied

#Subject and filesSizeRepliesApplied
1/8mlxsw: spectrum_router: mlxsw_sp_router_fini(): Extract a helper variabledrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+13 -121 replyApplied
2/8mlxsw: spectrum_router: Move here inetaddr validator notifiersdrivers/net/ethernet/mellanox/mlxsw/spectrum.c drivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +1 more+25 -251 replyApplied
3/8mlxsw: spectrum_router: Pass router to mlxsw_sp_router_schedule_work() directlydrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+6 -51 replyApplied
4/8mlxsw: spectrum_router: Use the available router pointer for netevent handlingdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+12 -71 replyApplied
5/8mlxsw: spectrum_router: Reuse work neighbor initialization in work schedulerdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+10 -191 replyApplied
6/8mlxsw: Convert RIF-has-netdevice queries to a dedicated helperdrivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +1 more+10 -41 replyApplied
7/8mlxsw: Convert does-RIF-have-this-netdev queries to a dedicated helperdrivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h+14 -91 replyApplied
8/8mlxsw: spectrum_router: Privatize mlxsw_sp_rif_dev()drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h+1 -21 replyApplied

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchAmit CohenSimon Horman
1/8R-b R-b
2/8R-b R-b
3/8R-b R-b
4/8R-b R-b
5/8R-b R-b
6/8R-b R-b
7/8R-b R-b
8/8R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/8] mlxsw: Cleanups in router code

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(-)
Signature · 1 line
2.40.1