prov/efa: Minor changes necessary for the protocol path refactor#12010
prov/efa: Minor changes necessary for the protocol path refactor#12010sunkuamzn wants to merge 4 commits intoofiwg:mainfrom
Conversation
a486551 to
76b9f74
Compare
| /* Work arrays for efa_rdm_ope_post_send to avoid stack allocation */ | ||
| struct efa_rdm_pke **send_pkt_entry_vec; | ||
| int *send_pkt_entry_size_vec; | ||
| int *send_pkt_entry_data_sizes; |
There was a problem hiding this comment.
should it not be rename send_pkt_entry_vec?
| { | ||
| ssize_t err; | ||
| int rtm_type, use_p2p; | ||
|
|
There was a problem hiding this comment.
please use zero copy in the commit message. also the commit message should explain the dependency
ebd47a2 to
afaf415
Compare
The pkt entries are stored in send_pkt_entry_vec, so the size should also be stored in the endpoint Also rename send_pkt_entry_size_vec to send_pkt_entry_data_sizes to avoid confusion between the two members Signed-off-by: Sai Sunku <sunkusa@amazon.com>
If the send queue is full, no point creating txe and pkes Signed-off-by: Sai Sunku <sunkusa@amazon.com>
afaf415 to
88ed8af
Compare
Remove the efa_rdm_ep_alloc_txe helper and inline its logic at each call site. The function combined pool allocation, TXE construction, tagged field setup, and list insertion in a way that made it difficult to separate allocation from initialization for the new protocol interface. Move the dlist_insert_tail for ep->txe_list into efa_rdm_txe_construct so that all callers get consistent list management without duplicating the insertion call. Signed-off-by: Sai Sunku <sunkusa@amazon.com>
Move efa_rdm_ep_get_memory_alignment from efa_rdm_ep_utils.c to efa_rdm_ep.h as a static inline function. The function is small and called in the packet construction hot path, so inlining avoids function call overhead. Also move the EFA_RDM_*_ALIGNMENT constant definitions from efa.h to efa_rdm_ep.h to keep them co-located with the function that uses them. Signed-off-by: Sai Sunku <sunkusa@amazon.com>
88ed8af to
7d9e360
Compare
| @@ -195,7 +195,8 @@ struct efa_rdm_ep { | |||
| struct efa_rdm_pke **pke_vec; | |||
| /* Work arrays for efa_rdm_ope_post_send to avoid stack allocation */ | |||
| struct efa_rdm_pke **send_pkt_entry_vec; | |||
There was a problem hiding this comment.
Will it be cleaner if we create a send_pkt_entry struct to wrap these 3 together?
| /* Work arrays for efa_rdm_ope_post_send to avoid stack allocation */ | ||
| struct efa_rdm_pke **send_pkt_entry_vec; | ||
| int *send_pkt_entry_size_vec; | ||
| size_t *send_pkt_entry_data_sizes; |
There was a problem hiding this comment.
nit: if they're not bundled together, maybe name it send_pkt_entry_vec_data/payload_sizes
| ssize_t err; | ||
| struct efa_rdm_ope *txe; | ||
| struct efa_rdm_peer *peer; | ||
| int available_tx_pkts; |
There was a problem hiding this comment.
unsigned or add an assert that it's >0?
| if (!txe) | ||
| return NULL; | ||
|
|
||
| efa_rdm_txe_construct(txe, efa_rdm_ep, peer, &msg, op, 0); |
There was a problem hiding this comment.
should we not check for ofi_op_tagged here?
| /* | ||
| * The default memory alignment | ||
| */ | ||
| #define EFA_RDM_DEFAULT_MEMORY_ALIGNMENT (8) |
There was a problem hiding this comment.
if these are place in this header and are endpoint specific values, they should be prefixed with EFA_RDM_EP_
| struct efa_rdm_pke **send_pkt_entry_vec; | ||
| int *send_pkt_entry_size_vec; | ||
| size_t *send_pkt_entry_data_sizes; | ||
| size_t send_pkt_entry_vec_size; |
There was a problem hiding this comment.
I thought we need a new member in ep only when
- The member needs a persistent allocation
- The member can be used in different function calls through the ep lifecycle
Is the send_pkt_entry_vec_size fitting any of them? Per this commit it seems it is only used in the efa_rdm_ope_post_send? Is it a preparation for future refactor?
There was a problem hiding this comment.
If it is a prerequisite for protocol refactor (callback), I think this field should belong to a struct for protocol instead of ep
| } | ||
|
|
||
| // Handle case when there are no TX packets available | ||
| available_tx_pkts = ep->efa_max_outstanding_tx_ops - |
There was a problem hiding this comment.
Maybe better to have it as a static inline util function as it may be used by multiple places
Prerequisite for #12002