Skip to content

Commit

Permalink
GTEST: added evaluation for supported *_SHORT iface caps
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Oblomov committed Jan 30, 2019
1 parent 5786c0c commit 3883b79
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/gtest/uct/ib/test_rc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class test_rc_max_wr : public test_rc {
/* Check that max_wr stops from sending */
UCS_TEST_P(test_rc_max_wr, send_limit)
{
check_caps(UCT_IFACE_FLAG_AM_SHORT);

/* first 32 messages should be OK */
send_am_messages(m_e1, 32, UCS_OK);

Expand Down Expand Up @@ -113,6 +115,8 @@ void test_rc_flow_control::validate_grant(entity *e)
void test_rc_flow_control::test_general(int wnd, int soft_thresh,
int hard_thresh, bool is_fc_enabled)
{
check_caps(UCT_IFACE_FLAG_AM_SHORT);

set_fc_attributes(m_e1, is_fc_enabled, wnd, soft_thresh, hard_thresh);

send_am_messages(m_e1, wnd, UCS_OK);
Expand All @@ -130,6 +134,8 @@ void test_rc_flow_control::test_general(int wnd, int soft_thresh,

void test_rc_flow_control::test_pending_grant(int wnd)
{
check_caps(UCT_IFACE_FLAG_AM_SHORT);

/* Block send capabilities of m_e2 for fc grant to be
* added to the pending queue. */
disable_entity(m_e2);
Expand All @@ -155,6 +161,8 @@ void test_rc_flow_control::test_pending_grant(int wnd)

void test_rc_flow_control::test_flush_fc_disabled()
{
check_caps(UCT_IFACE_FLAG_AM_SHORT);

set_fc_disabled(m_e1);
ucs_status_t status;

Expand All @@ -178,6 +186,8 @@ void test_rc_flow_control::test_pending_purge(int wnd, int num_pend_sends)
{
pending_send_request_t reqs[num_pend_sends];

check_caps(UCT_IFACE_FLAG_AM_SHORT);

disable_entity(m_e2);
set_fc_attributes(m_e1, true, wnd, wnd, 1);

Expand Down Expand Up @@ -215,6 +225,8 @@ UCS_TEST_P(test_rc_flow_control, pending_only_fc)
{
int wnd = 2;

check_caps(UCT_IFACE_FLAG_AM_SHORT);

disable_entity(m_e2);
set_fc_attributes(m_e1, true, wnd, wnd, 1);

Expand Down Expand Up @@ -251,6 +263,8 @@ void test_rc_flow_control_stats::test_general(int wnd, int soft_thresh,
{
uint64_t v;

check_caps(UCT_IFACE_FLAG_AM_SHORT);

set_fc_attributes(m_e1, true, wnd, soft_thresh, hard_thresh);

send_am_messages(m_e1, wnd, UCS_OK);
Expand Down Expand Up @@ -283,6 +297,8 @@ UCS_TEST_P(test_rc_flow_control_stats, soft_request)
int s_thresh = 4;
int h_thresh = 1;

check_caps(UCT_IFACE_FLAG_AM_SHORT);

set_fc_attributes(m_e1, true, wnd, s_thresh, h_thresh);
send_am_and_flush(m_e1, wnd - (s_thresh - 1));

Expand Down
40 changes: 40 additions & 0 deletions test/gtest/uct/ib/test_ud.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ uct_ud_psn_t test_ud::tx_ack_psn = 0;
UCS_TEST_P(test_ud, basic_tx) {
unsigned i, N=13;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

disable_async(m_e1);
disable_async(m_e2);
connect();
Expand All @@ -208,6 +210,8 @@ UCS_TEST_P(test_ud, basic_tx) {
UCS_TEST_P(test_ud, duplex_tx) {
unsigned i, N=5;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

disable_async(m_e1);
disable_async(m_e2);
connect();
Expand Down Expand Up @@ -240,6 +244,8 @@ UCS_TEST_P(test_ud, duplex_tx) {
UCS_TEST_P(test_ud, tx_window1) {
unsigned i, N=13;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

disable_async(m_e1);
disable_async(m_e2);
connect();
Expand All @@ -265,6 +271,8 @@ UCS_TEST_P(test_ud, tx_window1) {

UCS_TEST_P(test_ud, flush_ep) {

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

connect();
EXPECT_UCS_OK(tx(m_e1));
EXPECT_UCS_OK(ep_flush_b(m_e1));
Expand All @@ -274,6 +282,8 @@ UCS_TEST_P(test_ud, flush_ep) {

UCS_TEST_P(test_ud, flush_iface) {

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

connect();
EXPECT_UCS_OK(tx(m_e1));
EXPECT_UCS_OK(iface_flush_b(m_e1));
Expand All @@ -290,6 +300,8 @@ UCS_TEST_P(test_ud, flush_iface) {
UCS_TEST_P(test_ud, tx_window2) {
unsigned i, N=13;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

disable_async(m_e1);
disable_async(m_e2);
connect();
Expand All @@ -313,6 +325,8 @@ UCS_TEST_P(test_ud, tx_window2) {
*/
UCS_TEST_P(test_ud, ack_req_single) {

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

connect();
disable_async(m_e1);
disable_async(m_e2);
Expand All @@ -338,6 +352,8 @@ UCS_TEST_P(test_ud, ack_req_single) {
UCS_TEST_P(test_ud, ack_req_window) {
unsigned i, N=16;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

disable_async(m_e1);
disable_async(m_e2);
connect();
Expand All @@ -363,6 +379,8 @@ UCS_TEST_P(test_ud, ack_req_window) {

/* simulate retransmission of the CREQ packet */
UCS_TEST_P(test_ud, crep_drop1) {
check_caps(UCT_IFACE_FLAG_PUT_SHORT);

m_e1->connect_to_iface(0, *m_e2);
/* setup filter to drop crep */
ep(m_e1, 0)->rx.rx_hook = drop_ctl;
Expand All @@ -384,6 +402,8 @@ UCS_TEST_P(test_ud, crep_drop1) {
* both sides connect simultaniously.
*/
UCS_TEST_P(test_ud, crep_drop2) {
check_caps(UCT_IFACE_FLAG_PUT_SHORT);

connect_to_iface();

ep(m_e1)->rx.rx_hook = drop_ctl;
Expand Down Expand Up @@ -421,6 +441,8 @@ UCS_TEST_P(test_ud, crep_drop2) {
UCS_TEST_P(test_ud, crep_ack_drop) {
ucs_status_t status;

check_caps(UCT_IFACE_FLAG_AM_SHORT);

connect_to_iface();

/* drop ACK from CERQ/CREP */
Expand Down Expand Up @@ -484,6 +506,8 @@ UCS_TEST_P(test_ud, ca_ai) {
int prev_cwnd;
int max_window;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

/* check initial window */
disable_async(m_e1);
disable_async(m_e2);
Expand Down Expand Up @@ -532,6 +556,8 @@ UCS_TEST_P(test_ud, ca_md, "IB_TX_QUEUE_LEN=" UCS_PP_MAKE_STRING(UCT_UD_CA_MAX_W
int prev_cwnd, new_cwnd;
int i;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

if (RUNNING_ON_VALGRIND) {
/* skip valgrind for now */
UCS_TEST_SKIP_R("skipping on valgrind");
Expand Down Expand Up @@ -586,6 +612,8 @@ UCS_TEST_P(test_ud, ca_resend) {
int i;
ucs_status_t status;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

if (RUNNING_ON_VALGRIND) {
UCS_TEST_SKIP_R("skipping on valgrind");
}
Expand Down Expand Up @@ -633,6 +661,8 @@ UCS_TEST_P(test_ud, connect_iface_single_drop_creq) {
#endif

UCS_TEST_P(test_ud, connect_iface_single) {
check_caps(UCT_IFACE_FLAG_PUT_SHORT);

/* single connect */
m_e1->connect_to_iface(0, *m_e2);
short_progress_loop(TEST_UD_PROGRESS_TIMEOUT);
Expand Down Expand Up @@ -660,6 +690,8 @@ UCS_TEST_P(test_ud, connect_iface_2to1) {
}

UCS_TEST_P(test_ud, connect_iface_seq) {
check_caps(UCT_IFACE_FLAG_PUT_SHORT);

/* sequential connect from both sides */
m_e1->connect_to_iface(0, *m_e2);
validate_connect(ep(m_e1), 0U);
Expand Down Expand Up @@ -752,6 +784,8 @@ UCS_TEST_P(test_ud, ep_destroy_flush) {
ucs_status_t status;
uct_ud_ep_t *ud_ep1;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

connect();
EXPECT_UCS_OK(tx(m_e1));
short_progress_loop();
Expand All @@ -769,6 +803,8 @@ UCS_TEST_P(test_ud, ep_destroy_flush) {
}

UCS_TEST_P(test_ud, ep_destroy_passive) {
check_caps(UCT_IFACE_FLAG_PUT_SHORT);

connect();
uct_ep_destroy(m_e2->ep(0));
/* destroyed ep must still accept data */
Expand Down Expand Up @@ -839,6 +875,8 @@ UCS_TEST_P(test_ud, res_skb_tx) {
uct_ud_send_skb_t *skb;
int n, tx_count;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

disable_async(m_e1);
disable_async(m_e2);
connect();
Expand Down Expand Up @@ -887,6 +925,8 @@ UCS_TEST_P(test_ud, res_skb_tx) {
* Check: that both eps (m_e1 and m_e2) are connected finally */
UCS_TEST_P(test_ud, ctls_loss) {

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

iface(m_e2)->tx.available = 0;

connect_to_iface();
Expand Down
16 changes: 16 additions & 0 deletions test/gtest/uct/ib/test_ud_pending.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ UCS_TEST_P(test_ud_pending, async_progress) {
uct_pending_req_t r[N];
int i;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

req_count = 0;
connect();

Expand All @@ -115,6 +117,8 @@ UCS_TEST_P(test_ud_pending, sync_progress) {
uct_pending_req_t r[N];
int i;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

req_count = 0;
connect();

Expand All @@ -136,6 +140,8 @@ UCS_TEST_P(test_ud_pending, err_busy) {
uct_pending_req_t r[N];
int i;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

req_count = 0;
connect();

Expand All @@ -155,6 +161,8 @@ UCS_TEST_P(test_ud_pending, err_busy) {

UCS_TEST_P(test_ud_pending, connect)
{
check_caps(UCT_IFACE_FLAG_PUT_SHORT);

disable_async(m_e1);
disable_async(m_e2);
post_pending_reqs();
Expand All @@ -163,6 +171,8 @@ UCS_TEST_P(test_ud_pending, connect)

UCS_TEST_P(test_ud_pending, flush)
{
check_caps(UCT_IFACE_FLAG_PUT_SHORT);

disable_async(m_e1);
disable_async(m_e2);
post_pending_reqs();
Expand All @@ -174,6 +184,9 @@ UCS_TEST_P(test_ud_pending, window)
{
int i;
uct_pending_req_t r;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

req_count = 0;
me = this;
connect();
Expand All @@ -194,6 +207,9 @@ UCS_TEST_P(test_ud_pending, tx_wqe)
int i;
uct_pending_req_t r;
ucs_status_t status;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

req_count = 0;
me = this;
disable_async(m_e1);
Expand Down
13 changes: 13 additions & 0 deletions test/gtest/uct/ib/test_ud_slow_timer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ int test_ud_slow_timer::tick_count = 0;

/* single packet received without progress */
UCS_TEST_P(test_ud_slow_timer, tx1) {
check_caps(UCT_IFACE_FLAG_PUT_SHORT);

connect();
EXPECT_UCS_OK(tx(m_e1));
wait_for_rx_sn(1);
Expand All @@ -88,6 +90,9 @@ UCS_TEST_P(test_ud_slow_timer, tx1) {
/* multiple packets received without progress */
UCS_TEST_P(test_ud_slow_timer, txn) {
unsigned i, N=42;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

connect();
set_tx_win(m_e1, 1024);
for (i = 0; i < N; i++) {
Expand Down Expand Up @@ -125,6 +130,9 @@ UCS_TEST_P(test_ud_slow_timer, tick1) {

/* ticks while tx window is not empty */
UCS_TEST_P(test_ud_slow_timer, tick2) {

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

connect();
tick_count = 0;
ep(m_e1)->timer_hook = tick_counter;
Expand All @@ -136,6 +144,7 @@ UCS_TEST_P(test_ud_slow_timer, tick2) {
/* retransmit one packet */

UCS_TEST_P(test_ud_slow_timer, retransmit1) {
check_caps(UCT_IFACE_FLAG_PUT_SHORT);

connect();
ep(m_e2)->rx.rx_hook = drop_packet;
Expand All @@ -154,6 +163,8 @@ UCS_TEST_P(test_ud_slow_timer, retransmitn) {

unsigned i, N=42;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

connect();
set_tx_win(m_e1, 1024);
ep(m_e2)->rx.rx_hook = drop_packet;
Expand All @@ -175,6 +186,8 @@ UCS_TEST_P(test_ud_slow_timer, partial_drop) {
unsigned i, N=24;
int orig_avail;

check_caps(UCT_IFACE_FLAG_PUT_SHORT);

connect();
set_tx_win(m_e1, 1024);
packet_count = 0;
Expand Down

0 comments on commit 3883b79

Please sign in to comment.