* Allocate and init new flow workspace. * * @return pointer to flow workspace data, NULL on error. */
| 8229 | * @return pointer to flow workspace data, NULL on error. |
| 8230 | */ |
| 8231 | static struct mlx5_flow_workspace* |
| 8232 | flow_alloc_thread_workspace(void) |
| 8233 | { |
| 8234 | size_t data_size = RTE_ALIGN(sizeof(struct mlx5_flow_workspace), sizeof(long)); |
| 8235 | size_t rss_queue_array_size = sizeof(uint16_t) * RTE_ETH_RSS_RETA_SIZE_512; |
| 8236 | struct mlx5_flow_workspace *data = calloc(1, data_size + |
| 8237 | rss_queue_array_size); |
| 8238 | |
| 8239 | if (!data) { |
| 8240 | DRV_LOG(ERR, "Failed to allocate flow workspace memory."); |
| 8241 | return NULL; |
| 8242 | } |
| 8243 | data->rss_desc.queue = RTE_PTR_ADD(data, data_size); |
| 8244 | return data; |
| 8245 | } |
| 8246 | |
| 8247 | /** |
| 8248 | * Get new thread specific flow workspace. |
no test coverage detected