Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2018 20:09:36 +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: r331574 - stable/11/sys/dev/mlx5/mlx5_core
Message-ID:  <201803262009.w2QK9a3d006600@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Mar 26 20:09:36 2018
New Revision: 331574
URL: https://svnweb.freebsd.org/changeset/base/331574

Log:
  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

Modified:
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c	Mon Mar 26 20:08:21 2018	(r331573)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c	Mon Mar 26 20:09:36 2018	(r331574)
@@ -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?201803262009.w2QK9a3d006600>