@@ -145,10 +145,12 @@ UCS_TEST_SKIP_COND_P(test_rc_max_wr, send_limit,
145145UCT_INSTANTIATE_RC_TEST_CASE (test_rc_max_wr)
146146
147147
148- class test_rc_iface_address : public uct_test {
148+ class test_rc_iface_flush_remote : public uct_test {
149149protected:
150- entity *m_entity;
150+ entity *m_e1;
151+ entity *m_e2;
151152 entity *m_entity_flush_rkey;
153+ int m_err_count;
152154
153155public:
154156 int rc_iface_flush_rkey_enabled (entity *e)
@@ -164,29 +166,43 @@ class test_rc_iface_address : public uct_test {
164166 return uct_ib_md_get_atomic_mr_id (md);
165167 }
166168
167- static uct_iface_params_t iface_params ()
169+ uct_iface_params_t iface_params ()
168170 {
169171 uct_iface_params_t params = {};
170172
171- params.field_mask |= UCT_IFACE_PARAM_FIELD_OPEN_MODE;
172- params.field_mask |= UCT_IFACE_PARAM_FIELD_FEATURES;
173+ params.field_mask = UCT_IFACE_PARAM_FIELD_ERR_HANDLER |
174+ UCT_IFACE_PARAM_FIELD_ERR_HANDLER_ARG |
175+ UCT_IFACE_PARAM_FIELD_OPEN_MODE |
176+ UCT_IFACE_PARAM_FIELD_FEATURES;
177+ params.open_mode = UCT_IFACE_OPEN_MODE_DEVICE;
178+ params.err_handler_arg = &m_err_count,
179+ params.err_handler =
180+ [](void *arg, uct_ep_h ep, ucs_status_t status) {
181+ (*reinterpret_cast <int *>(arg))++;
182+ return UCS_OK;
183+ };
184+ params.features = UCT_IFACE_FEATURE_PUT;
173185
174- params.features = UCT_IFACE_FEATURE_PUT;
175- params.open_mode = UCT_IFACE_OPEN_MODE_DEVICE;
176186 return params;
177187 }
178188
179189 void init ()
180190 {
181191 uct_test::init ();
182192
193+ m_err_count = 0 ;
183194 uct_iface_params_t params = iface_params ();
184- m_entity = uct_test::create_entity (params);
195+ m_e1 = uct_test::create_entity (params);
196+ params = iface_params ();
197+ m_e2 = uct_test::create_entity (params);
198+ m_e1->connect (0 , *m_e2, 0 );
199+ m_e2->connect (0 , *m_e1, 0 );
185200
186201 params.features |= UCT_IFACE_FEATURE_FLUSH_REMOTE;
187202 m_entity_flush_rkey = uct_test::create_entity (params);
188203
189- m_entities.push_back (m_entity);
204+ m_entities.push_back (m_e1);
205+ m_entities.push_back (m_e2);
190206 m_entities.push_back (m_entity_flush_rkey);
191207 }
192208
@@ -202,18 +218,18 @@ class test_rc_iface_address : public uct_test {
202218 }
203219};
204220
205- UCS_TEST_P (test_rc_iface_address , size_no_flush_remote)
221+ UCS_TEST_P (test_rc_iface_flush_remote , size_no_flush_remote)
206222{
207223 map_size_t sizes = {
208224 {" rc_mlx5" , {7 , 1 }},
209225 {" dc_mlx5" , {0 , 5 }},
210- {" rc_verbs" , {4 , 0 }},
226+ {" rc_verbs" , {7 , 0 }},
211227 {" gga_mlx5" , {7 , 8 }},
212228 };
213- check_sizes (m_entity , sizes);
229+ check_sizes (m_e1 , sizes);
214230}
215231
216- UCS_TEST_P (test_rc_iface_address , size_flush_remote)
232+ UCS_TEST_P (test_rc_iface_flush_remote , size_flush_remote)
217233{
218234 int flush_rkey_enabled = rc_iface_flush_rkey_enabled (m_entity_flush_rkey);
219235 int mr_id = rc_iface_mr_id (m_entity_flush_rkey);
@@ -226,7 +242,31 @@ UCS_TEST_P(test_rc_iface_address, size_flush_remote)
226242 check_sizes (m_entity_flush_rkey, sizes);
227243}
228244
229- UCT_INSTANTIATE_RC_DC_GGA_TEST_CASE (test_rc_iface_address)
245+ UCS_TEST_SKIP_COND_P (test_rc_iface_flush_remote, put_fence_no_flush_remote,
246+ !check_caps(UCT_IFACE_FLAG_PUT_ZCOPY),
247+ "IB_PCI_RELAXED_ORDERING?=try")
248+ {
249+ mapped_buffer sendbuf (64 , 0ul , *m_e1);
250+ mapped_buffer recvbuf (64 , 0ul , *m_e2);
251+ UCS_TEST_GET_BUFFER_IOV (iov, iovcnt, sendbuf.ptr (), 64 , sendbuf.memh (),
252+ 1 );
253+
254+ uct_completion_t comp;
255+ comp.func = [](uct_completion_t *) {};
256+ comp.count = 1 ;
257+ comp.status = UCS_OK;
258+
259+ // Trigger the use of atomic key, PUT fails with invalid atomic_mr_offset
260+ ASSERT_UCS_OK (uct_ep_fence (m_e1->ep (0 ), 0 ));
261+ EXPECT_EQ (UCS_INPROGRESS,
262+ uct_ep_put_zcopy (m_e1->ep (0 ), iov, iovcnt, recvbuf.addr (),
263+ recvbuf.rkey (), &comp));
264+ wait_for_value (&comp.count , 0 , true );
265+ EXPECT_EQ (0 , comp.count );
266+ EXPECT_EQ (0 , m_err_count);
267+ }
268+
269+ UCT_INSTANTIATE_RC_DC_GGA_TEST_CASE (test_rc_iface_flush_remote)
230270
231271
232272class test_rc_get_limit : public test_rc {
0 commit comments