mlxsw: spectrum_router: Reuse work neighbor initialization in work scheduler
authorPetr Machata <petrm@nvidia.com>
Fri, 9 Jun 2023 17:32:10 +0000 (19:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Jun 2023 08:49:30 +0000 (09:49 +0100)
commit151b89f6025a95dd8083d5844f2746a9450653ca
treedd911d64a716b35896e974aeda3bdf9e189baab0
parent14304e70634cb03913ec11b7f418df752d9ee3f8
mlxsw: spectrum_router: Reuse work neighbor initialization in work scheduler

After the struct mlxsw_sp_netevent_work.n field initialization is moved
here, the body of code that handles NETEVENT_NEIGH_UPDATE is almost
identical to the one in the helper function. Therefore defer to the helper
instead of inlining the equivalent.

Note that previously, the code took and put a reference of the netdevice.
The new code defers to mlxsw_sp_dev_lower_is_port() to obviate the need for
taking the reference.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c