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: Get rid of the mlx4_interface.activate callback

The mlx4_interface.activate callback was introduced in commit
79857cd31fe7 ("net/mlx4: Postpone the registration of net_device"). It
dealt with a situation when a netdev notifier received a NETDEV_REGISTER
event for a new net_device created by mlx4_en but the same device was
not yet visible to mlx4_get_protocol_dev(). The callback can be removed
now that mlx4_get_protocol_dev() is gone.

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
13f85711 73d68002

+16 -24
+16 -21
drivers/net/ethernet/mellanox/mlx4/en_main.c
··· 259 259 kfree(mdev); 260 260 } 261 261 262 - static void mlx4_en_activate(struct mlx4_dev *dev, void *ctx) 263 - { 264 - int i; 265 - struct mlx4_en_dev *mdev = ctx; 266 - 267 - /* Create a netdev for each port */ 268 - mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) { 269 - mlx4_info(mdev, "Activating port:%d\n", i); 270 - if (mlx4_en_init_netdev(mdev, i, &mdev->profile.prof[i])) 271 - mdev->pndev[i] = NULL; 272 - } 273 - 274 - /* register netdev notifier */ 275 - mdev->netdev_nb.notifier_call = mlx4_en_netdev_event; 276 - if (register_netdevice_notifier(&mdev->netdev_nb)) { 277 - mdev->netdev_nb.notifier_call = NULL; 278 - mlx4_err(mdev, "Failed to create netdev notifier\n"); 279 - } 280 - } 281 - 282 262 static void *mlx4_en_add(struct mlx4_dev *dev) 283 263 { 284 264 struct mlx4_en_dev *mdev; ··· 330 350 err = mlx4_register_event_notifier(dev, &mdev->mlx_nb); 331 351 WARN(err, "failed to register mlx4 event notifier (%d)", err); 332 352 353 + /* Setup ports */ 354 + 355 + /* Create a netdev for each port */ 356 + mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) { 357 + mlx4_info(mdev, "Activating port:%d\n", i); 358 + if (mlx4_en_init_netdev(mdev, i, &mdev->profile.prof[i])) 359 + mdev->pndev[i] = NULL; 360 + } 361 + 362 + /* register netdev notifier */ 363 + mdev->netdev_nb.notifier_call = mlx4_en_netdev_event; 364 + if (register_netdevice_notifier(&mdev->netdev_nb)) { 365 + mdev->netdev_nb.notifier_call = NULL; 366 + mlx4_err(mdev, "Failed to create netdev notifier\n"); 367 + } 368 + 333 369 return mdev; 334 370 335 371 err_mr: ··· 367 371 .add = mlx4_en_add, 368 372 .remove = mlx4_en_remove, 369 373 .protocol = MLX4_PROT_ETH, 370 - .activate = mlx4_en_activate, 371 374 }; 372 375 373 376 static void mlx4_en_verify_params(void)
-2
drivers/net/ethernet/mellanox/mlx4/intf.c
··· 64 64 spin_lock_irq(&priv->ctx_lock); 65 65 list_add_tail(&dev_ctx->list, &priv->ctx_list); 66 66 spin_unlock_irq(&priv->ctx_lock); 67 - if (intf->activate) 68 - intf->activate(&priv->dev, dev_ctx->context); 69 67 } else 70 68 kfree(dev_ctx); 71 69
-1
include/linux/mlx4/driver.h
··· 58 58 struct mlx4_interface { 59 59 void * (*add) (struct mlx4_dev *dev); 60 60 void (*remove)(struct mlx4_dev *dev, void *context); 61 - void (*activate)(struct mlx4_dev *dev, void *context); 62 61 struct list_head list; 63 62 enum mlx4_protocol protocol; 64 63 int flags;