summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2018-03-26 20:09:36 +0000
committerhselasky <hselasky@FreeBSD.org>2018-03-26 20:09:36 +0000
commitb90536a91966c28a3c0d92eb9ad95b38721070fe (patch)
treedc98928d7f09c0a5fb13ac553f826923fc22ee7a
parent0f843a0abc0c7e5c5cdc9223d68908b5fb689fc2 (diff)
downloadFreeBSD-src-b90536a91966c28a3c0d92eb9ad95b38721070fe.zip
FreeBSD-src-b90536a91966c28a3c0d92eb9ad95b38721070fe.tar.gz
MFC r330603:
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. Sponsored by: Mellanox Technologies
-rw-r--r--sys/dev/mlx5/mlx5_core/mlx5_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c
index 357b64d..e3959f5 100644
--- a/sys/dev/mlx5/mlx5_core/mlx5_main.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c
@@ -956,7 +956,9 @@ static void mlx5_add_device(struct mlx5_interface *intf, struct mlx5_priv *priv)
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);
OpenPOWER on IntegriCloud