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

Function tap_flow_free

dpdk/drivers/net/tap/tap_flow.c:1336–1359  ·  view source on GitHub ↗

* Free the flow opened file descriptors and allocated memory * * @param[in] flow * Pointer to the flow to free * */

Source from the content-addressed store, hash-verified

1334 *
1335 */
1336static void
1337tap_flow_free(struct pmd_internals *pmd, struct rte_flow *flow)
1338{
1339 int i;
1340
1341 if (!flow)
1342 return;
1343
1344 if (pmd->rss_enabled) {
1345 /* Close flow BPF file descriptors */
1346 for (i = 0; i < SEC_MAX; i++)
1347 if (flow->bpf_fd[i] != 0) {
1348 close(flow->bpf_fd[i]);
1349 flow->bpf_fd[i] = 0;
1350 }
1351
1352 /* Release the map key for this RSS rule */
1353 bpf_rss_key(KEY_CMD_RELEASE, &flow->key_idx);
1354 flow->key_idx = 0;
1355 }
1356
1357 /* Free flow allocated memory */
1358 rte_free(flow);
1359}
1360
1361/**
1362 * Create a flow.

Callers 2

tap_flow_createFunction · 0.85
tap_flow_destroy_pmdFunction · 0.85

Calls 3

bpf_rss_keyFunction · 0.85
rte_freeFunction · 0.85
closeFunction · 0.50

Tested by

no test coverage detected