diff --git a/README.md b/README.md index b13c91a..7f6009f 100644 --- a/README.md +++ b/README.md @@ -56,5 +56,5 @@ If this is the case the rdma-unit-tests must run as root. rdma-unit-test has been tested on the following adapters; * Mellonox ConnectX-3 * Mellonox ConnectX-4 - * SoftROCE (limited support_ + * SoftROCE (limited support) diff --git a/cases/cq_test.cc b/cases/cq_test.cc index 6f5468d..3dfa8e9 100644 --- a/cases/cq_test.cc +++ b/cases/cq_test.cc @@ -139,7 +139,7 @@ TEST_F(CqTest, LargeCompVector) { // TODO(author1): Test lookup/delete with a different kind of object. // TODO(author1): (likely in a different test) messing with comp vectors. -class CQAdvancedTest : public BasicFixture { +class CqAdvancedTest : public BasicFixture { protected: // Reserve the first byte (MSB(yte)) of the wr_id to represent the queue id. // X0000000 Queue Id @@ -385,7 +385,7 @@ class CQAdvancedTest : public BasicFixture { } }; -TEST_F(CQAdvancedTest, SendCqOverflow) { +TEST_F(CqAdvancedTest, SendCqOverflow) { if (Introspection().FullCqIdlesQp()) { GTEST_SKIP() << "This test assumes CQ overflow overwrites completions."; } @@ -404,7 +404,7 @@ TEST_F(CQAdvancedTest, SendCqOverflow) { ValidateCompletions(setup, completions); } -TEST_F(CQAdvancedTest, SendSharedCq) { +TEST_F(CqAdvancedTest, SendSharedCq) { ASSERT_OK_AND_ASSIGN(BasicSetup setup, CreateBasicSetup()); static constexpr int kQueueCount = 2; ASSERT_OK(CreateTestQps(setup, kQueueCount)); @@ -423,7 +423,7 @@ TEST_F(CQAdvancedTest, SendSharedCq) { } // 5 threads writing to the same shared completion queue. -TEST_F(CQAdvancedTest, SendSharedCqOverflow) { +TEST_F(CqAdvancedTest, SendSharedCqOverflow) { if (Introspection().FullCqIdlesQp()) { GTEST_SKIP() << "This test assumes CQ overflow overwrites completions."; } @@ -444,7 +444,7 @@ TEST_F(CQAdvancedTest, SendSharedCqOverflow) { ValidateCompletions(setup, completions); } -TEST_F(CQAdvancedTest, RecvCqOverflow) { +TEST_F(CqAdvancedTest, RecvCqOverflow) { if (Introspection().FullCqIdlesQp()) { GTEST_SKIP() << "This test assumes CQ overflow overwrites completions."; } @@ -467,7 +467,7 @@ TEST_F(CQAdvancedTest, RecvCqOverflow) { } // 2 CQs posting recv completions to a single completion queue. -TEST_F(CQAdvancedTest, RecvSharedCq) { +TEST_F(CqAdvancedTest, RecvSharedCq) { if (!Introspection().SupportsMultipleOutstandingRecvRequests()) GTEST_SKIP(); ASSERT_OK_AND_ASSIGN(BasicSetup setup, CreateBasicSetup()); static constexpr int kQueueCount = 2; @@ -492,7 +492,7 @@ TEST_F(CQAdvancedTest, RecvSharedCq) { ValidateCompletions(setup, completions); } -TEST_F(CQAdvancedTest, RecvSharedCqOverflow) { +TEST_F(CqAdvancedTest, RecvSharedCqOverflow) { if (Introspection().FullCqIdlesQp()) { GTEST_SKIP() << "This test assumes CQ overflow overwrites completions."; } diff --git a/cases/loopback_test.cc b/cases/loopback_test.cc index 59ea487..9d7e9b7 100644 --- a/cases/loopback_test.cc +++ b/cases/loopback_test.cc @@ -1314,7 +1314,8 @@ TEST_F(LoopbackRcQpTest, FetchAddSmallSge) { ibv_wc completion = verbs_util::WaitForCompletion(local.cq).value(); EXPECT_EQ(local.qp->qp_num, completion.qp_num); EXPECT_EQ(1, completion.wr_id); - EXPECT_EQ(IBV_WC_LOC_LEN_ERR, completion.status); + EXPECT_THAT(completion.status, + testing::AnyOf(IBV_WC_LOC_LEN_ERR, IBV_WC_REM_ACCESS_ERR)); } TEST_F(LoopbackRcQpTest, FetchAddLargeSge) { @@ -1331,13 +1332,16 @@ TEST_F(LoopbackRcQpTest, FetchAddLargeSge) { ibv_wc completion = verbs_util::WaitForCompletion(local.cq).value(); EXPECT_EQ(local.qp->qp_num, completion.qp_num); EXPECT_EQ(1, completion.wr_id); - EXPECT_EQ(IBV_WC_LOC_LEN_ERR, completion.status); + EXPECT_THAT(completion.status, + testing::AnyOf(IBV_WC_LOC_LEN_ERR, IBV_WC_REM_ACCESS_ERR)); } TEST_F(LoopbackRcQpTest, FetchAddSplitSgl) { auto client_pair_or = CreateConnectedClientsPair(); ASSERT_OK(client_pair_or); auto [local, remote] = client_pair_or.value(); + InitializeAtomicBuffer(local, /*content=*/1); + InitializeAtomicBuffer(remote, /*content=*/2); // The local SGE will be used to store the value before the update. ibv_sge sge = verbs_util::CreateSge(local.atomic_buffer, local.mr); ibv_sge sgl[2]; @@ -1350,11 +1354,16 @@ TEST_F(LoopbackRcQpTest, FetchAddSplitSgl) { ibv_send_wr fetch_add = verbs_util::CreateFetchAddWr( /*wr_id=*/1, sgl, /*num_sge=*/2, remote.atomic_buffer.data(), remote.mr->rkey, 0); - verbs_util::PostSend(local.qp, fetch_add); + ibv_send_wr* bad_wr = nullptr; + int result = + ibv_post_send(local.qp, const_cast(&fetch_add), &bad_wr); + // Some adpaters do not allow 2 SG entries + // TODO(author1): setup buffers/adder with interesting values and check. + if (result) return; ibv_wc completion = verbs_util::WaitForCompletion(local.cq).value(); EXPECT_EQ(local.qp->qp_num, completion.qp_num); EXPECT_EQ(1, completion.wr_id); - EXPECT_EQ(IBV_WC_REM_ACCESS_ERR, completion.status); + EXPECT_EQ(IBV_WC_SUCCESS, completion.status); } TEST_F(LoopbackRcQpTest, UnsignaledFetchAdd) { diff --git a/impl/introspection_mlx5.h b/impl/introspection_mlx5.h index 8fb0094..b86f925 100644 --- a/impl/introspection_mlx5.h +++ b/impl/introspection_mlx5.h @@ -31,7 +31,7 @@ class IntrospectionMlx5 : public NicIntrospection { bool SupportsRcRemoteMwAtomic() const { return false; } - // CQAdvancedTest::RecvSharedCq failure with multiple outstanding recv + // CqAdvancedTest::RecvSharedCq failure with multiple outstanding recv // requests. Completions are returned but no data transferred which results // in the WaitingForChange to fail. // TODO(author1): determine if there is a test issue. @@ -57,7 +57,7 @@ class IntrospectionMlx5 : public NicIntrospection { explicit IntrospectionMlx5(const ibv_device_attr& attr) : NicIntrospection(attr) { // ibv_queury_device incorrectly reports max_qp_wr as 32768. - // Unable to create RC qp above 8192, and U qp above 16384 + // Unable to create RC qp above 8192, and UD qp above 16384 attr_.max_qp_wr = 8192; // ibv_query_device may report the incorrect capabilities for some cards. // Override result when checking for Type2 support. diff --git a/public/introspection.h b/public/introspection.h index 67c3989..aa6cfa8 100644 --- a/public/introspection.h +++ b/public/introspection.h @@ -90,7 +90,7 @@ class NicIntrospection { // Returns true if NIC robustly handles memory region errors. virtual bool CorrectlyReportsMemoryRegionErrors() const { return true; } - // Returns true if NIC robustly handles memory window errorsc. + // Returns true if NIC robustly handles memory window errors. virtual bool CorrectlyReportsMemoryWindowErrors() const { return true; } // Reports true if NIC robustly handles invalid remote key on self connected