| 2193 | }; |
| 2194 | |
| 2195 | static int |
| 2196 | cpfl_vport_map_init(struct cpfl_adapter_ext *adapter) |
| 2197 | { |
| 2198 | char hname[32]; |
| 2199 | |
| 2200 | snprintf(hname, 32, "%s-vport", adapter->name); |
| 2201 | |
| 2202 | rte_spinlock_init(&adapter->vport_map_lock); |
| 2203 | |
| 2204 | #define CPFL_VPORT_MAP_HASH_ENTRY_NUM 2048 |
| 2205 | |
| 2206 | struct rte_hash_parameters params = { |
| 2207 | .name = adapter->name, |
| 2208 | .entries = CPFL_VPORT_MAP_HASH_ENTRY_NUM, |
| 2209 | .key_len = sizeof(struct cpfl_vport_id), |
| 2210 | .hash_func = rte_hash_crc, |
| 2211 | .socket_id = SOCKET_ID_ANY, |
| 2212 | }; |
| 2213 | |
| 2214 | adapter->vport_map_hash = rte_hash_create(¶ms); |
| 2215 | |
| 2216 | if (adapter->vport_map_hash == NULL) { |
| 2217 | PMD_INIT_LOG(ERR, "Failed to create vport map hash"); |
| 2218 | return -EINVAL; |
| 2219 | } |
| 2220 | |
| 2221 | return 0; |
| 2222 | } |
| 2223 | |
| 2224 | static void |
| 2225 | cpfl_vport_map_uninit(struct cpfl_adapter_ext *adapter) |
no test coverage detected