Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Oct 2019 09:27:08 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r352964 - head/sys/dev/mlx5/mlx5_en
Message-ID:  <201910020927.x929R8XS004520@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Wed Oct  2 09:27:08 2019
New Revision: 352964
URL: https://svnweb.freebsd.org/changeset/base/352964

Log:
  Export channel IRQ number as part of the "hw_ctx_debug" sysctl(8) in mlx5en(4).
  
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c	Wed Oct  2 09:23:33 2019	(r352963)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c	Wed Oct  2 09:27:08 2019	(r352964)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2015 Mellanox Technologies. All rights reserved.
+ * Copyright (c) 2015-2019 Mellanox Technologies. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -1031,30 +1031,49 @@ mlx5e_ethtool_debug_channel_info(SYSCTL_HANDLER_ARGS)
 	struct mlx5e_sq *sq;
 	struct mlx5e_rq *rq;
 	int error, i, tc;
+	bool opened;
 
 	priv = arg1;
 	error = sysctl_wire_old_buffer(req, 0);
 	if (error != 0)
 		return (error);
-	if (sbuf_new_for_sysctl(&sb, NULL, 128, req) == NULL)
+	if (sbuf_new_for_sysctl(&sb, NULL, 1024, req) == NULL)
 		return (ENOMEM);
 	sbuf_clear_flags(&sb, SBUF_INCLUDENUL);
 
 	PRIV_LOCK(priv);
-	if (test_bit(MLX5E_STATE_OPENED, &priv->state) == 0)
-		goto out;
-	for (i = 0; i < priv->params.num_channels; i++) {
-		c = &priv->channel[i];
-		rq = &c->rq;
-		sbuf_printf(&sb, "channel %d rq %d cq %d\n",
-		    c->ix, rq->rqn, rq->cq.mcq.cqn);
-		for (tc = 0; tc < c->num_tc; tc++) {
-			sq = &c->sq[tc];
-			sbuf_printf(&sb, "channel %d tc %d sq %d cq %d\n",
-			    c->ix, tc, sq->sqn, sq->cq.mcq.cqn);
+	opened = test_bit(MLX5E_STATE_OPENED, &priv->state);
+
+	sbuf_printf(&sb, "pages irq %d\n",
+	    priv->mdev->priv.msix_arr[MLX5_EQ_VEC_PAGES].vector);
+	sbuf_printf(&sb, "command irq %d\n",
+	    priv->mdev->priv.msix_arr[MLX5_EQ_VEC_CMD].vector);
+	sbuf_printf(&sb, "async irq %d\n",
+	    priv->mdev->priv.msix_arr[MLX5_EQ_VEC_ASYNC].vector);
+
+	for (i = 0; i != priv->params.num_channels; i++) {
+		int eqn_not_used = -1;
+		int irqn = MLX5_EQ_VEC_COMP_BASE;
+
+		if (mlx5_vector2eqn(priv->mdev, i, &eqn_not_used, &irqn) != 0)
+			continue;
+
+		c = opened ? &priv->channel[i] : NULL;
+		rq = opened ? &c->rq : NULL;
+		sbuf_printf(&sb, "channel %d rq %d cq %d irq %d\n", i,
+		    opened ? rq->rqn : -1,
+		    opened ? rq->cq.mcq.cqn : -1,
+		    priv->mdev->priv.msix_arr[irqn].vector);
+
+		for (tc = 0; tc != priv->num_tc; tc++) {
+			sq = opened ? &c->sq[tc] : NULL;
+			sbuf_printf(&sb, "channel %d tc %d sq %d cq %d irq %d\n",
+			    i, tc,
+			    opened ? sq->sqn : -1,
+			    opened ? sq->cq.mcq.cqn : -1,
+			    priv->mdev->priv.msix_arr[irqn].vector);
 		}
 	}
-out:
 	PRIV_UNLOCK(priv);
 	error = sbuf_finish(&sb);
 	sbuf_delete(&sb);



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