Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 368009570
  • Loading branch information
RDMA authored and swoloschek-goog committed Apr 12, 2021
1 parent 3a27bfd commit b902f0d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

14 changes: 7 additions & 7 deletions cases/cq_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.";
}
Expand All @@ -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));
Expand All @@ -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.";
}
Expand All @@ -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.";
}
Expand All @@ -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;
Expand All @@ -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.";
}
Expand Down
17 changes: 13 additions & 4 deletions cases/loopback_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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];
Expand All @@ -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<ibv_send_wr*>(&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) {
Expand Down
4 changes: 2 additions & 2 deletions impl/introspection_mlx5.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion public/introspection.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b902f0d

Please sign in to comment.