Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Mar 2018 14:49:28 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330603 - head/sys/dev/mlx5/mlx5_core
Message-ID:  <201803071449.w27EnSO9053491@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803071449.w27EnSO9053491>