mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Shravan Kumar Ramani <shravankr@nvidia.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <markgross@kernel.org>,
	Vadim Pasternak <vadimp@nvidia.com>,
	David Thompson <davthompson@nvidia.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] platform/mellanox: mlxbf-pmc: Add support for BlueField-3
Date: Fri, 1 Sep 2023 13:37:00 +0300 (EEST)	[thread overview]
Message-ID: <5c811875-aeab-183c-858f-298013741c60@linux.intel.com> (raw)
In-Reply-To: <94d48f57b3625ff7021e11ebdf9facf5cfec36cc.1693545970.git.shravankr@nvidia.com>

On Fri, 1 Sep 2023, Shravan Kumar Ramani wrote:

> Add new access mechanism and list of supported events to program
> and read the counters in BlueField-3.
> Performance counter blocks being added for BlueField-3 include:
>   - Memory Sub-system (mss) which has counters for monitoring
> various DRAM and related skylib events
>   - Last level Tile, which has 2 sets of counters (llt, llt_miss)
> for monitoring Tile and cache metrics
> 
> Signed-off-by: Shravan Kumar Ramani <shravankr@nvidia.com>
> Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
> Reviewed-by: David Thompson <davthompson@nvidia.com>
> ---
>  drivers/platform/mellanox/mlxbf-pmc.c | 685 ++++++++++++++++++++++++--
>  1 file changed, 653 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/platform/mellanox/mlxbf-pmc.c b/drivers/platform/mellanox/mlxbf-pmc.c
> index 2d4bbe99959e..ddd91f298721 100644
> --- a/drivers/platform/mellanox/mlxbf-pmc.c
> +++ b/drivers/platform/mellanox/mlxbf-pmc.c

> @@ -712,6 +1160,42 @@ static int mlxbf_pmc_program_l3_counter(int blk_num, uint32_t cnt_num,
>  	return mlxbf_pmc_write(pmcaddr, MLXBF_PMC_WRITE_REG_32, *wordaddr);
>  }
>  
> +/* Method to handle crspace counter programming */
> +static int mlxbf_pmc_program_crspace_counter(int blk_num, uint32_t cnt_num,
> +					     uint32_t evt)
> +{
> +	uint32_t word;
> +	void *addr;
> +	int ret;
> +
> +	addr = pmc->block[blk_num].mmio_base + (rounddown(cnt_num, 2) * 4);


> +	addr = pmc->block[blk_num].mmio_base +
> +		MLXBF_PMC_CRSPACE_PERFMON_VAL0(pmc->block[blk_num].counters) +
> +		(cnt_num * 4);


> +	status = mlxbf_pmc_readl(pmc->block[blk_num].mmio_base +
> +		MLXBF_PMC_CRSPACE_PERFMON_VAL0(pmc->block[blk_num].counters) +
> +		(cnt_num * 4), &value);


> +	addr = pmc->block[blk_num].mmio_base + (rounddown(cnt_num, 2) * 4);

Should those * 4 be sizeof(something) or defined?


-- 
 i.


  reply	other threads:[~2023-09-01 10:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01  5:43 [PATCH v3 0/3] Updates to Mellanox PMC driver Shravan Kumar Ramani
2023-09-01  5:43 ` [PATCH v3 1/3] platform/mellanox: mlxbf-pmc: Fix potential buffer overflows Shravan Kumar Ramani
2023-09-01  5:43 ` [PATCH v3 2/3] platform/mellanox: mlxbf-pmc: Fix reading of unprogrammed events Shravan Kumar Ramani
2023-09-01  5:43 ` [PATCH v3 3/3] platform/mellanox: mlxbf-pmc: Add support for BlueField-3 Shravan Kumar Ramani
2023-09-01 10:37   ` Ilpo Järvinen [this message]
2023-09-01 10:50   ` Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c811875-aeab-183c-858f-298013741c60@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=davthompson@nvidia.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=shravankr@nvidia.com \
    --cc=vadimp@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome