Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2625766lqo; Tue, 14 May 2024 04:50:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVag1kAp4uc00r2TDGiOvjuQjNSEyGmtFUuTzx8KcyZS4SJ0A1nO8FLGC79kOCG48LYrxKDhcz7PEn5sR9cyecTJOAoHZLuM5qRevWrBQ== X-Google-Smtp-Source: AGHT+IEMKBrm0ehs80sD/7wEODRRZR9xz4vNx4Bt2kZvakpE9h0Vo+zfxR+g94sjdr/wAapX68GX X-Received: by 2002:a17:906:c285:b0:a59:cd18:92fc with SMTP id a640c23a62f3a-a5a2d672f17mr935357866b.62.1715687433227; Tue, 14 May 2024 04:50:33 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17946904si582198266b.140.2024.05.14.04.50.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 04:50:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178624-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=LZHlwbxq; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-178624-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178624-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F11D11F23343 for ; Tue, 14 May 2024 11:50:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B81C974C1B; Tue, 14 May 2024 11:44:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LZHlwbxq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEBFC60BB6; Tue, 14 May 2024 11:44:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715687096; cv=none; b=tedTU+vAcbCTHgyZSBgksYbPTMmO/9Y8pi5cT7RqKwrhHH5LMwkb/tbH7Nvcr4rnM1iuGtAFF0h8pJU1ynIS/fRUbROvxF/aT2q+w/8xkFqHrLu0h0ZKqMINcFA0P3JPyCi3cUb5atR/wHd3P38wKVT0ygF+IQgUDd3W9bi+lDc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715687096; c=relaxed/simple; bh=zMwTH5JexUfVSxwzoMsVvb2Y56k+vwlD+UGM3nXS0GI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qmKoWFy2rpLShNPzL102RXR6kylBliUQPITGxkvDZC/NxZ7c1+SvIE6EBdEsSInqlxwH4PsBQ8NxchDh2BiNCfbkStTUd6h0KErfjYYvqPDEZ19q+XnktrQLIQZafrCc6dNy62mEmpY7xdCxjw+sIOEo9uaJJdbY8+iWmroBrxs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LZHlwbxq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DC4DC32786; Tue, 14 May 2024 11:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715687096; bh=zMwTH5JexUfVSxwzoMsVvb2Y56k+vwlD+UGM3nXS0GI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LZHlwbxq5sUzTky2XhQkheoVyp6udbq4XNVTrh4Ss6Ljp4Kp64s5uVAv7yMlE6LEB q3t5QBwPk4gcPHDEv8t9AKWSUtFzWN9WF9aZjgdNCzNspew6f5lrw+MZyrFF1j4nxl 3MPsg1eMjyN5hxRTegflL1H3IcBWlJVLLJi+ICAqr88gWWKUqi64PCjto/49YFnADz dY0u+HksRhWURAWEXXEej2xnvqWfnpzOSUQ6CNz4VNtOv/Ec3/x8SlmhxT9ZO7AJv+ I4toNDaypJIcG7JxyKKfGebnzaksU0st8uFFM10nEA24zXwPZT4OCAAtNA4qZNEri3 75cE3+Tdmpo8g== Date: Tue, 14 May 2024 12:44:51 +0100 From: Simon Horman To: Anshumali Gaur Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: Re: [PATCH] octeontx2-af: Add debugfs support to dump NIX TM topology Message-ID: <20240514114451.GF2787@kernel.org> References: <20240514095434.31445-1-agaur@marvell.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240514095434.31445-1-agaur@marvell.com> On Tue, May 14, 2024 at 03:24:34PM +0530, Anshumali Gaur wrote: > This patch adds support to dump NIX transmit queue topology. > There are multiple levels of scheduling/shaping supported by > NIX and a packet traverses through multiple levels before sending > the packet out. At each level, there are set of scheduling/shaping > rules applied to a packet flow. > > Each packet traverses through multiple levels > SQ->SMQ->Tl4->Tl3->TL2->Tl1 and these levels are mapped in a parent-child > relationship. > > This patch dumps the debug information related to all TM Levels in > the following way. > > Example: > $ echo > /sys/kernel/debug/octeontx2/nix/tm_tree > $ cat /sys/kernel/debug/octeontx2/nix/tm_tree > > A more desriptive set of registers at each level can be dumped > in the following way. > > Example: > $ echo > /sys/kernel/debug/octeontx2/nix/tm_topo > $ cat /sys/kernel/debug/octeontx2/nix/tm_topo > > Signed-off-by: Anshumali Gaur ## Form letter - net-next-closed (Adapted from text by Jakub) The merge window for v6.10 has begun and therefore net-next is closed for new drivers, features, code refactoring and optimizations. We are currently accepting bug fixes only. Please repost when net-next reopens after May 27th. RFC patches sent for review only are welcome at any time. See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle ## End form letter Also, as this patch seems to be for net-next, please include that in the subject. [PATCH net-next] ... > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c .. > +/*dumps given tm_tree registers*/ > +static int rvu_dbg_nix_tm_tree_display(struct seq_file *m, void *unused) > +{ > + int qidx, nixlf, rc, id, max_id = 0; > + struct nix_hw *nix_hw = m->private; > + struct rvu *rvu = nix_hw->rvu; > + struct nix_aq_enq_req aq_req; > + struct nix_aq_enq_rsp rsp; > + struct rvu_pfvf *pfvf; > + u16 pcifunc; > + > + nixlf = rvu->rvu_dbg.nix_tm_ctx.lf; > + id = rvu->rvu_dbg.nix_tm_ctx.id; > + > + if (!rvu_dbg_is_valid_lf(rvu, nix_hw->blkaddr, nixlf, &pcifunc)) > + return -EINVAL; > + > + pfvf = rvu_get_pfvf(rvu, pcifunc); > + max_id = pfvf->sq_ctx->qsize; > + > + memset(&aq_req, 0, sizeof(struct nix_aq_enq_req)); > + aq_req.hdr.pcifunc = pcifunc; > + aq_req.ctype = NIX_AQ_CTYPE_SQ; > + aq_req.op = NIX_AQ_INSTOP_READ; > + seq_printf(m, "pcifunc is 0x%x\n", pcifunc); > + for (qidx = id; qidx < max_id; qidx++) { > + aq_req.qidx = qidx; > + rc = rvu_mbox_handler_nix_aq_enq(rvu, &aq_req, &rsp); > + > + /* Skip SQ's if not initialized */ > + if (!test_bit(qidx, pfvf->sq_bmap)) > + continue; nit: The indentation of the lines immediately above is not consistent with the code around it. Flagged by Smatch. > + > + if (rc) { > + seq_printf(m, "Failed to read SQ(%d) context\n", > + aq_req.qidx); > + continue; > + } > + print_tm_tree(m, &rsp, aq_req.qidx); > + } > + return 0; > +} .. > +/*dumps given tm_topo registers*/ > +static int rvu_dbg_nix_tm_topo_display(struct seq_file *m, void *unused) > +{ > + struct nix_hw *nix_hw = m->private; > + struct rvu *rvu = nix_hw->rvu; > + struct nix_aq_enq_req aq_req; > + struct nix_txsch *txsch; > + int nixlf, lvl, schq; > + u16 pcifunc; > + > + nixlf = rvu->rvu_dbg.nix_tm_ctx.lf; > + > + if (!rvu_dbg_is_valid_lf(rvu, nix_hw->blkaddr, nixlf, &pcifunc)) > + return -EINVAL; > + > + memset(&aq_req, 0, sizeof(struct nix_aq_enq_req)); > + aq_req.hdr.pcifunc = pcifunc; > + aq_req.ctype = NIX_AQ_CTYPE_SQ; > + aq_req.op = NIX_AQ_INSTOP_READ; > + seq_printf(m, "pcifunc is 0x%x\n", pcifunc); > + > + for (lvl = 0; lvl < NIX_TXSCH_LVL_CNT; lvl++) { > + txsch = &nix_hw->txsch[lvl]; > + for (schq = 0; schq < txsch->schq.max; schq++) { > + if (TXSCH_MAP_FUNC(txsch->pfvf_map[schq]) == pcifunc) > + print_tm_topo(m, schq, lvl); Here too. > + } > + } > + return 0; > +} -- pw-bot: changes-requested