Skip to content
Open
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
3 changes: 3 additions & 0 deletions debian/ibverbs-providers.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ libefa.so.1 ibverbs-providers #MINVER#
EFA_1.2@EFA_1.2 43
EFA_1.3@EFA_1.3 50
EFA_1.4@EFA_1.4 59
EFA_1.5@EFA_1.5 63
efadv_create_driver_qp@EFA_1.0 24
efadv_create_qp_ex@EFA_1.1 26
efadv_query_device@EFA_1.1 26
Expand All @@ -182,6 +183,8 @@ libefa.so.1 ibverbs-providers #MINVER#
efadv_query_mr@EFA_1.3 50
efadv_query_qp_wqs@EFA_1.4 59
efadv_query_cq@EFA_1.4 59
efadv_get_max_sq_depth@EFA_1.5 63
efadv_get_max_rq_depth@EFA_1.5 63
libhns.so.1 ibverbs-providers #MINVER#
* Build-Depends-Package: libibverbs-dev
HNS_1.0@HNS_1.0 51
Expand Down
5 changes: 3 additions & 2 deletions kernel-headers/rdma/efa-abi.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
/*
* Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All rights reserved.
* Copyright 2018-2026 Amazon.com, Inc. or its affiliates. All rights reserved.
*/

#ifndef EFA_ABI_USER_H
Expand Down Expand Up @@ -44,7 +44,8 @@ struct efa_ibv_alloc_ucontext_resp {
__u32 max_llq_size; /* bytes */
__u16 max_tx_batch; /* units of 64 bytes */
__u16 min_sq_wr;
__u8 reserved_a0[4];
__u16 inline_buf_size_ex;
__u8 reserved_b0[2];
};

struct efa_ibv_alloc_pd_resp {
Expand Down
2 changes: 1 addition & 1 deletion providers/efa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if (ENABLE_LTTNG AND LTTNGUST_FOUND)
endif()

rdma_shared_provider(efa libefa.map
1 1.4.${PACKAGE_VERSION}
1 1.5.${PACKAGE_VERSION}
${TRACE_FILE}
efa.c
verbs.c
Expand Down
6 changes: 5 additions & 1 deletion providers/efa/efa.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
/*
* Copyright 2019-2025 Amazon.com, Inc. or its affiliates. All rights reserved.
* Copyright 2019-2026 Amazon.com, Inc. or its affiliates. All rights reserved.
*/

#include <stdio.h>
Expand Down Expand Up @@ -83,6 +83,10 @@ static struct verbs_context *efa_alloc_context(struct ibv_device *vdev,
ctx->cqe_size = sizeof(struct efa_io_rx_cdesc);
ctx->ex_cqe_size = sizeof(struct efa_io_rx_cdesc_ex);
ctx->inline_buf_size = resp.inline_buf_size;
ctx->inline_buf_size_ex = resp.inline_buf_size_ex;
if (ctx->inline_buf_size_ex == 0)
ctx->inline_buf_size_ex = ctx->inline_buf_size;

ctx->max_llq_size = resp.max_llq_size;
ctx->max_tx_batch = resp.max_tx_batch;
ctx->min_sq_wr = resp.min_sq_wr;
Expand Down
22 changes: 20 additions & 2 deletions providers/efa/efa.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
/*
* Copyright 2019-2025 Amazon.com, Inc. or its affiliates. All rights reserved.
* Copyright 2019-2026 Amazon.com, Inc. or its affiliates. All rights reserved.
*/

#ifndef __EFA_H__
Expand Down Expand Up @@ -31,6 +31,7 @@ struct efa_context {
uint32_t cmds_supp_udata_mask;
uint16_t sub_cqs_per_cq;
uint16_t inline_buf_size;
uint16_t inline_buf_size_ex;
uint32_t max_llq_size;
uint32_t device_caps;
uint32_t max_sq_wr;
Expand Down Expand Up @@ -133,6 +134,21 @@ struct efa_rq {
size_t buf_size;
};

struct efa_tx_wqe_ctx {
/* wqe buffer */
void *buff;
/* wqe meta descriptor */
struct efa_io_tx_meta_desc *md;
/* wqe local memory / SGL */
struct efa_io_tx_buf_desc *local_mem;
/* wqe remote memory - RDMA only */
struct efa_io_remote_mem_addr *remote_mem;
/* wqe inline data buffer */
uint8_t *inline_data;
/* max sge allowed for this wqe */
uint8_t max_sge;
};

struct efa_sq {
struct efa_wq wq;
uint8_t *desc;
Expand All @@ -141,6 +157,8 @@ struct efa_sq {
size_t max_inline_data;
size_t max_wr_rdma_sge;
uint16_t max_batch_wr;
uint16_t wqe_size;
bool inline_write_enabled;

/* Buffer for pending WR entries in the current session */
uint8_t *local_queue;
Expand All @@ -149,7 +167,7 @@ struct efa_sq {
/* Phase before current session */
int phase_rb;
/* Current wqe being built */
struct efa_io_tx_wqe *curr_tx_wqe;
struct efa_tx_wqe_ctx curr_tx_wqe;
};

struct efa_qp {
Expand Down
37 changes: 35 additions & 2 deletions providers/efa/efa_io_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define EFA_IO_TX_DESC_NUM_BUFS 2
#define EFA_IO_TX_DESC_NUM_RDMA_BUFS 1
#define EFA_IO_TX_DESC_INLINE_MAX_SIZE 32
#define EFA_IO_TX_DESC_INLINE_MAX_SIZE_128 80
#define EFA_IO_TX_DESC_IMM_DATA_SIZE 4

enum efa_io_queue_type {
Expand Down Expand Up @@ -164,9 +165,22 @@ struct efa_io_rdma_req {
struct efa_io_tx_buf_desc local_mem[1];
};

struct efa_io_rdma_req_128 {
/* Remote memory address */
struct efa_io_remote_mem_addr remote_mem;

union {
/* Local memory address */
struct efa_io_tx_buf_desc local_mem[1];

/* inline data for RDMA */
uint8_t inline_data[80];
};
};

/*
* Tx WQE, composed of tx meta descriptors followed by either tx buffer
* descriptors or inline data
* 64-byte Tx WQE, composed of tx meta descriptors followed by either tx
* buffer descriptors or inline data
*/
struct efa_io_tx_wqe {
/* TX meta */
Expand All @@ -183,6 +197,25 @@ struct efa_io_tx_wqe {
} data;
};

/*
* 128-byte Tx WQE, composed of tx meta descriptors followed by either tx
* buffer descriptors or inline data
*/
struct efa_io_tx_wqe_128 {
/* TX meta */
struct efa_io_tx_meta_desc meta;

union {
/* Send buffer descriptors */
struct efa_io_tx_buf_desc sgl[2];

uint8_t inline_data[80];

/* RDMA local and remote memory addresses */
struct efa_io_rdma_req_128 rdma_req;
} data;
};

/*
* Rx buffer descriptor; RX WQE is composed of one or more RX buffer
* descriptors.
Expand Down
28 changes: 26 additions & 2 deletions providers/efa/efadv.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
/*
* Copyright 2019-2025 Amazon.com, Inc. or its affiliates. All rights reserved.
* Copyright 2019-2026 Amazon.com, Inc. or its affiliates. All rights reserved.
*/

#ifndef __EFADV_H__
Expand Down Expand Up @@ -32,7 +32,7 @@ struct efadv_device_attr {
uint16_t max_sq_sge;
uint16_t max_rq_sge;
uint16_t inline_buf_size;
uint8_t reserved[2];
uint16_t inline_buf_size_ex;
uint32_t device_caps;
uint32_t max_rdma_size;
};
Expand All @@ -47,6 +47,29 @@ struct efadv_ah_attr {
uint8_t reserved[6];
};

enum {
EFADV_SQ_DEPTH_ATTR_INLINE_WRITE = 1 << 0,
};

struct efadv_sq_depth_attr {
uint64_t comp_mask;
uint32_t flags;
uint32_t max_send_sge;
uint32_t max_rdma_sge;
uint32_t max_inline_data;
};

int efadv_get_max_sq_depth(struct ibv_context *ibvctx, struct efadv_sq_depth_attr *attr,
uint32_t inlen);

struct efadv_rq_depth_attr {
uint64_t comp_mask;
uint32_t max_recv_sge;
};

int efadv_get_max_rq_depth(struct ibv_context *ibvctx, struct efadv_rq_depth_attr *attr,
uint32_t inlen);

int efadv_query_ah(struct ibv_ah *ibvah, struct efadv_ah_attr *attr,
uint32_t inlen);

Expand All @@ -61,6 +84,7 @@ struct ibv_qp *efadv_create_driver_qp(struct ibv_pd *ibvpd,

enum {
EFADV_QP_FLAGS_UNSOLICITED_WRITE_RECV = 1 << 0,
EFADV_QP_FLAGS_INLINE_WRITE = 1 << 1,
};

struct efadv_qp_init_attr {
Expand Down
6 changes: 6 additions & 0 deletions providers/efa/libefa.map
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ EFA_1.4 {
efadv_query_qp_wqs;
efadv_query_cq;
} EFA_1.3;

EFA_1.5 {
global:
efadv_get_max_sq_depth;
efadv_get_max_rq_depth;
} EFA_1.4;
3 changes: 3 additions & 0 deletions providers/efa/man/efadv_create_qp_ex.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,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.

EFADV_QP_FLAGS_INLINE_WRITE:
QP supports RDMA write with inline operations.

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

Expand Down
57 changes: 57 additions & 0 deletions providers/efa/man/efadv_get_rq_max_depth.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
layout: page
title: EFADV_GET_MAX_RQ_DEPTH
section: 3
tagline: Verbs
date: 2026-02-17
header: "EFA Direct Verbs Manual"
footer: efa
---

# NAME

efadv_get_max_rq_depth - Get EFA receive queue max depth based on receive queue attributes

# SYNOPSIS

```c
#include <infiniband/efadv.h>

int efadv_get_max_rq_depth(struct ibv_context *ibvctx, struct efadv_rq_depth_attr *attr,
uint32_t inlen);
```

# DESCRIPTION

**efadv_get_max_rq_depth()** get device-specific receive queue max depth based on RQ attributes.

Compatibility is handled using the comp_mask and inlen fields.

```c
struct efadv_rq_depth_attr {
uint64_t comp_mask;
uint32_t max_recv_sge;
};
```

*inlen*
: In: Size of struct efadv_rq_depth_attr.

*comp_mask*
: Compatibility mask.

*max_recv_sge*
: Requested max number of scatter/gather (s/g) elements in a WR in the receive queue.

# RETURN VALUE

**efadv_get_max_rq_depth()** returns max receive queue depth on success, or the negative value of errno on failure
(which indicates the failure reason).

# SEE ALSO

**efadv**(7)

# AUTHORS

Yonatan Nachum <ynachum@amazon.com>
72 changes: 72 additions & 0 deletions providers/efa/man/efadv_get_sq_max_depth.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
layout: page
title: EFADV_GET_MAX_SQ_DEPTH
section: 3
tagline: Verbs
date: 2026-02-17
header: "EFA Direct Verbs Manual"
footer: efa
---

# NAME

efadv_get_max_sq_depth - Get EFA send queue max depth based on send queue attributes

# SYNOPSIS

```c
#include <infiniband/efadv.h>

int efadv_get_max_sq_depth(struct ibv_context *ibvctx, struct efadv_sq_depth_attr *attr,
uint32_t inlen);
```

# DESCRIPTION

**efadv_get_max_sq_depth()** get device-specific send queue max depth based on SQ attributes.

Compatibility is handled using the comp_mask and inlen fields.

```c
struct efadv_sq_depth_attr {
uint64_t comp_mask;
uint32_t flags;
uint32_t max_send_sge;
uint32_t max_rdma_sge;
uint32_t max_inline_data;
};
```

*inlen*
: In: Size of struct efadv_sq_depth_attr.

*comp_mask*
: Compatibility mask.

*flags*
: A bitwise OR of the values described below.

EFADV_SQ_DEPTH_ATTR_INLINE_WRITE:
Inline RDMA write operation support is required.

*max_send_sge*
: Requested max number of scatter/gather (s/g) elements in a send WR in the send queue.

*max_rdma_sge*
: Requested max number of scatter/gather (s/g) elements in a RDMA WR in the send queue.

*max_inline_data*
: Requested max number of data (bytes) that can be posted inline to the send queue.

# RETURN VALUE

**efadv_get_max_sq_depth()** returns max send queue depth on success, or the negative value of errno on failure
(which indicates the failure reason).

# SEE ALSO

**efadv**(7)

# AUTHORS

Yonatan Nachum <ynachum@amazon.com>
Loading