AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: "Marek Olšák" <maraeo@gmail.com>
Cc: amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/amdgpu: return the PCIe gen and lanes from the INFO
Date: Wed, 4 Jan 2023 19:48:55 +0530	[thread overview]
Message-ID: <8ec2b238-fa8b-a693-b9d9-3a590cc05664@amd.com> (raw)
In-Reply-To: <CAAxE2A7PJdiPORP-X+7kFmix9pCo63PqeamP20BZJx4GDfJdEQ@mail.gmail.com>



On 1/4/2023 7:43 PM, Marek Olšák wrote:
> On Wed, Jan 4, 2023 at 6:50 AM Lazar, Lijo <lijo.lazar@amd.com 
> <mailto:lijo.lazar@amd.com>> wrote:
> 
> 
> 
>     On 1/4/2023 4:11 AM, Marek Olšák wrote:
>      > I see. Well, those sysfs files are not usable, and I don't think it
>      > would be important even if they were usable, but for completeness:
>      >
>      > The ioctl returns:
>      >      pcie_gen = 1
>      >      pcie_num_lanes = 16
>      >
>      > Theoretical bandwidth from those values: 4.0 GB/s
>      > My DMA test shows this write bandwidth: 3.5 GB/s
>      > It matches the expectation.
>      >
>      > Let's see the devices (there is only 1 GPU Navi21 in the system):
>      > $ lspci |egrep '(PCI|VGA).*Navi'
>      > 0a:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi
>     10 XL
>      > Upstream Port of PCI Express Switch (rev c3)
>      > 0b:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi
>     10 XL
>      > Downstream Port of PCI Express Switch
>      > 0c:00.0 VGA compatible controller: Advanced Micro Devices, Inc.
>      > [AMD/ATI] Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] (rev c3)
>      >
>      > Let's read sysfs:
>      >
>      > $ cat /sys/bus/pci/devices/0000:0a:00.0/current_link_width
>      > 16
>      > $ cat /sys/bus/pci/devices/0000:0b:00.0/current_link_width
>      > 16
>      > $ cat /sys/bus/pci/devices/0000:0c:00.0/current_link_width
>      > 16
>      > $ cat /sys/bus/pci/devices/0000:0a:00.0/current_link_speed
>      > 2.5 GT/s PCIe
>      > $ cat /sys/bus/pci/devices/0000:0b:00.0/current_link_speed
>      > 16.0 GT/s PCIe
>      > $ cat /sys/bus/pci/devices/0000:0c:00.0/current_link_speed
>      > 16.0 GT/s PCIe
>      >
>      > Problem 1: None of the speed numbers match 4 GB/s.
> 
>     US bridge = 2.5GT/s means operating at PCIe Gen 1 speed. Total
>     theoretical bandwidth is then derived based on encoding and total
>     number
>     of lanes.
> 
>      > Problem 2: Userspace doesn't know the bus index of the bridges,
>     and it's
>      > not clear which bridge should be used.
> 
>     In general, modern ones have this arch= US->DS->EP. US is the one
>     connected to physical link.
> 
>      > Problem 3: The PCIe gen number is missing.
> 
>     Current link speed is based on whether it's Gen1/2/3/4/5.
> 
>     BTW, your patch makes use of capabilities flags which gives the maximum
>     supported speed/width by the device. It may not necessarily reflect the
>     current speed/width negotiated. I guess in NV, this info is already
>     obtained from PMFW and made available through metrics table.
> 
> 
> It computes the minimum of the device PCIe gen and the motherboard/slot 
> PCIe gen to get the final value. These 2 lines do that. The low 16 bits 
> of the mask contain the device PCIe gen mask. The high 16 bits of the 
> mask contain the slot PCIe gen mask.
> + pcie_gen_mask = adev->pm.pcie_gen_mask & (adev->pm.pcie_gen_mask >> 16);
> + dev_info->pcie_gen = fls(pcie_gen_mask);
> 

With DPM in place on some ASICs, how much does this static info help for 
upper level apps?

Thanks,
Lijo

> Marek

  reply	other threads:[~2023-01-04 14:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-30 22:07 [PATCH 1/2] drm/amdgpu: return the PCIe gen and lanes from the INFO Marek Olšák
2023-01-02 15:54 ` Christian König
2023-01-02 17:55   ` Marek Olšák
2023-01-03  8:31     ` Christian König
2023-01-03 22:41       ` Marek Olšák
2023-01-04 11:50         ` Lazar, Lijo
2023-01-04 14:13           ` Marek Olšák
2023-01-04 14:18             ` Lazar, Lijo [this message]
2023-01-04 15:10               ` Marek Olšák
2023-01-04 15:33                 ` Lazar, Lijo
2023-01-04 20:17                   ` Marek Olšák
2023-01-11 20:48                     ` Alex Deucher
2023-01-11 20:50                       ` Alex Deucher
2023-01-12  2:39                         ` Marek Olšák
2023-01-12 11:46                         ` Christian König
2023-01-12 11:50                       ` Christian König
2023-01-12 16:43                         ` Alex Deucher
2023-01-13 21:01                           ` Marek Olšák
2023-01-13 21:20                             ` Alex Deucher
2023-01-13 23:33                               ` Marek Olšák
2023-01-13 23:38                                 ` Marek Olšák
2023-01-16 11:31                                 ` Christian König
2023-01-17 19:21                                 ` Alex Deucher
2023-01-04 14:15           ` Alex Deucher

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=8ec2b238-fa8b-a693-b9d9-3a590cc05664@amd.com \
    --to=lijo.lazar@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=maraeo@gmail.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