From owner-svn-src-all@freebsd.org Wed Oct 2 09:27:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C14C12897B; Wed, 2 Oct 2019 09:27:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jrPm70n8z45M9; Wed, 2 Oct 2019 09:27:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF67F296FA; Wed, 2 Oct 2019 09:27:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x929R8ea004521; Wed, 2 Oct 2019 09:27:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x929R8XS004520; Wed, 2 Oct 2019 09:27:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201910020927.x929R8XS004520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Oct 2019 09:27:08 +0000 (UTC) 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 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 352964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 09:27:09 -0000 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);