Skip to content

Commit

Permalink
CR-1160935 : Fixed a issue for xbtest invalid card BDF (Xilinx#7519)
Browse files Browse the repository at this point in the history
* Fixed a issue for xbtest invalid card BDF

* Fixed a issue for xbtest invalid card BDF

Signed-off-by: Saifuddin <saifuddi@xilinx.com>

* incorporate review comments

Signed-off-by: Saifuddin <saifuddi@xilinx.com>

---------

Signed-off-by: Saifuddin <saifuddi@xilinx.com>
  • Loading branch information
saifuddin-xilinx authored May 3, 2023
1 parent 7914d6d commit e5ba80c
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/runtime_src/core/pcie/linux/system_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,23 @@ std::shared_ptr<pci::dev>
system_linux::
get_pcidev(unsigned index, bool is_user) const
{
if (is_user) {
if (index < user_ready_list.size())
return user_ready_list[index];
try {
if (is_user) {
if (index < user_ready_list.size())
return user_ready_list[index];

return user_nonready_list[index - user_ready_list.size()];
}
if ((index - user_ready_list.size()) < user_nonready_list.size())
return user_nonready_list.at(index - user_ready_list.size());
}

if (index < mgmt_ready_list.size())
return mgmt_ready_list[index];
if (index < mgmt_ready_list.size())
return mgmt_ready_list[index];

return mgmt_nonready_list[index - mgmt_ready_list.size()];
return mgmt_nonready_list.at(index - mgmt_ready_list.size());
}
catch (const std::exception&) {
return nullptr;
}
}

size_t
Expand Down

0 comments on commit e5ba80c

Please sign in to comment.