Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Dec 2018 13:39:05 +0000 (UTC)
From:      Slava Shwartsman <slavash@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341551 - head/sys/dev/mlx4/mlx4_core
Message-ID:  <201812051339.wB5Dd5Kx076353@repo.freebsd.org>

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



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