prov/efa: emulated write Rma protocols refactor - #12843
charlesstoll wants to merge 5 commits into
Conversation
a054004 to
63e5433
Compare
|
|
||
| if (selected_proto->can_use_protocol( | ||
| txe, req_pkt_type, header_flags, iface)) { | ||
| txe, req_pkt_type, header_flags, iface, false)) { |
There was a problem hiding this comment.
It's ok for now but this shouldn't always be set to false. See the logic here
libfabric/prov/efa/src/rdm/efa_rdm_msg.c
Lines 197 to 201 in 3799050
I'm implementing it when I add the read based protocols
There was a problem hiding this comment.
fixed this so it doesn't hardcode false
| * do not need it. | ||
| */ | ||
| if (use_p2p && | ||
| txe->total_len >= g_efa_hmem_info[iface].min_read_write_size && |
There was a problem hiding this comment.
Should this also be gated behind a wants_mr or needs_mr field?
You could also skip this for now/fix it later because the eager protocol will never register anyway
| * @param[in,out] pkt_entry received EFA_RDM_EAGER_RTW packet | ||
| * | ||
| */ | ||
| void efa_rdm_pke_handle_eager_rtw_recv(struct efa_rdm_pke *pkt_entry) |
There was a problem hiding this comment.
Can we rename the prefixes? e.g. efa_rdm_proto_handle_eager_rtw_recv_completion?
| * negative libfabric error code on error. | ||
| */ | ||
| static inline | ||
| ssize_t efa_rdm_pke_init_rtw_common(struct efa_rdm_pke *pkt_entry, |
There was a problem hiding this comment.
Can you move this function to prov/efa/src/rdm/protocols as well and make it static inline? Not worth a function call just to set a few fields
You could make a new header efa_rdm_proto_write.h
| ep->efa_rnr_queued_pkt_cnt > | ||
| 0); | ||
|
|
||
| pkt_entry = efa_rdm_pke_alloc(ep, ep->efa_tx_pkt_pool, |
There was a problem hiding this comment.
This is now commonized in my PR. I can replace it with the common code.
There was a problem hiding this comment.
sounds good. if yours goes in first though, then I'll make sure to commonize when I rebase
| */ | ||
| *pke_send_flags = (txe->fi_flags & FI_MORE) ? FI_MORE : 0; | ||
|
|
||
| assert(ep->efa_max_outstanding_tx_ops - ep->efa_outstanding_tx_ops - |
There was a problem hiding this comment.
I think we should return -FI_EAGAIN instead of asserting when TX credits are exhausted.
There was a problem hiding this comment.
Checking for TX credits should happen in the earlier function
libfabric/prov/efa/src/rdm/efa_rdm_msg.c
Lines 253 to 258 in 3a7bdae
So an assert here should work
There was a problem hiding this comment.
added the assert back, added a credit check in the previous function.
| for (i = 0; efa_rdm_emulated_write_protocols[i] != NULL; ++i) { | ||
| selected_proto = efa_rdm_emulated_write_protocols[i]; | ||
|
|
||
| req_pkt_type = efa_rdm_proto_req_pkt_type( |
There was a problem hiding this comment.
The type helper efa_rdm_proto_req_pkt_type forces a non-DC packet whenever FI_INJECT is present, even if FI_DELIVERY_COMPLETE is also requested.
There was a problem hiding this comment.
good catch. fixed it in my patch and fixed the common send code as well in a new patch (still this pr).
There was a problem hiding this comment.
I don't think FI_INJECT + FI_DELIVERY_COMPLETE is a valid combination. FI_DELIVERY_COMPLETE necessarily requires the buffer to be available for retransmits. It can be implemented with a copy but that defeats the point of FI_INJECT - which is to send the data as quickly as possible.
There was a problem hiding this comment.
fixed... again :)
363953f to
0cbe348
Compare
|
bot:aws:retest |
0cbe348 to
1917721
Compare
| * 0 on success. | ||
| * negative libfabric error code on failure | ||
| */ | ||
| static ssize_t efa_rdm_proto_eager_write_init_dc_rtw(struct efa_rdm_pke *pkt_entry, |
There was a problem hiding this comment.
nit: would it be easier to follow if the TX and RX functions were put together? Right now, the order is
efa_rdm_proto_eager_write_init_rtw
efa_rdm_pke_handle_eager_rtw_send_completion
efa_rdm_proto_eager_write_proc_rtw
efa_rdm_proto_eager_write_handle_rtw_recv
efa_rdm_proto_eager_write_init_dc_rtw
efa_rdm_proto_eager_write_handle_dc_rtw_recv
How about
/* TX path functions */
efa_rdm_proto_eager_write_init_rtw
efa_rdm_proto_eager_write_init_dc_rtw
efa_rdm_pke_handle_eager_rtw_send_completion
/* RX path functions */
efa_rdm_proto_eager_write_proc_rtw
efa_rdm_proto_eager_write_handle_rtw_recv
efa_rdm_proto_eager_write_handle_dc_rtw_recv
A behavior-preserving cleanup ahead of routing emulated writes through the protocol interface. Rename the efa_rdm_proto callback can_use_protocol_for_send to can_use_protocol. The same callback is used by both the send and the emulated write paths, so the send-specific name is misleading. Signed-off-by: Charles Stoll <stollcha@amazon.com>
1917721 to
45a81cf
Compare
Add the write engine on the efa_rdm_proto interface. The main differences from send is that the write engine must first check if the device is write capable and use that, if possible. Modifies the protocol selection API to pass in use_p2p since this is relevant to the write protocols. No write protocol is registered yet, so selection always returns none and every write falls through to the existing selection. Signed-off-by: Charles Stoll <stollcha@amazon.com> (cherry picked from commit 925bf12)
Implement the emulated eager write protocol on the efa_rdm_proto interface and register it in the emulated write protocol list. Signed-off-by: Charles Stoll <stollcha@amazon.com> (cherry picked from commit 92984d4)
Move the shared RTW payload helper into a static inline in protocols/efa_rdm_proto_write.h so the eager write protocol and the LONGCTS RTW path share it without exporting it from the pke layer, and rename it to efa_rdm_proto_write_rtw_pke_init_common to match the protocol interface naming. Signed-off-by: Charles Stoll <stollcha@amazon.com>
Group the eager write helpers into TX and RX path sections. No functional change. Signed-off-by: Charles Stoll <stollcha@amazon.com>
45a81cf to
d9dc024
Compare
This patch series contains: