Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prov/efa: Handle receive window overflow #10194

Merged
merged 1 commit into from
Jul 26, 2024
Merged

Conversation

jiaxiyan
Copy link
Contributor

When receiving an out-of-order message that exceeds the current receive window, instead of a hard fail, store this packet entry in a double linked list. After finishing processing a window size multiple of packet entries, iterate through the linked list.
Put the packet entry back to the circular queue if it can fit within the receive window now, and remove it from the linked list. If using the multi-req protocol and a packet entry with the same msg_id already exists in the receive window, append this packet entry to the existing packet entry.

@jiaxiyan jiaxiyan marked this pull request as draft July 18, 2024 23:43
@jiaxiyan jiaxiyan requested a review from a team July 19, 2024 00:17
@jiaxiyan jiaxiyan marked this pull request as ready for review July 19, 2024 00:18
@shijin-aws
Copy link
Contributor

@jiaxiyan it's the convention to have change and unit test in the same commit

prov/efa/src/rdm/efa_rdm_peer.c Outdated Show resolved Hide resolved
}

overflow_pke_list_entry->pkt_entry = pkt_entry;
dlist_insert_head(&overflow_pke_list_entry->entry, &peer->overflow_pke_list);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any preference on insert head or tail here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No preference since we do not care about the ordering of this linked list.

prov/efa/src/rdm/efa_rdm_peer.c Outdated Show resolved Hide resolved
prov/efa/src/rdm/efa_rdm_peer.c Show resolved Hide resolved
prov/efa/src/rdm/efa_rdm_peer.c Show resolved Hide resolved
prov/efa/test/efa_unit_test_rdm_peer.c Outdated Show resolved Hide resolved
prov/efa/test/efa_unit_test_rdm_peer.c Outdated Show resolved Hide resolved
prov/efa/test/efa_unit_test_rdm_peer.c Outdated Show resolved Hide resolved
prov/efa/test/efa_unit_test_rdm_peer.c Outdated Show resolved Hide resolved
/* Message id that overflows the receive window should be put in the
* overflow_pke_list and return 1 */
test_efa_rdm_peer_reorder_msg_impl(resource, exp_msg_id, msg_id, expected_ret);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have more unit tests to cover

  1. moving entry from overflow to recv window
  2. two pkt entries of same msg id will be appended to the same entry.

@jiaxiyan jiaxiyan force-pushed the recvwin branch 2 times, most recently from 4ee0395 to 4b024e7 Compare July 24, 2024 22:30

pkt_entry1 = *ofi_recvwin_get_msg((&peer->robuf), 17000);
assert_non_null(pkt_entry1);
assert_non_null(pkt_entry1->next);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to have an assert that pkt_entry1->next == pkt_entry2

@jiaxiyan jiaxiyan force-pushed the recvwin branch 2 times, most recently from b550d95 to 74d45dc Compare July 25, 2024 17:20
Store out-of-order packet entries that overflow the receive window
in a double linked list. After processing a window size of packet
entries, move the packet entries in the linked list back to the
receive window if they can fit in the window now.

Signed-off-by: Jessie Yang <[email protected]>
@shijin-aws shijin-aws merged commit be2d9f0 into ofiwg:main Jul 26, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants