mlxsw: spectrum_router: Add a helper to check if netdev has addresses
authorPetr Machata <petrm@nvidia.com>
Mon, 12 Jun 2023 15:31:07 +0000 (17:31 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Wed, 14 Jun 2023 11:12:20 +0000 (13:12 +0200)
commit33d11c4e5ce922bc16493fc75ad3c20cc55ed88a
tree1389d03fbd04d65aa0fddcfd9bd9157190382635
parent571c56911b45059dbdd2fb7912152e3412b658cf
mlxsw: spectrum_router: Add a helper to check if netdev has addresses

This function will be useful later as the driver will need to retroactively
create RIFs for new uppers with addresses.

Add another helper that assumes RCU lock, and restructure the code to
skip the IPv6 branch not through conditioning on the addr_list_empty
variable, but by directly returning the result value. This makes the skip
more obvious than it previously was.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c