svn commit: r341551 - head/sys/dev/mlx4/mlx4_core
Slava Shwartsman
slavash at FreeBSD.org
Wed Dec 5 13:39:06 UTC 2018
Author: slavash
Date: Wed Dec 5 13:39:05 2018
New Revision: 341551
URL: https://svnweb.freebsd.org/changeset/base/341551
Log:
mlx4: Make sure default VNET is set when adding a new interface.
Adding an interface might be done outside the device_attach() routine
and will then cause a panic, due to the VNET not being defined.
Submitted by: hselasky@
Approved by: hselasky (mentor)
MFC after: 1 week
Sponsored by: Mellanox Technologies
Modified:
head/sys/dev/mlx4/mlx4_core/mlx4_intf.c
Modified: head/sys/dev/mlx4/mlx4_core/mlx4_intf.c
==============================================================================
--- head/sys/dev/mlx4/mlx4_core/mlx4_intf.c Wed Dec 5 13:38:35 2018 (r341550)
+++ head/sys/dev/mlx4/mlx4_core/mlx4_intf.c Wed Dec 5 13:39:05 2018 (r341551)
@@ -62,8 +62,11 @@ static void mlx4_add_device(struct mlx4_interface *int
spin_lock_irq(&priv->ctx_lock);
list_add_tail(&dev_ctx->list, &priv->ctx_list);
spin_unlock_irq(&priv->ctx_lock);
- if (intf->activate)
+ if (intf->activate) {
+ CURVNET_SET_QUIET(vnet0);
intf->activate(&priv->dev, dev_ctx->context);
+ CURVNET_RESTORE();
+ }
} else
kfree(dev_ctx);
}
More information about the svn-src-head
mailing list