File tree Expand file tree Collapse file tree 3 files changed +31
-4
lines changed Expand file tree Collapse file tree 3 files changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ endif BUILD_EFA_RDMA_CHECKER
4242endif HAVE_VERBS_DEVEL
4343
4444efa_rnr_srcs = \
45+ prov/efa/src/efa_shared.h \
4546 prov/efa/src/efa_rnr_shared.h \
4647 prov/efa/src/efa_rnr_shared.c
4748
Original file line number Diff line number Diff line change 1+ /* SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0-only */
2+ /* SPDX-FileCopyrightText: Copyright Amazon.com, Inc. or its affiliates. All
3+ * rights reserved. */
4+
5+ #ifndef _EFA_SHARED_H
6+ #define _EFA_SHARED_H
7+
8+ #define EFA_FABRIC_NAME "efa"
9+ #define EFA_DIRECT_FABRIC_NAME "efa-direct"
10+
11+ #define EFA_INFO_TYPE_IS_RDM (_info ) \
12+ (_info && _info->ep_attr && (_info->ep_attr->type == FI_EP_RDM) && \
13+ !strcasecmp(_info->fabric_attr->name, EFA_FABRIC_NAME))
14+
15+ #define EFA_INFO_TYPE_IS_DIRECT (_info ) \
16+ (_info && _info->ep_attr && (_info->ep_attr->type == FI_EP_RDM) && \
17+ !strcasecmp(_info->fabric_attr->name, EFA_DIRECT_FABRIC_NAME))
18+
19+ #endif /* _EFA_SHARED_H */
Original file line number Diff line number Diff line change 3636#include <getopt.h>
3737
3838#include <shared.h>
39+ #include "efa_shared.h"
3940#include "efa_rnr_shared.h"
4041
4142
@@ -48,11 +49,17 @@ static int rnr_read_cq_error(void)
4849 rnr_flag = 0 ;
4950 /*
5051 * In order for the sender to get RNR error, we need to first consume
51- * all pre-posted receive buffer (in efa provider, fi->rx_attr->size
52- * receiving buffer are pre-posted) on the receiver side, the subsequent
53- * sends (expected_rnr_error) will then get RNR errors.
52+ * all pre-posted receive buffer.
53+ * For efa-rdm, it pre-posted fi->rx_attr->size receive buffers during 1st cq read
54+ * For efa-direct, it posted whatever application posts. ft_enable_ep_recv already
55+ * posts 1.
5456 */
55- total_send = fi -> rx_attr -> size + expected_rnr_error ;
57+ if (EFA_INFO_TYPE_IS_RDM (fi )) {
58+ total_send = fi -> rx_attr -> size + expected_rnr_error ;
59+ } else {
60+ assert (EFA_INFO_TYPE_IS_DIRECT (fi ));
61+ total_send = expected_rnr_error + 1 ;
62+ }
5663
5764 for (i = 0 ; i < total_send ; i ++ ) {
5865 do {
You can’t perform that action at this time.
0 commit comments