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

Add RDMA write support to EFA provider #1317

Merged
merged 3 commits into from
May 4, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions kernel-headers/rdma/efa-abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ enum {
EFA_QUERY_DEVICE_CAPS_CQ_NOTIFICATIONS = 1 << 2,
EFA_QUERY_DEVICE_CAPS_CQ_WITH_SGID = 1 << 3,
EFA_QUERY_DEVICE_CAPS_DATA_POLLING_128 = 1 << 4,
EFA_QUERY_DEVICE_CAPS_RDMA_WRITE = 1 << 5,
};

struct efa_ibv_ex_query_device_resp {
Expand Down
42 changes: 29 additions & 13 deletions providers/efa/efa_io_defs.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 2018-2022 Amazon.com, Inc. or its affiliates. All rights reserved.
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All rights reserved.
*/

#ifndef _EFA_IO_H_
Expand All @@ -23,6 +23,8 @@ enum efa_io_send_op_type {
EFA_IO_SEND = 0,
/* RDMA read */
EFA_IO_RDMA_READ = 1,
/* RDMA write */
EFA_IO_RDMA_WRITE = 2,
};

enum efa_io_comp_status {
Expand Down Expand Up @@ -62,8 +64,7 @@ struct efa_io_tx_meta_desc {

/*
* control flags
* 3:0 : op_type - operation type: send/rdma/fast mem
* ops/etc
* 3:0 : op_type - enum efa_io_send_op_type
* 4 : has_imm - immediate_data field carries valid
* data.
* 5 : inline_msg - inline mode - inline message data
Expand Down Expand Up @@ -219,28 +220,32 @@ struct efa_io_cdesc_common {
* 2:1 : q_type - enum efa_io_queue_type: send/recv
* 3 : has_imm - indicates that immediate data is
* present - for RX completions only
* 7:4 : reserved28 - MBZ
* 6:4 : op_type - enum efa_io_send_op_type
* 7 : reserved31 - MBZ
*/
uint8_t flags;

/* local QP number */
uint16_t qp_num;

/* Transferred length */
uint16_t length;
};

/* Tx completion descriptor */
struct efa_io_tx_cdesc {
/* Common completion info */
struct efa_io_cdesc_common common;

/* MBZ */
uint16_t reserved16;
};

/* Rx Completion Descriptor */
struct efa_io_rx_cdesc {
/* Common completion info */
struct efa_io_cdesc_common common;

/* Transferred length bits[15:0] */
uint16_t length;

/* Remote Address Handle FW index, 0xFFFF indicates invalid ah */
uint16_t ah;

Expand All @@ -250,16 +255,26 @@ struct efa_io_rx_cdesc {
uint32_t imm;
};

/* Rx Completion Descriptor RDMA write info */
struct efa_io_rx_cdesc_rdma_write {
/* Transferred length bits[31:16] */
uint16_t length_hi;
};

/* Extended Rx Completion Descriptor */
struct efa_io_rx_cdesc_ex {
/* Base RX completion info */
struct efa_io_rx_cdesc rx_cdesc_base;
struct efa_io_rx_cdesc base;

/*
* Valid only in case of unknown AH (0xFFFF) and CQ set_src_addr is
* enabled.
*/
uint8_t src_addr[16];
union {
struct efa_io_rx_cdesc_rdma_write rdma_write;

/*
* Valid only in case of unknown AH (0xFFFF) and CQ
* set_src_addr is enabled.
*/
uint8_t src_addr[16];
} u;
};

/* tx_meta_desc */
Expand All @@ -285,5 +300,6 @@ struct efa_io_rx_cdesc_ex {
#define EFA_IO_CDESC_COMMON_PHASE_MASK BIT(0)
#define EFA_IO_CDESC_COMMON_Q_TYPE_MASK GENMASK(2, 1)
#define EFA_IO_CDESC_COMMON_HAS_IMM_MASK BIT(3)
#define EFA_IO_CDESC_COMMON_OP_TYPE_MASK GENMASK(6, 4)

#endif /* _EFA_IO_H_ */
3 changes: 2 additions & 1 deletion 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-2022 Amazon.com, Inc. or its affiliates. All rights reserved.
* Copyright 2019-2023 Amazon.com, Inc. or its affiliates. All rights reserved.
*/

#ifndef __EFADV_H__
Expand Down Expand Up @@ -39,6 +39,7 @@ enum {
EFADV_DEVICE_ATTR_CAPS_RDMA_READ = 1 << 0,
EFADV_DEVICE_ATTR_CAPS_RNR_RETRY = 1 << 1,
EFADV_DEVICE_ATTR_CAPS_CQ_WITH_SGID = 1 << 2,
EFADV_DEVICE_ATTR_CAPS_RDMA_WRITE = 1 << 3,
};

struct efadv_device_attr {
Expand Down
3 changes: 3 additions & 0 deletions providers/efa/man/efadv_query_device.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ struct efadv_device_attr {
Reading source address (SGID) from receive completion descriptors is supported.
Valid only for unknown AH.

EFADV_DEVICE_ATTR_CAPS_RDMA_WRITE:
RDMA write is supported

*max_rdma_size*
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this apply to both RDMA read and write now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey,
No this does not apply for RDMA read. For RDMA read you must get also EFADV_DEVICE_ATTR_CAPS_RDMA_READ to know it is supported.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm referring to max_rdma_size.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, sorry.
Yes, the max RDMA size is identical for read and write.

: Maximum RDMA transfer size in bytes.

Expand Down