Author: hselasky
Date: Thu May 16 15:48:19 2019
New Revision: 347720
URL: https://svnweb.freebsd.org/changeset/base/347720

Log:
  MFC r347256:
  Destroy port stats debug context in correct order in mlx5en(4).
  Destroy children nodes before parent nodes.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
  stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c    Thu May 16 15:47:33 
2019        (r347719)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c    Thu May 16 15:48:19 
2019        (r347720)
@@ -1063,6 +1063,10 @@ mlx5e_ethtool_debug_stats(SYSCTL_HANDLER_ARGS)
        int error;
 
        PRIV_LOCK(priv);
+       if (priv->gone != 0) {
+               error = ENODEV;
+               goto done;
+       }
        sys_debug = priv->sysctl_debug;
        error = sysctl_handle_int(oidp, &sys_debug, 0, req);
        if (error != 0 || !req->newptr)

Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c       Thu May 16 15:47:33 
2019        (r347719)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c       Thu May 16 15:48:19 
2019        (r347720)
@@ -4076,9 +4076,9 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vp
        /* destroy all remaining sysctl nodes */
        sysctl_ctx_free(&priv->stats.vport.ctx);
        sysctl_ctx_free(&priv->stats.pport.ctx);
-       sysctl_ctx_free(&priv->sysctl_ctx);
        if (priv->sysctl_debug)
                sysctl_ctx_free(&priv->stats.port_stats_debug.ctx);
+       sysctl_ctx_free(&priv->sysctl_ctx);
 
        mlx5_core_destroy_mkey(priv->mdev, &priv->mr);
        mlx5_dealloc_transport_domain(priv->mdev, priv->tdn);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to