Skip to content

Commit

Permalink
Merge pull request #1505 from amzn/service-level
Browse files Browse the repository at this point in the history
Add QP service level in EFA DV
  • Loading branch information
rleon authored Nov 12, 2024
2 parents e8b1192 + c113e07 commit 423f8a1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion providers/efa/efadv.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ struct efadv_qp_init_attr {
uint64_t comp_mask;
uint32_t driver_qp_type;
uint16_t flags;
uint8_t reserved[2];
uint8_t sl;
uint8_t reserved[1];
};

struct ibv_qp *efadv_create_qp_ex(struct ibv_context *ibvctx,
Expand Down
6 changes: 5 additions & 1 deletion providers/efa/man/efadv_create_qp_ex.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ struct efadv_qp_init_attr {
uint64_t comp_mask;
uint32_t driver_qp_type;
uint16_t flags;
uint8_t reserved[2];
uint8_t sl;
uint8_t reserved[1];
};
```

Expand All @@ -67,6 +68,9 @@ struct efadv_qp_init_attr {
EFADV_QP_FLAGS_UNSOLICITED_WRITE_RECV:
Receive WRs will not be consumed for RDMA write with imm.

*sl*
: Service Level - 0 value implies default level.

# RETURN VALUE

efadv_create_qp_ex() returns a pointer to the created QP, or NULL if the request fails.
Expand Down
2 changes: 2 additions & 0 deletions providers/efa/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,8 @@ static struct ibv_qp *create_qp(struct ibv_context *ibvctx,
if (efa_attr->flags & EFADV_QP_FLAGS_UNSOLICITED_WRITE_RECV)
req.flags |= EFA_CREATE_QP_WITH_UNSOLICITED_WRITE_RECV;

req.sl = efa_attr->sl;

err = ibv_cmd_create_qp_ex(ibvctx, &qp->verbs_qp,
attr, &req.ibv_cmd, sizeof(req),
&resp.ibv_resp, sizeof(resp));
Expand Down
8 changes: 8 additions & 0 deletions pyverbs/providers/efa/efadv.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ cdef class EfaQPInitAttr(PyverbsObject):
def flags(self, val):
self.qp_init_attr.flags = val

@property
def sl(self):
return self.qp_init_attr.sl

@sl.setter
def sl(self,val):
self.qp_init_attr.sl = val


cdef class SRDQPEx(QPEx):
"""
Expand Down
3 changes: 2 additions & 1 deletion pyverbs/providers/efa/libefa.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ cdef extern from 'infiniband/efadv.h':
uint64_t comp_mask;
uint32_t driver_qp_type;
uint16_t flags;
uint8_t reserved[2];
uint8_t sl;
uint8_t reserved[1];

cdef struct efadv_cq_init_attr:
uint64_t comp_mask;
Expand Down

0 comments on commit 423f8a1

Please # to comment.