Repository navigation
UCS/TOPO: Build device inventory #11869
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
Changes from 49 commits
0e5b9f4
e21dd8a
0c9b8ad
424f2d2
cbd7dfa
41c7ade
57bd182
d2a186d
43544e8
8ec91cd
851958e
76366e8
ace0d12
e53e42c
f44a84f
5493800
a428a81
8800dbd
fbb6c3c
ad06365
2e64a83
b5295f0
c165b6b
defab99
37644d6
bb0864b
bf8a946
01680f3
5a6bbb4
615a075
11ec84c
26b23e5
e841f67
7712e2f
b8c3681
7abeb61
76fc542
9036f03
474ca21
e8c5650
4e72f2a
ae53143
5ce1fca
f462319
db4b326
4f362eb
cf07023
1ffc5f3
2fa6f80
0503e2e
6ede74a
6101659
11d1227
cfc44cf
f2eafa6
6f22749
a7eb44e
05c3e35
defdf86
c020a4b
0fbc99d
33a2ba7
dcd7127
cab9de0
7a2e3ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,18 @@ BEGIN_C_DECLS | |
| /* Maximal size of BDF string */ | ||
| #define UCS_SYS_BDF_NAME_MAX 16 | ||
|
|
||
| /* Bus ID string formatting */ | ||
| #define UCS_SYS_BUS_ID_FMT "%04x:%02x:%02x.%u" | ||
| #define UCS_SYS_BUS_ID_ARG(_bus_id) \ | ||
| (unsigned)(_bus_id)->domain, (unsigned)(_bus_id)->bus, \ | ||
| (unsigned)(_bus_id)->slot, (unsigned)(_bus_id)->function | ||
|
|
||
| /* Bus ID string formatting (abbreviated) */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... formatting without the domain
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean change the comment but keep the macro name? |
||
| #define UCS_SYS_BUS_ID_ABBREVIATED_FMT "%02x:%02x.%u" | ||
| #define UCS_SYS_BUS_ID_ABBREVIATED_ARG(_bus_id) \ | ||
| (unsigned)(_bus_id)->bus, (unsigned)(_bus_id)->slot, \ | ||
| (unsigned)(_bus_id)->function | ||
|
|
||
| /* Special values for undefined PCI identifiers */ | ||
| #define UCS_SYS_PCI_ID_VALUE_UNDEFINED 0x0000 | ||
| #define UCS_SYS_PCI_ID_UNDEFINED \ | ||
|
|
@@ -48,6 +60,7 @@ BEGIN_C_DECLS | |
| #define UCS_SYS_PCI_ID_FMT "[%04x:%04x]" | ||
| #define UCS_SYS_PCI_ID_ARG(_pci_id) ((_pci_id)->vendor), ((_pci_id)->device) | ||
|
|
||
|
|
||
|
guy-ealey-morag marked this conversation as resolved.
Resolved
guy-ealey-morag marked this conversation as resolved.
Resolved
guy-ealey-morag marked this conversation as resolved.
Resolved
|
||
| typedef struct ucs_sys_bus_id { | ||
| uint16_t domain; /* range: 0 to ffff */ | ||
| uint8_t bus; /* range: 0 to ff */ | ||
|
|
@@ -262,6 +275,22 @@ ucs_bus_id_bit_rep_t | |
| ucs_topo_get_bus_id_bit_repr(const ucs_sys_bus_id_t *bus_id); | ||
|
|
||
|
|
||
| /** | ||
| * Compare two system devices by their topology identity. | ||
| * | ||
| * Registered devices are ordered by PCI bus id, then by user-defined value. | ||
| * @ref UCS_SYS_DEVICE_ID_UNKNOWN is ordered after all registered devices. | ||
| * Other device identifiers must be valid and registered. | ||
| * | ||
| * @param [in] sys_dev1 First system device. | ||
| * @param [in] sys_dev2 Second system device. | ||
| * | ||
| * @return A negative value if @a sys_dev1 precedes @a sys_dev2, a positive | ||
| * value if @a sys_dev2 precedes @a sys_dev1, or zero if equal. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: with this PR there are three identical |
||
| */ | ||
| int ucs_topo_sys_dev_cmp(ucs_sys_device_t sys_dev1, ucs_sys_device_t sys_dev2); | ||
|
|
||
|
|
||
| /** | ||
| * Find the distance between two system devices (in terms of latency, | ||
| * bandwidth, hops, etc). | ||
|
|
||
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.
ucp_proto_multi_sys_dev_cmphere,ucs_topo_groups_sys_dev_cmpin topo_groups.c, andtopo_test_sys_device_cmpin test_topo.cc are the sameqsort_rtrampoline. Can we export aqsort_r-compatible comparator fromucs/sys/topo/base/topo.hand drop this one and the gtest copy?