Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mlx4: Avoid resetting MLX4_INTFF_BONDING per driver

The mlx4_core driver has a logic that allows a sub-driver to set the
MLX4_INTFF_BONDING flag which then causes that function mlx4_do_bond()
asks the sub-driver to fully re-probe a device when its bonding
configuration changes.

Performing this operation is disallowed in mlx4_register_interface()
when it is detected that any mlx4 device is multifunction (SRIOV). The
code then resets MLX4_INTFF_BONDING in the driver flags.

Move this check directly into mlx4_do_bond(). It provides a better
separation as mlx4_core no longer directly modifies the sub-driver flags
and it will allow to get rid of explicitly keeping track of all mlx4
devices by the intf.c code when it is switched to an auxiliary bus.

Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Tested-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Acked-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Petr Pavlu and committed by
David S. Miller
c9452b8f e2fb47d4

+11 -8
+11 -8
drivers/net/ethernet/mellanox/mlx4/intf.c
··· 96 96 97 97 list_add_tail(&intf->list, &intf_list); 98 98 list_for_each_entry(priv, &dev_list, dev_list) { 99 - if (mlx4_is_mfunc(&priv->dev) && (intf->flags & MLX4_INTFF_BONDING)) { 100 - mlx4_dbg(&priv->dev, 101 - "SRIOV, disabling HA mode for intf proto %d\n", intf->protocol); 102 - intf->flags &= ~MLX4_INTFF_BONDING; 103 - } 104 99 mlx4_add_device(intf, priv); 105 100 } 106 101 ··· 150 155 151 156 spin_lock_irqsave(&priv->ctx_lock, flags); 152 157 list_for_each_entry_safe(dev_ctx, temp_dev_ctx, &priv->ctx_list, list) { 153 - if (dev_ctx->intf->flags & MLX4_INTFF_BONDING) { 154 - list_add_tail(&dev_ctx->bond_list, &bond_list); 155 - list_del(&dev_ctx->list); 158 + if (!(dev_ctx->intf->flags & MLX4_INTFF_BONDING)) 159 + continue; 160 + 161 + if (mlx4_is_mfunc(dev)) { 162 + mlx4_dbg(dev, 163 + "SRIOV, disabled HA mode for intf proto %d\n", 164 + dev_ctx->intf->protocol); 165 + continue; 156 166 } 167 + 168 + list_add_tail(&dev_ctx->bond_list, &bond_list); 169 + list_del(&dev_ctx->list); 157 170 } 158 171 spin_unlock_irqrestore(&priv->ctx_lock, flags); 159 172