-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PCI BDF and ACS information to switchtec status command #25
Conversation
This is the BDF of the port not the device (which was there previously) Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
The Bus-Device-Function path is another way of representing the PCI address of a device. Instead of using the full BDF of the device, use the BDF of a base device followed by a path of device and functions. This is similar to the "device scope" structure in the Intel VT-d spec, Section 8.3.1. It will also be useful for specifying the switch ports on the command line to disable ACS in the system. Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Also, add a verbose flag which, when set, the BDF path is also displayed. Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
This will be used to print the ACS control register in the switchtec status command. Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
In order to print the ACS register in the status flag we parse the PCI config space when get_devices is called. The config space is parsed for each down stream port. Note: the config space can only be read with root priviliges so the acs_ctrl field will be set to -1 if we were unable to read or parse the config space for any reason. Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
If available, print the ACS information for each port in the status command. Also, add a verbose flag. If given, the ACS information is printed similar to lspci, if not it just states whether P2P is direct or redirected. Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
I've rebased the commits onto the latest devel branch to satisfy the conflict. But it's been two weeks since I submitted this and haven't heard anything. Can you guys please review and let me know? Thanks Logan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Logan,
I tested your patches. I found two issues.
(1) switchtec-user get incorrect port count. To fix it, The line 326 (lib/switchtec.c, Function switchtec_status() ) should be a break. And we should add another check.
-
if ((ports[i].phys_port_id == 0) && (i != 0))
-
break;
(2) switchtec-user does not show the BDF and ACS information of cascaded Switchtec. I attached a picture.
For the first issue. I reopen the pull request. #23 |
For issue 2. my test setup is |
As you point out, issue 1 is unrelated to this patch set. Issue 2 isn't fixable. We can only print the ACS information for ports attached to the current host. We can't do so (and really have no interest in doing so) for ports in another partition attached to a different host. |
Since this PR is now approved can it be pulled into this repo? I have some other PRs in progress that depend on this. Thanks! |
@sbates130272 |
Hi,
For the P2P applications we are working on it is useful to quickly know the ACS status for all the dowstream ports (DSPs). We're also working on a patchset for the Linux kernel to disable ACS for a set of DSPs using a command line parameter. For this, it is useful to know the BDF for the DSP that we need to disable ACS for. It's also recommended to use a BDF path to address a device which is more stable to renumbering concerns (see the Linux pathset for more information).
Patch 1 and 2 in this series add the port's BDF and BDF path to the status structure. Patch 3 prints this information in the 'switchtec status' command. Patch 4 and 5 are to parse the PCI configuration structure to obtain the ACS register for the port and the final patch prints that information in switchtec status.
This patchset passes Travis.
Thanks,
Logan