Author: hselasky
Date: Wed Mar 7 14:49:27 2018
New Revision: 330603
URL: https://svnweb.freebsd.org/changeset/base/330603
Log:
Make sure default VNET is set when adding a new interface in mlx5core.
Adding an interface might be done outside the device_attach() routine
and will then cause a panic, due to the VNET not being set.
MFC after: 1 week
Sponsored by: Mellanox Technologies
Modified:
head/sys/dev/mlx5/mlx5_core/mlx5_main.c
Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Mar 7 14:47:43 2018
(r330602)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Mar 7 14:49:27 2018
(r330603)
@@ -956,7 +956,9 @@ static void mlx5_add_device(struct mlx5_interface *int
dev_ctx = kmalloc(sizeof(*dev_ctx), GFP_KERNEL);
dev_ctx->intf = intf;
+ CURVNET_SET_QUIET(vnet0);
dev_ctx->context = intf->add(dev);
+ CURVNET_RESTORE();
if (dev_ctx->context) {
spin_lock_irq(&priv->ctx_lock);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"