| 2490 | }; |
| 2491 | |
| 2492 | struct rte_table_action * |
| 2493 | rte_table_action_create(struct rte_table_action_profile *profile, |
| 2494 | uint32_t socket_id) |
| 2495 | { |
| 2496 | struct rte_table_action *action; |
| 2497 | |
| 2498 | /* Check input arguments */ |
| 2499 | if ((profile == NULL) || |
| 2500 | (profile->frozen == 0)) |
| 2501 | return NULL; |
| 2502 | |
| 2503 | /* Memory allocation */ |
| 2504 | action = rte_zmalloc_socket(NULL, |
| 2505 | sizeof(struct rte_table_action), |
| 2506 | RTE_CACHE_LINE_SIZE, |
| 2507 | socket_id); |
| 2508 | if (action == NULL) |
| 2509 | return NULL; |
| 2510 | |
| 2511 | /* Initialization */ |
| 2512 | memcpy(&action->cfg, &profile->cfg, sizeof(profile->cfg)); |
| 2513 | memcpy(&action->data, &profile->data, sizeof(profile->data)); |
| 2514 | |
| 2515 | return action; |
| 2516 | } |
| 2517 | |
| 2518 | static __rte_always_inline void * |
| 2519 | action_data_get(void *data, |
no test coverage detected