| 202 | } |
| 203 | |
| 204 | static int |
| 205 | timed_lookups(struct efd_perf_params *params) |
| 206 | { |
| 207 | unsigned int i, j, a; |
| 208 | const uint64_t start_tsc = rte_rdtsc(); |
| 209 | efd_value_t ret_data; |
| 210 | |
| 211 | for (i = 0; i < NUM_LOOKUPS / KEYS_TO_ADD; i++) { |
| 212 | for (j = 0; j < KEYS_TO_ADD; j++) { |
| 213 | ret_data = rte_efd_lookup(params->efd_table, |
| 214 | test_socket_id, keys[j]); |
| 215 | if (ret_data != data[j]) { |
| 216 | printf("Value mismatch using rte_efd_lookup: " |
| 217 | "key #%d (0x", i); |
| 218 | for (a = 0; a < params->key_size; a++) |
| 219 | printf("%02x", keys[i][a]); |
| 220 | printf(")\n"); |
| 221 | printf(" Expected %d, got %d\n", data[i], |
| 222 | ret_data); |
| 223 | |
| 224 | return -1; |
| 225 | } |
| 226 | |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | const uint64_t end_tsc = rte_rdtsc(); |
| 231 | const uint64_t time_taken = end_tsc - start_tsc; |
| 232 | |
| 233 | cycles[params->cycle][LOOKUP] = time_taken / NUM_LOOKUPS; |
| 234 | |
| 235 | return 0; |
| 236 | } |
| 237 | |
| 238 | static int |
| 239 | timed_lookups_multi(struct efd_perf_params *params) |
no test coverage detected