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

Function cpfl_vport_map_init

dpdk/drivers/net/cpfl/cpfl_ethdev.c:2195–2222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2193};
2194
2195static int
2196cpfl_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(&params);
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
2224static void
2225cpfl_vport_map_uninit(struct cpfl_adapter_ext *adapter)

Callers 1

cpfl_adapter_ext_initFunction · 0.85

Calls 3

snprintfFunction · 0.85
rte_spinlock_initFunction · 0.85
rte_hash_createFunction · 0.85

Tested by

no test coverage detected