diff --git a/prov/efa/test/efa_unit_test_common.c b/prov/efa/test/efa_unit_test_common.c index 9580d16bf77..6064332b5cf 100644 --- a/prov/efa/test/efa_unit_test_common.c +++ b/prov/efa/test/efa_unit_test_common.c @@ -52,7 +52,7 @@ void efa_unit_test_construct_msg_rma(struct fi_msg_rma *msg, struct iovec *iov, msg->data = data; } -struct fi_info *efa_unit_test_alloc_hints(enum fi_ep_type ep_type, char *prov_name) +struct fi_info *efa_unit_test_alloc_hints(enum fi_ep_type ep_type, char *fabric_name) { struct fi_info *hints; @@ -60,29 +60,33 @@ struct fi_info *efa_unit_test_alloc_hints(enum fi_ep_type ep_type, char *prov_na if (!hints) return NULL; - hints->fabric_attr->prov_name = strdup(prov_name); + if (fabric_name) + hints->fabric_attr->name = strdup(fabric_name); hints->ep_attr->type = ep_type; /* Use a minimal caps that efa / efa-direct should always support */ hints->domain_attr->mr_mode = MR_MODE_BITS; + + /* EFA direct and dgram paths require FI_CONTEXT2 */ + if (!fabric_name || !strcasecmp(fabric_name, EFA_DIRECT_FABRIC_NAME)) + hints->mode |= FI_CONTEXT2; + if (ep_type == FI_EP_DGRAM) { - hints->mode |= FI_MSG_PREFIX; + hints->mode |= FI_MSG_PREFIX | FI_CONTEXT2; } return hints; } -/* TODO: remove use_efa_direct after we have efa_direct implemented in fi_info */ void efa_unit_test_resource_construct_with_hints(struct efa_resource *resource, enum fi_ep_type ep_type, uint32_t fi_version, struct fi_info *hints, - bool enable_ep, bool open_cq, char* prov_name) + bool enable_ep, bool open_cq) { int ret = 0; struct fi_av_attr av_attr = {0}; struct fi_cq_attr cq_attr = {0}; struct fi_eq_attr eq_attr = {0}; - struct efa_domain *efa_domain; ret = fi_getinfo(fi_version, NULL, NULL, 0ULL, hints, &resource->info); if (ret) @@ -96,17 +100,6 @@ void efa_unit_test_resource_construct_with_hints(struct efa_resource *resource, if (ret) goto err; - /* - * TODO: Remove this function pointer override when we have it assigned - * for efa-direct correctly. - */ - if (!strcmp(EFA_DIRECT_PROV_NAME, prov_name)) { - efa_domain = container_of(resource->domain, struct efa_domain, util_domain.domain_fid); - - efa_domain->util_domain.domain_fid.ops->endpoint = efa_ep_open; - efa_domain->util_domain.domain_fid.ops->cq_open = efa_cq_open; - } - ret = fi_endpoint(resource->domain, resource->info, &resource->ep, NULL); if (ret) goto err; @@ -146,19 +139,18 @@ void efa_unit_test_resource_construct_with_hints(struct efa_resource *resource, assert_int_equal(ret, 0); } -void efa_unit_test_resource_construct(struct efa_resource *resource, enum fi_ep_type ep_type, char *prov_name) +void efa_unit_test_resource_construct(struct efa_resource *resource, enum fi_ep_type ep_type, char *fabric_name) { - /* TODO use prov_name here when efa-direct fi_info is implemented */ - resource->hints = efa_unit_test_alloc_hints(ep_type, EFA_PROV_NAME); + resource->hints = efa_unit_test_alloc_hints(ep_type, fabric_name); if (!resource->hints) goto err; - if (!strcmp(EFA_DIRECT_PROV_NAME, prov_name)) + if (!strcmp(EFA_DIRECT_FABRIC_NAME, fabric_name)) efa_unit_test_resource_construct_with_hints(resource, ep_type, FI_VERSION(2, 0), - resource->hints, true, true, prov_name); + resource->hints, true, true); else efa_unit_test_resource_construct_with_hints(resource, ep_type, FI_VERSION(1, 14), - resource->hints, true, true, prov_name); + resource->hints, true, true); return; err: @@ -169,19 +161,18 @@ void efa_unit_test_resource_construct(struct efa_resource *resource, enum fi_ep_ } void efa_unit_test_resource_construct_ep_not_enabled(struct efa_resource *resource, - enum fi_ep_type ep_type, char *prov_name) + enum fi_ep_type ep_type, char *fabric_name) { - /* TODO use prov_name here when efa-direct fi_info is implemented */ - resource->hints = efa_unit_test_alloc_hints(ep_type, EFA_PROV_NAME); + resource->hints = efa_unit_test_alloc_hints(ep_type, fabric_name); if (!resource->hints) goto err; - if (!strcmp(EFA_DIRECT_PROV_NAME, prov_name)) + if (!strcmp(EFA_DIRECT_FABRIC_NAME, fabric_name)) efa_unit_test_resource_construct_with_hints(resource, ep_type, FI_VERSION(2, 0), - resource->hints, false, true, prov_name); + resource->hints, false, true); else efa_unit_test_resource_construct_with_hints(resource, ep_type, FI_VERSION(1, 14), - resource->hints, false, true, prov_name); + resource->hints, false, true); return; err: @@ -192,19 +183,18 @@ void efa_unit_test_resource_construct_ep_not_enabled(struct efa_resource *resour } void efa_unit_test_resource_construct_no_cq_and_ep_not_enabled(struct efa_resource *resource, - enum fi_ep_type ep_type, char *prov_name) + enum fi_ep_type ep_type, char *fabric_name) { - /* TODO use prov_name here when efa-direct fi_info is implemented */ - resource->hints = efa_unit_test_alloc_hints(ep_type, EFA_PROV_NAME); + resource->hints = efa_unit_test_alloc_hints(ep_type, fabric_name); if (!resource->hints) goto err; - if (!strcmp(EFA_DIRECT_PROV_NAME, prov_name)) + if (!strcmp(EFA_DIRECT_FABRIC_NAME, fabric_name)) efa_unit_test_resource_construct_with_hints(resource, ep_type, FI_VERSION(2, 0), - resource->hints, false, false, prov_name); + resource->hints, false, false); else efa_unit_test_resource_construct_with_hints(resource, ep_type, FI_VERSION(1, 14), - resource->hints, false, false, prov_name); + resource->hints, false, false); return; err: @@ -227,7 +217,7 @@ void efa_unit_test_resource_construct_rdm_shm_disabled(struct efa_resource *reso goto err; efa_unit_test_resource_construct_with_hints(resource, FI_EP_RDM, FI_VERSION(1, 14), - resource->hints, false, true, EFA_PROV_NAME); + resource->hints, false, true); ret = fi_setopt(&resource->ep->fid, FI_OPT_ENDPOINT, FI_OPT_SHARED_MEMORY_PERMITTED, &shm_permitted, diff --git a/prov/efa/test/efa_unit_test_ep.c b/prov/efa/test/efa_unit_test_ep.c index cab4697d03b..9f68753c5bf 100644 --- a/prov/efa/test/efa_unit_test_ep.c +++ b/prov/efa/test/efa_unit_test_ep.c @@ -597,7 +597,7 @@ void test_efa_rdm_ep_rma_queue_before_handshake(struct efa_resource **state, int resource->hints->caps |= FI_MSG | FI_TAGGED | FI_RMA; resource->hints->domain_attr->mr_mode |= MR_MODE_BITS; efa_unit_test_resource_construct_with_hints(resource, FI_EP_RDM, FI_VERSION(1, 14), - resource->hints, true, true, EFA_PROV_NAME); + resource->hints, true, true); /* ensure we don't have RMA capability. */ efa_rdm_ep = container_of(resource->ep, struct efa_rdm_ep, base_ep.util_ep.ep_fid); @@ -685,7 +685,7 @@ void test_efa_rdm_ep_rma_inconsistent_unsolicited_write_recv(struct efa_resource resource->hints->caps |= FI_MSG | FI_TAGGED | FI_RMA; resource->hints->domain_attr->mr_mode |= MR_MODE_BITS; efa_unit_test_resource_construct_with_hints(resource, FI_EP_RDM, FI_VERSION(1, 22), - resource->hints, true, true, EFA_PROV_NAME); + resource->hints, true, true); efa_rdm_ep = container_of(resource->ep, struct efa_rdm_ep, base_ep.util_ep.ep_fid); @@ -794,7 +794,7 @@ void test_efa_rdm_ep_rma_without_caps(struct efa_resource **state) resource->hints->caps &= ~FI_RMA; resource->hints->domain_attr->mr_mode |= MR_MODE_BITS; efa_unit_test_resource_construct_with_hints(resource, FI_EP_RDM, FI_VERSION(1, 14), - resource->hints, true, true, EFA_PROV_NAME); + resource->hints, true, true); /* ensure we don't have RMA capability. */ efa_rdm_ep = container_of(resource->ep, struct efa_rdm_ep, base_ep.util_ep.ep_fid); @@ -845,7 +845,7 @@ void test_efa_rdm_ep_atomic_without_caps(struct efa_resource **state) resource->hints->caps &= ~FI_ATOMIC; resource->hints->domain_attr->mr_mode |= MR_MODE_BITS; efa_unit_test_resource_construct_with_hints(resource, FI_EP_RDM, FI_VERSION(1, 14), - resource->hints, true, true, EFA_PROV_NAME); + resource->hints, true, true); /* ensure we don't have ATOMIC capability. */ efa_rdm_ep = container_of(resource->ep, struct efa_rdm_ep, base_ep.util_ep.ep_fid); @@ -1001,7 +1001,7 @@ static void test_efa_rdm_ep_use_zcpy_rx_impl(struct efa_resource *resource, ofi_hmem_disable_p2p = cuda_p2p_disabled; efa_unit_test_resource_construct_with_hints(resource, FI_EP_RDM, FI_VERSION(1, 14), - resource->hints, false, true, EFA_PROV_NAME); + resource->hints, false, true); /* System memory P2P should always be enabled */ assert_true(g_efa_hmem_info[FI_HMEM_SYSTEM].initialized); @@ -1314,7 +1314,7 @@ void test_efa_rdm_ep_rx_refill_impl(struct efa_resource **state, int threshold, assert_non_null(resource->hints); resource->hints->rx_attr->size = rx_size; efa_unit_test_resource_construct_with_hints(resource, FI_EP_RDM, FI_VERSION(1, 14), - resource->hints, true, true, EFA_PROV_NAME); + resource->hints, true, true); efa_rdm_ep = container_of(resource->ep, struct efa_rdm_ep, base_ep.util_ep.ep_fid); assert_int_equal(efa_rdm_ep_get_rx_pool_size(efa_rdm_ep), rx_size); diff --git a/prov/efa/test/efa_unit_test_info.c b/prov/efa/test/efa_unit_test_info.c index b3ea13e0614..db52ccd0594 100644 --- a/prov/efa/test/efa_unit_test_info.c +++ b/prov/efa/test/efa_unit_test_info.c @@ -21,7 +21,7 @@ void test_info_open_ep_with_wrong_info() assert_int_equal(err, 0); /* dgram endpoint require FI_MSG_PREFIX */ - assert_int_equal(info->mode, FI_MSG_PREFIX); + assert_int_equal(info->mode, FI_MSG_PREFIX | FI_CONTEXT2); /* make the info wrong by setting the mode to 0 */ info->mode = 0; @@ -44,6 +44,75 @@ void test_info_open_ep_with_wrong_info() assert_int_equal(err, 0); } +/** + * @brief Verify that efa rdm path fi_info objects have some expected values + */ +void test_info_rdm_attributes() +{ + struct fi_info *hints, *info = NULL, *info_head = NULL; + int err; + + hints = efa_unit_test_alloc_hints(FI_EP_RDM, EFA_FABRIC_NAME); + assert_non_null(hints); + + err = fi_getinfo(FI_VERSION(1,6), NULL, NULL, 0, hints, &info_head); + assert_int_equal(err, 0); + assert_non_null(info_head); + + for (info = info_head; info; info = info->next) { + assert_true(!strcmp(info->fabric_attr->name, EFA_FABRIC_NAME)); + assert_true(strstr(info->domain_attr->name, "rdm")); + assert_int_equal(info->ep_attr->max_msg_size, UINT64_MAX); +#if HAVE_CUDA || HAVE_NEURON || HAVE_SYNAPSEAI + assert_true(info->caps | FI_HMEM); +#endif + } +} + +/** + * @brief Verify that efa dgram path fi_info objects have some expected values + */ +void test_info_dgram_attributes() +{ + struct fi_info *hints, *info = NULL, *info_head = NULL; + int err; + + hints = efa_unit_test_alloc_hints(FI_EP_DGRAM, EFA_FABRIC_NAME); + assert_non_null(hints); + + err = fi_getinfo(FI_VERSION(1,6), NULL, NULL, 0, hints, &info_head); + assert_int_equal(err, 0); + assert_non_null(info_head); + + for (info = info_head; info; info = info->next) { + assert_true(!strcmp(info->fabric_attr->name, EFA_FABRIC_NAME)); + assert_true(strstr(info->domain_attr->name, "dgrm")); + } +} + +/** + * @brief Verify that efa direct path fi_info objects have some expected values + */ +void test_info_direct_attributes() +{ + struct fi_info *hints, *info = NULL, *info_head = NULL; + int err; + + hints = efa_unit_test_alloc_hints(FI_EP_RDM, EFA_DIRECT_FABRIC_NAME); + assert_non_null(hints); + + err = fi_getinfo(FI_VERSION(1,6), NULL, NULL, 0, hints, &info); + assert_int_equal(err, 0); + assert_non_null(info); + for (info = info_head; info; info = info->next) { + assert_true(!strcmp(info->fabric_attr->name, EFA_DIRECT_FABRIC_NAME)); + assert_true(strstr(info->domain_attr->name, "rdm")); + assert_false(info->caps & (FI_ATOMIC | FI_TAGGED)); + assert_false(info->tx_attr->msg_order & FI_ORDER_SAS); + assert_int_equal(info->ep_attr->max_msg_size, g_device_list[0].max_rdma_size); + } +} + /** * @brief Verify info->tx/rx_attr->msg_order is set according to hints. * @@ -420,22 +489,92 @@ void test_info_check_hmem_cuda_support_on_api_ge_1_18() fi_freeinfo(info); } +void check_no_hmem_support_when_not_requested(char *fabric_name) +{ + struct fi_info *hints, *info = NULL; + int err; + + hints = efa_unit_test_alloc_hints(FI_EP_RDM, fabric_name); + + err = fi_getinfo(FI_VERSION(1,6), NULL, NULL, 0, hints, &info); + assert_int_equal(err, 0); + assert_non_null(info); + assert_false(info->caps & FI_HMEM); + fi_freeinfo(info); +} + /** * @brief Check that EFA does not claim support of FI_HMEM when * it is not requested */ -void test_info_check_no_hmem_support_when_not_requested() +void test_info_check_no_hmem_support_when_not_requested() { + check_no_hmem_support_when_not_requested(EFA_FABRIC_NAME); + check_no_hmem_support_when_not_requested(EFA_DIRECT_FABRIC_NAME); +} + +/** + * @brief Check that EFA direct info object is not returned when atomic + * or ordering capabilities are requested + */ +void test_info_direct_unsupported() { struct fi_info *hints, *info = NULL; int err; - hints = efa_unit_test_alloc_hints(FI_EP_RDM, EFA_PROV_NAME); + hints = efa_unit_test_alloc_hints(FI_EP_RDM, EFA_DIRECT_FABRIC_NAME); + assert_non_null(hints); err = fi_getinfo(FI_VERSION(1,6), NULL, NULL, 0, hints, &info); assert_int_equal(err, 0); assert_non_null(info); - assert_false(info->caps & FI_HMEM); - fi_freeinfo(info); + + hints->caps |= FI_ATOMIC; + err = fi_getinfo(FI_VERSION(1,6), NULL, NULL, 0, hints, &info); + assert_int_equal(err, -FI_ENODATA); + assert_null(info); + + hints->caps &= ~FI_ATOMIC; + hints->tx_attr->msg_order = FI_ORDER_SAS; + hints->rx_attr->msg_order = FI_ORDER_SAS; + err = fi_getinfo(FI_VERSION(1,6), NULL, NULL, 0, hints, &info); + assert_int_equal(err, -FI_ENODATA); + assert_null(info); +} + +/** + * @brief Verify that efa-direct fi_info objects are returned before efa info objects + */ +void test_info_direct_ordering() +{ + struct fi_info *hints, *info = NULL, *info_head = NULL; + bool efa_direct_returned = false, efa_returned = false; + bool efa_direct_returned_after_efa = false, efa_returned_after_efa_direct = false; + int err; + + hints = efa_unit_test_alloc_hints(FI_EP_RDM, NULL); + assert_non_null(hints); + + err = fi_getinfo(FI_VERSION(1,6), NULL, NULL, 0, hints, &info_head); + assert_int_equal(err, 0); + assert_non_null(info_head); + + for (info = info_head; info; info = info->next) { + if (!strcmp(info->fabric_attr->name, EFA_DIRECT_FABRIC_NAME)) { + efa_direct_returned = true; + if (efa_returned) + efa_direct_returned_after_efa = true; + } + if (!strcmp(info->fabric_attr->name, EFA_FABRIC_NAME)) { + efa_returned = true; + if (efa_direct_returned) + efa_returned_after_efa_direct = true; + } + } + + assert_true(efa_direct_returned); + assert_true(efa_returned); + assert_true(efa_returned_after_efa_direct); + assert_false(efa_direct_returned_after_efa); } /** @@ -561,12 +700,12 @@ static int get_first_nic_name(char **name) { * @param[in] filter The value that would be set for FI_EFA_IFACE * @param[in] expect_first_name The expected name of the "first" NIC */ -static void test_efa_nic_selection(const char *filter, const char *expect_first_name) { +static void test_efa_nic_selection(const char *filter, const char *expect_first_name, char *fabric_name) { int ret; struct fi_info *hints, *info; efa_env.iface = (char *) filter; - hints = efa_unit_test_alloc_hints(FI_EP_RDM, EFA_PROV_NAME); + hints = efa_unit_test_alloc_hints(FI_EP_RDM, fabric_name); ret = fi_getinfo(FI_VERSION(1, 14), NULL, NULL, 0ULL, hints, &info); fi_freeinfo(hints); if (expect_first_name) { @@ -588,7 +727,8 @@ void test_efa_nic_select_all_devices_matches() { ret = get_first_nic_name(&nic_name); assert_int_equal(ret, FI_SUCCESS); - test_efa_nic_selection("all", nic_name); + test_efa_nic_selection("all", nic_name, EFA_FABRIC_NAME); + test_efa_nic_selection("all", nic_name, EFA_DIRECT_FABRIC_NAME); free(nic_name); } @@ -603,7 +743,8 @@ void test_efa_nic_select_first_device_matches() { ret = get_first_nic_name(&nic_name); assert_int_equal(ret, FI_SUCCESS); - test_efa_nic_selection(nic_name, nic_name); + test_efa_nic_selection(nic_name, nic_name, EFA_FABRIC_NAME); + test_efa_nic_selection(nic_name, nic_name, EFA_DIRECT_FABRIC_NAME); free(nic_name); } @@ -626,7 +767,8 @@ void test_efa_nic_select_first_device_with_surrounding_comma_matches() { strcat(filter, nic_name); strcat(filter, ","); - test_efa_nic_selection(filter, nic_name); + test_efa_nic_selection(filter, nic_name, EFA_FABRIC_NAME); + test_efa_nic_selection(filter, nic_name, EFA_DIRECT_FABRIC_NAME); free(filter); free(nic_name); @@ -646,7 +788,8 @@ void test_efa_nic_select_first_device_first_letter_no_match() { filter[0] = nic_name[0]; filter[1] = '\0'; - test_efa_nic_selection(filter, NULL); + test_efa_nic_selection(filter, NULL, EFA_FABRIC_NAME); + test_efa_nic_selection(filter, NULL, EFA_DIRECT_FABRIC_NAME); free(nic_name); } @@ -655,7 +798,8 @@ void test_efa_nic_select_first_device_first_letter_no_match() { * Verify that empty NIC names will not select any NIC */ void test_efa_nic_select_empty_device_no_match() { - test_efa_nic_selection(",", NULL); + test_efa_nic_selection(",", NULL, EFA_FABRIC_NAME); + test_efa_nic_selection(",", NULL, EFA_DIRECT_FABRIC_NAME); } /* indicates the test shouldn't set the setopt or environment diff --git a/prov/efa/test/efa_unit_tests.c b/prov/efa/test/efa_unit_tests.c index 93991120fd4..4586a7f8637 100644 --- a/prov/efa/test/efa_unit_tests.c +++ b/prov/efa/test/efa_unit_tests.c @@ -134,7 +134,12 @@ int main(void) cmocka_unit_test_setup_teardown(test_ibv_cq_ex_read_recover_forgotten_peer_ah, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), cmocka_unit_test_setup_teardown(test_ibv_cq_ex_read_ignore_removed_peer, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), cmocka_unit_test_setup_teardown(test_rdm_fallback_to_ibv_create_cq_ex_cq_read_ignore_forgotton_peer, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), + + /* begin efa_unit_test_info.c */ cmocka_unit_test_setup_teardown(test_info_open_ep_with_wrong_info, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), + cmocka_unit_test_setup_teardown(test_info_rdm_attributes, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), + cmocka_unit_test_setup_teardown(test_info_dgram_attributes, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), + cmocka_unit_test_setup_teardown(test_info_direct_attributes, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), cmocka_unit_test_setup_teardown(test_info_tx_rx_msg_order_rdm_order_none, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), cmocka_unit_test_setup_teardown(test_info_tx_rx_msg_order_rdm_order_sas, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), cmocka_unit_test_setup_teardown(test_info_tx_rx_msg_order_dgram_order_none, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), @@ -150,6 +155,8 @@ int main(void) cmocka_unit_test_setup_teardown(test_info_check_hmem_cuda_support_on_api_lt_1_18, NULL, NULL), cmocka_unit_test_setup_teardown(test_info_check_hmem_cuda_support_on_api_ge_1_18, NULL, NULL), cmocka_unit_test_setup_teardown(test_info_check_no_hmem_support_when_not_requested, NULL, NULL), + cmocka_unit_test_setup_teardown(test_info_direct_unsupported, NULL, NULL), + cmocka_unit_test_setup_teardown(test_info_direct_ordering, NULL, NULL), cmocka_unit_test_setup_teardown(test_efa_nic_select_all_devices_matches, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), cmocka_unit_test_setup_teardown(test_efa_nic_select_first_device_matches, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), cmocka_unit_test_setup_teardown(test_efa_nic_select_first_device_with_surrounding_comma_matches, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), @@ -164,6 +171,8 @@ int main(void) cmocka_unit_test_setup_teardown(test_efa_use_device_rdma_opt1, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), cmocka_unit_test_setup_teardown(test_efa_use_device_rdma_opt0, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), cmocka_unit_test_setup_teardown(test_efa_use_device_rdma_opt_old, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), + /* end efa_unit_test_info.c */ + cmocka_unit_test_setup_teardown(test_efa_hmem_info_update_neuron, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), cmocka_unit_test_setup_teardown(test_efa_hmem_info_disable_p2p_neuron, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), cmocka_unit_test_setup_teardown(test_efa_hmem_info_disable_p2p_cuda, efa_unit_test_mocks_setup, efa_unit_test_mocks_teardown), diff --git a/prov/efa/test/efa_unit_tests.h b/prov/efa/test/efa_unit_tests.h index 586ac8f5e6f..db438923b78 100644 --- a/prov/efa/test/efa_unit_tests.h +++ b/prov/efa/test/efa_unit_tests.h @@ -33,17 +33,17 @@ struct efa_resource { struct fid_cq *cq; }; -struct fi_info *efa_unit_test_alloc_hints(enum fi_ep_type ep_type, char *prov_name); +struct fi_info *efa_unit_test_alloc_hints(enum fi_ep_type ep_type, char *fabric_name); -void efa_unit_test_resource_construct(struct efa_resource *resource, enum fi_ep_type ep_type, char *prov_name); +void efa_unit_test_resource_construct(struct efa_resource *resource, enum fi_ep_type ep_type, char *fabric_name); void efa_unit_test_resource_construct_ep_not_enabled( - struct efa_resource *resource, enum fi_ep_type ep_type, char *prov_name); + struct efa_resource *resource, enum fi_ep_type ep_type, char *fabric_name); void efa_unit_test_resource_construct_no_cq_and_ep_not_enabled( - struct efa_resource *resource, enum fi_ep_type ep_type, char *prov_name); + struct efa_resource *resource, enum fi_ep_type ep_type, char *fabric_name); void efa_unit_test_resource_construct_with_hints(struct efa_resource *resource, enum fi_ep_type ep_type, uint32_t fi_version, struct fi_info *hints, - bool enable_ep, bool open_cq, char *prov_name); + bool enable_ep, bool open_cq); void efa_unit_test_resource_construct_rdm_shm_disabled(struct efa_resource *resource); @@ -154,7 +154,12 @@ void test_ibv_cq_ex_read_bad_recv_rdma_with_imm_status_use_solicited_recv(); void test_ibv_cq_ex_read_recover_forgotten_peer_ah(); void test_rdm_fallback_to_ibv_create_cq_ex_cq_read_ignore_forgotton_peer(); void test_ibv_cq_ex_read_ignore_removed_peer(); + +/* begin efa_unit_test_info.c */ void test_info_open_ep_with_wrong_info(); +void test_info_rdm_attributes(); +void test_info_dgram_attributes(); +void test_info_direct_attributes(); void test_info_tx_rx_msg_order_rdm_order_none(); void test_info_tx_rx_msg_order_rdm_order_sas(); void test_info_tx_rx_msg_order_dgram_order_none(); @@ -170,6 +175,8 @@ void test_info_check_shm_info_threading(); void test_info_check_hmem_cuda_support_on_api_lt_1_18(); void test_info_check_hmem_cuda_support_on_api_ge_1_18(); void test_info_check_no_hmem_support_when_not_requested(); +void test_info_direct_unsupported(); +void test_info_direct_ordering(); void test_efa_hmem_info_update_neuron(); void test_efa_hmem_info_disable_p2p_neuron(); void test_efa_hmem_info_disable_p2p_cuda(); @@ -187,6 +194,8 @@ void test_efa_use_device_rdma_opt0(); void test_efa_use_device_rdma_env1(); void test_efa_use_device_rdma_env0(); void test_efa_use_device_rdma_opt_old(); +/* end efa_unit_test_info.c */ + void test_efa_srx_min_multi_recv_size(); void test_efa_srx_cq(); void test_efa_srx_lock();