* Free the flow opened file descriptors and allocated memory * * @param[in] flow * Pointer to the flow to free * */
| 1334 | * |
| 1335 | */ |
| 1336 | static void |
| 1337 | tap_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. |
no test coverage detected