Date: Wed, 12 Dec 2018 11:55:43 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341916 - stable/11/sys/dev/mlx4/mlx4_core Message-ID: <201812121155.wBCBth02063823@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Wed Dec 12 11:55:43 2018 New Revision: 341916 URL: https://svnweb.freebsd.org/changeset/base/341916 Log: MFC r341551: 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. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx4/mlx4_core/mlx4_intf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx4/mlx4_core/mlx4_intf.c ============================================================================== --- stable/11/sys/dev/mlx4/mlx4_core/mlx4_intf.c Wed Dec 12 11:55:41 2018 (r341915) +++ stable/11/sys/dev/mlx4/mlx4_core/mlx4_intf.c Wed Dec 12 11:55:43 2018 (r341916) @@ -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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812121155.wBCBth02063823>