Skip to content
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

UCT/IB: get roce ndev name according to right gid but not fixed gid 0 #5996

Merged
merged 1 commit into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/uct/ib/base/ib_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ int uct_ib_get_cqe_size(int cqe_size_min)

static ucs_status_t
uct_ib_device_get_roce_ndev_name(uct_ib_device_t *dev, uint8_t port_num,
char *ndev_name, size_t max)
uint8_t gid_index, char *ndev_name, size_t max)
{
ssize_t nread;

Expand All @@ -1338,7 +1338,7 @@ uct_ib_device_get_roce_ndev_name(uct_ib_device_t *dev, uint8_t port_num,
/* get the network device name which corresponds to a RoCE port */
nread = ucs_read_file_str(ndev_name, max, 1,
UCT_IB_DEVICE_SYSFS_GID_NDEV_FMT,
uct_ib_device_name(dev), port_num, 0);
uct_ib_device_name(dev), port_num, gid_index);
if (nread < 0) {
ucs_diag("failed to read " UCT_IB_DEVICE_SYSFS_GID_NDEV_FMT": %m",
uct_ib_device_name(dev), port_num, 0);
Expand All @@ -1349,14 +1349,15 @@ uct_ib_device_get_roce_ndev_name(uct_ib_device_t *dev, uint8_t port_num,
return UCS_OK;
}

unsigned uct_ib_device_get_roce_lag_level(uct_ib_device_t *dev, uint8_t port_num)
unsigned uct_ib_device_get_roce_lag_level(uct_ib_device_t *dev, uint8_t port_num,
uint8_t gid_index)
{
char ndev_name[IFNAMSIZ];
unsigned roce_lag_level;
ucs_status_t status;

status = uct_ib_device_get_roce_ndev_name(dev, port_num, ndev_name,
sizeof(ndev_name));
status = uct_ib_device_get_roce_ndev_name(dev, port_num, gid_index,
ndev_name, sizeof(ndev_name));
if (status != UCS_OK) {
return 1;
}
Expand Down
3 changes: 2 additions & 1 deletion src/uct/ib/base/ib_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ ucs_status_t uct_ib_device_create_ah_cached(uct_ib_device_t *dev,
void uct_ib_device_cleanup_ah_cached(uct_ib_device_t *dev);

unsigned uct_ib_device_get_roce_lag_level(uct_ib_device_t *dev,
uint8_t port_num);
uint8_t port_num,
uint8_t gid_index);


static inline struct ibv_port_attr*
Expand Down
3 changes: 2 additions & 1 deletion src/uct/ib/base/ib_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,8 @@ static void uct_ib_iface_set_num_paths(uct_ib_iface_t *iface,
if (uct_ib_iface_is_roce(iface)) {
/* RoCE - number of paths is RoCE LAG level */
iface->num_paths =
uct_ib_device_get_roce_lag_level(dev, iface->config.port_num);
uct_ib_device_get_roce_lag_level(dev, iface->config.port_num,
iface->gid_info.gid_index);
} else {
/* IB - number of paths is LMC level */
ucs_assert(iface->path_bits_count > 0);
Expand Down