Skip to content

Commit

Permalink
prov/efa: Regulate the usage of optnames
Browse files Browse the repository at this point in the history
FI_OPT_EFA_USE_DEVICE_RDMA, FI_OPT_EFA_SENDRECV_IN_ORDER_ALIGNED_128_BYTES,
and FI_OPT_EFA_WRITE_IN_ORDER_ALIGNED_128_BYTES should only apply to
the fi_setopt call as they are used to enforce the endpoint to perform
required operations. If they are not set, provider will do the traffic
with supported capabilities by default. In that regard, it causes confusions
to support these optnames in the getopt calls.

Signed-off-by: Shi Jin <[email protected]>
  • Loading branch information
shijin-aws committed Jan 16, 2025
1 parent 091b20b commit 6b5ec94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
9 changes: 6 additions & 3 deletions man/fi_efa.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ provider for AWS Neuron or Habana SynapseAI.
these operations are assisted by hardware support (return value is false).

*FI_OPT_EFA_USE_DEVICE_RDMA - bool*
: Only available if the application selects a libfabric API version >= 1.18.
: These option only applies to the fi_setopt() call.
Only available if the application selects a libfabric API version >= 1.18.
This option allows an application to change libfabric's behavior
with respect to RDMA transfers. Note that there is also an environment
variable FI_EFA_USE_DEVICE_RDMA which the user may set as well. If the
Expand All @@ -131,15 +132,17 @@ provider for AWS Neuron or Habana SynapseAI.
revisions.

*FI_OPT_EFA_SENDRECV_IN_ORDER_ALIGNED_128_BYTES - bool*
: It is used to force the endpoint to use in-order send/recv operation for each 128 bytes
: These option only applies to the fi_setopt() call.
It is used to force the endpoint to use in-order send/recv operation for each 128 bytes
aligned block. Enabling the option will guarantee data inside each 128 bytes
aligned block being sent and received in order, it will also guarantee data
to be delivered to the receive buffer only once. If endpoint is not able to
support this feature, it will return -FI_EOPNOTSUPP for the call to fi_setopt().


*FI_OPT_EFA_WRITE_IN_ORDER_ALIGNED_128_BYTES - bool*
: It is used to set the endpoint to use in-order RDMA write operation for each 128 bytes
: These option only applies to the fi_setopt() call..
It is used to set the endpoint to use in-order RDMA write operation for each 128 bytes
aligned block. Enabling the option will guarantee data inside each 128 bytes
aligned block being written in order, it will also guarantee data to be
delivered to the target buffer only once. If endpoint is not able to support
Expand Down
18 changes: 0 additions & 18 deletions prov/efa/src/rdm/efa_rdm_ep_fiops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1883,24 +1883,6 @@ static int efa_rdm_ep_getopt(fid_t fid, int level, int optname, void *optval,
*(bool *)optval = true;
*optlen = sizeof(bool);
break;
case FI_OPT_EFA_USE_DEVICE_RDMA:
if (*optlen < sizeof(bool))
return -FI_ETOOSMALL;
*(bool *)optval = efa_rdm_ep->use_device_rdma;
*optlen = sizeof(bool);
break;
case FI_OPT_EFA_SENDRECV_IN_ORDER_ALIGNED_128_BYTES:
if (*optlen < sizeof(bool))
return -FI_ETOOSMALL;
*(bool *)optval = efa_rdm_ep->sendrecv_in_order_aligned_128_bytes;
*optlen = sizeof(bool);
break;
case FI_OPT_EFA_WRITE_IN_ORDER_ALIGNED_128_BYTES:
if (*optlen < sizeof(bool))
return -FI_ETOOSMALL;
*(bool *)optval = efa_rdm_ep->write_in_order_aligned_128_bytes;
*optlen = sizeof(bool);
break;
default:
EFA_INFO(FI_LOG_EP_CTRL, "Unknown endpoint option\n");
return -FI_ENOPROTOOPT;
Expand Down
3 changes: 0 additions & 3 deletions prov/efa/test/efa_unit_test_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,9 +892,6 @@ void test_efa_rdm_ep_getopt(struct efa_resource **state, size_t opt_len, int exp
FI_OPT_EFA_EMULATED_READ,
FI_OPT_EFA_EMULATED_WRITE,
FI_OPT_EFA_EMULATED_ATOMICS,
FI_OPT_EFA_USE_DEVICE_RDMA,
FI_OPT_EFA_SENDRECV_IN_ORDER_ALIGNED_128_BYTES,
FI_OPT_EFA_WRITE_IN_ORDER_ALIGNED_128_BYTES
};
size_t num_opt_names = sizeof(opt_names) / sizeof(int);

Expand Down

0 comments on commit 6b5ec94

Please sign in to comment.