svn commit: r331574 - stable/11/sys/dev/mlx5/mlx5_core

Hans Petter Selasky hselasky at FreeBSD.org
Mon Mar 26 20:09:37 UTC 2018


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);


More information about the svn-src-stable mailing list