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/EFA/SRD: Initial interface add #10412

Merged
merged 1 commit into from
Jan 23, 2025
Merged

Conversation

tvegas1
Copy link
Contributor

@tvegas1 tvegas1 commented Jan 10, 2025

What?

Initial add of SRD transport with bare interface instantiation with QP, tested like below.

Depends on #10069 to implement build and testing in CI.

Test

$ valgrind ./install/bin/ucx_info -d
...
#      Transport: srd
#         Device: rdmap1:1
#           Type: network
#  System device: <unknown>
#
#      capabilities:
#            bandwidth: 11797.08/ppn + 0.00 MB/sec
#              latency: 630 nsec
#             overhead: 105 nsec
#            get_bcopy: <= 4K
...

src/uct/ib/base/ib_iface.h Outdated Show resolved Hide resolved
src/uct/ib/efa/Makefile.am Outdated Show resolved Hide resolved
src/uct/ib/efa/srd/srd_def.h Outdated Show resolved Hide resolved
src/uct/ib/efa/srd/srd_def.h Outdated Show resolved Hide resolved
src/uct/ib/efa/srd/srd_iface.c Outdated Show resolved Hide resolved
src/uct/ib/efa/srd/srd_iface.c Outdated Show resolved Hide resolved
src/uct/ib/efa/srd/srd_iface.c Outdated Show resolved Hide resolved
src/uct/ib/efa/srd/srd_iface.c Outdated Show resolved Hide resolved
src/uct/ib/efa/srd/srd_iface.c Outdated Show resolved Hide resolved
src/uct/ib/efa/srd/srd_iface.h Outdated Show resolved Hide resolved
src/uct/ib/efa/Makefile.am Show resolved Hide resolved
Comment on lines 70 to 71
qp_init_attr.cap.max_send_sge = 1 + ucs_min(config->super.tx.min_sge,
efa_attr->max_sq_sge - 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems simpler

Suggested change
qp_init_attr.cap.max_send_sge = 1 + ucs_min(config->super.tx.min_sge,
efa_attr->max_sq_sge - 1);
qp_init_attr.cap.max_send_sge = ucs_min(config->super.tx.min_sge + 1,
efa_attr->max_sq_sge);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

iface->super.config.max_inl_cqe[UCT_IB_DIR_RX]);

/* Transition the QP to RTS */
memset(&qp_attr, 0, sizeof(qp_attr));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not initializing in place as other attrs in this func?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

return status;
}

memset(&init_attr, 0, sizeof(init_attr));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe init in place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

ret = ibv_modify_qp(iface->qp, &qp_attr,
IBV_QP_STATE | IBV_QP_PKEY_INDEX |
IBV_QP_PORT | IBV_QP_QKEY);
if (ret) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (ret) {
if (ret != 0) {

?
or use the same style for all places in this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment on lines 296 to 298
/* TAG */
iface_attr->cap.tag.rndv.max_zcopy = iface->config.max_get_zcopy;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to initialize, because SRD does not support tag offload

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks removed

Comment on lines 300 to 301
iface_attr->cap.am.max_short = uct_ib_iface_hdr_size(
iface->config.max_inline, sizeof(uct_srd_neth_t));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can move this part to line 313 (when AM short support is checked)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment on lines 310 to 311
iface_attr->cap.am.max_short = uct_ib_iface_hdr_size(
md->dev.max_inline_data, sizeof(uct_srd_neth_t));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you already initialized on line 300 using different value. What is the correct one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed


#include "srd_def.h"

/** @file srd_iface.h */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

#ifndef UCT_SRD_IFACE_H
#define UCT_SRD_IFACE_H

#include <uct/ib/base/ib_iface.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor - it is already included in srd_def.h

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, will rely implicitly on it

src/uct/ib/efa/srd/srd_def.h Show resolved Hide resolved
src/uct/ib/efa/srd/srd_iface.c Outdated Show resolved Hide resolved
src/uct/ib/efa/srd/srd_iface.c Outdated Show resolved Hide resolved
Comment on lines 213 to 228
memset(&self->tx.wr_inl, 0, sizeof(self->tx.wr_inl));
self->tx.wr_inl.opcode = IBV_WR_SEND;
self->tx.wr_inl.wr_id = 0xBEEBBEEB;
self->tx.wr_inl.wr.ud.remote_qkey = UCT_IB_KEY;
self->tx.wr_inl.imm_data = 0;
self->tx.wr_inl.next = 0;
self->tx.wr_inl.sg_list = self->tx.sge;

memset(&self->tx.wr_desc, 0, sizeof(self->tx.wr_desc));
self->tx.wr_desc.opcode = IBV_WR_SEND;
self->tx.wr_desc.wr_id = 0xFAAFFAAF;
self->tx.wr_desc.wr.ud.remote_qkey = UCT_IB_KEY;
self->tx.wr_desc.imm_data = 0;
self->tx.wr_desc.next = 0;
self->tx.wr_desc.sg_list = self->tx.sge;
self->tx.wr_desc.num_sge = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add it to ud_iface_common.h/c

src/uct/ib/efa/srd/srd_iface.h Show resolved Hide resolved
@@ -12,10 +12,10 @@
#include <ucs/datastruct/ptr_array.h>
#include <ucs/datastruct/conn_match.h>

#include "srd_def.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: include local files before the other includes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -790,6 +790,25 @@ ucs_status_t uct_ud_verbs_qp_max_send_sge(uct_ud_verbs_iface_t *iface,
return UCS_OK;
}

void uct_ud_iface_send_wr_init(struct ibv_send_wr *wr, struct ibv_sge *sge,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it preparation for the next PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it is already being used where applicable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not to make it static then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is being used in INIT iface function in srd_iface.c

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double checking, you are right, there is naming issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks!

yosefe
yosefe previously approved these changes Jan 20, 2025
iface_attr->overhead = 105e-9;

/* AM */

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: extra line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -790,6 +790,25 @@ ucs_status_t uct_ud_verbs_qp_max_send_sge(uct_ud_verbs_iface_t *iface,
return UCS_OK;
}

void uct_ud_iface_send_wr_init(struct ibv_send_wr *wr, struct ibv_sge *sge,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not to make it static then?

@brminich brminich merged commit 969ed1d into openucx:master Jan 23, 2025
147 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants