svn commit: r341915 - stable/12/sys/dev/mlx4/mlx4_core

Hans Petter Selasky hselasky at FreeBSD.org
Wed Dec 12 11:55:42 UTC 2018


Author: hselasky
Date: Wed Dec 12 11:55:41 2018
New Revision: 341915
URL: https://svnweb.freebsd.org/changeset/base/341915

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/12/sys/dev/mlx4/mlx4_core/mlx4_intf.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/mlx4/mlx4_core/mlx4_intf.c
==============================================================================
--- stable/12/sys/dev/mlx4/mlx4_core/mlx4_intf.c	Wed Dec 12 11:54:27 2018	(r341914)
+++ stable/12/sys/dev/mlx4/mlx4_core/mlx4_intf.c	Wed Dec 12 11:55:41 2018	(r341915)
@@ -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);
 }


More information about the svn-src-stable mailing list