MCPcopy Create free account
hub / github.com/F-Stack/f-stack / flow_alloc_thread_workspace

Function flow_alloc_thread_workspace

dpdk/drivers/net/mlx5/mlx5_flow.c:8231–8245  ·  view source on GitHub ↗

* Allocate and init new flow workspace. * * @return pointer to flow workspace data, NULL on error. */

Source from the content-addressed store, hash-verified

8229 * @return pointer to flow workspace data, NULL on error.
8230 */
8231static struct mlx5_flow_workspace*
8232flow_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.

Callers 1

Calls 1

callocFunction · 0.85

Tested by

no test coverage detected