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

Function mlx5_flow_ipool_create

dpdk/drivers/net/mlx5/mlx5.c:892–929  ·  view source on GitHub ↗

* Initialize the flow resources' indexed mempool. * * @param[in] sh * Pointer to mlx5_dev_ctx_shared object. */

Source from the content-addressed store, hash-verified

890 * Pointer to mlx5_dev_ctx_shared object.
891 */
892static void
893mlx5_flow_ipool_create(struct mlx5_dev_ctx_shared *sh)
894{
895 uint8_t i;
896 struct mlx5_indexed_pool_config cfg;
897
898 for (i = 0; i < MLX5_IPOOL_MAX; ++i) {
899 cfg = mlx5_ipool_cfg[i];
900 switch (i) {
901 default:
902 break;
903 /*
904 * Set MLX5_IPOOL_MLX5_FLOW ipool size
905 * according to PCI function flow configuration.
906 */
907 case MLX5_IPOOL_MLX5_FLOW:
908 cfg.size = sh->config.dv_flow_en ?
909 RTE_ALIGN_MUL_CEIL(sizeof(struct mlx5_flow_handle), 8) :
910 MLX5_FLOW_HANDLE_VERBS_SIZE;
911 break;
912#if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)
913 /* Set MLX5_IPOOL_JUMP ipool entry size depending on selected flow engine. */
914 case MLX5_IPOOL_JUMP:
915 cfg.size = sh->config.dv_flow_en == 2 ?
916 sizeof(struct mlx5_flow_group) :
917 sizeof(struct mlx5_flow_tbl_data_entry);
918 break;
919#endif
920 }
921 if (sh->config.reclaim_mode) {
922 cfg.release_mem_en = 1;
923 cfg.per_core_cache = 0;
924 } else {
925 cfg.release_mem_en = 0;
926 }
927 sh->ipool[i] = mlx5_ipool_create(&cfg);
928 }
929}
930
931
932/**

Callers 1

Calls 1

mlx5_ipool_createFunction · 0.85

Tested by

no test coverage detected