}
static bool mlxsw_sp_rif_should_config(struct mlxsw_sp_rif *r,
+ const struct in_device *in_dev,
unsigned long event)
{
switch (event) {
case NETDEV_UP:
if (!r)
return true;
- r->ref_count++;
return false;
case NETDEV_DOWN:
- if (r && --r->ref_count == 0)
+ if (r && !in_dev->ifa_list)
return true;
/* It is possible we already removed the RIF ourselves
* if it was assigned to a netdev that is now a bridge
INIT_LIST_HEAD(&r->neigh_list);
ether_addr_copy(r->addr, l3_dev->dev_addr);
r->mtu = l3_dev->mtu;
- r->ref_count = 1;
r->dev = l3_dev;
r->rif = rif;
r->f = f;
goto out;
r = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev);
- if (!mlxsw_sp_rif_should_config(r, event))
+ if (!mlxsw_sp_rif_should_config(r, ifa->ifa_dev, event))
goto out;
if (mlxsw_sp_port_dev_check(dev))