| 126 | } |
| 127 | |
| 128 | static int |
| 129 | test_rawdev_configure(void) |
| 130 | { |
| 131 | int ret; |
| 132 | struct rte_rawdev_info rdev_info = {0}; |
| 133 | struct skeleton_rawdev_conf rdev_conf_set = {0}; |
| 134 | struct skeleton_rawdev_conf rdev_conf_get = {0}; |
| 135 | |
| 136 | /* Check invalid configuration */ |
| 137 | ret = rte_rawdev_configure(test_dev_id, NULL, 0); |
| 138 | RTE_TEST_ASSERT(ret == -EINVAL, |
| 139 | "Null configure; Expected -EINVAL, got %d", ret); |
| 140 | |
| 141 | /* Valid configuration test */ |
| 142 | rdev_conf_set.num_queues = 1; |
| 143 | rdev_conf_set.capabilities = SKELETON_CAPA_FW_LOAD | |
| 144 | SKELETON_CAPA_FW_RESET; |
| 145 | |
| 146 | rdev_info.dev_private = &rdev_conf_set; |
| 147 | ret = rte_rawdev_configure(test_dev_id, |
| 148 | (rte_rawdev_obj_t)&rdev_info, |
| 149 | sizeof(rdev_conf_set)); |
| 150 | RTE_TEST_ASSERT_SUCCESS(ret, "Failed to configure rawdev (%d)", ret); |
| 151 | |
| 152 | rdev_info.dev_private = &rdev_conf_get; |
| 153 | ret = rte_rawdev_info_get(test_dev_id, |
| 154 | (rte_rawdev_obj_t)&rdev_info, |
| 155 | sizeof(rdev_conf_get)); |
| 156 | RTE_TEST_ASSERT_SUCCESS(ret, |
| 157 | "Failed to obtain rawdev configuration (%d)", |
| 158 | ret); |
| 159 | |
| 160 | RTE_TEST_ASSERT_EQUAL(rdev_conf_set.num_queues, |
| 161 | rdev_conf_get.num_queues, |
| 162 | "Configuration test failed; num_queues (%d)(%d)", |
| 163 | rdev_conf_set.num_queues, |
| 164 | rdev_conf_get.num_queues); |
| 165 | RTE_TEST_ASSERT_EQUAL(rdev_conf_set.capabilities, |
| 166 | rdev_conf_get.capabilities, |
| 167 | "Configuration test failed; capabilities"); |
| 168 | |
| 169 | return TEST_SUCCESS; |
| 170 | } |
| 171 | |
| 172 | static int |
| 173 | test_rawdev_queue_default_conf_get(void) |
nothing calls this directly
no test coverage detected