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

Function port_flow_template_table_destroy

dpdk/app/test-pmd/config.c:2619–2663  ·  view source on GitHub ↗

Destroy table */

Source from the content-addressed store, hash-verified

2617
2618/** Destroy table */
2619int
2620port_flow_template_table_destroy(portid_t port_id,
2621 uint32_t n, const uint32_t *table)
2622{
2623 struct rte_port *port;
2624 struct port_table **tmp;
2625 int ret = 0;
2626
2627 if (port_id_is_invalid(port_id, ENABLED_WARN) ||
2628 port_id == (portid_t)RTE_PORT_ALL)
2629 return -EINVAL;
2630 port = &ports[port_id];
2631 tmp = &port->table_list;
2632 while (*tmp) {
2633 uint32_t i;
2634
2635 for (i = 0; i != n; ++i) {
2636 struct rte_flow_error error;
2637 struct port_table *pt = *tmp;
2638
2639 if (table[i] != pt->id)
2640 continue;
2641 /*
2642 * Poisoning to make sure PMDs update it in case
2643 * of error.
2644 */
2645 memset(&error, 0x33, sizeof(error));
2646
2647 if (pt->table &&
2648 rte_flow_template_table_destroy(port_id,
2649 pt->table,
2650 &error)) {
2651 ret = port_flow_complain(&error);
2652 continue;
2653 }
2654 *tmp = pt->next;
2655 printf("Template table #%u destroyed\n", pt->id);
2656 free(pt);
2657 break;
2658 }
2659 if (i == n)
2660 tmp = &(*tmp)->next;
2661 }
2662 return ret;
2663}
2664
2665/** Flush table */
2666int

Callers 2

cmd_flow_parsedFunction · 0.85

Calls 6

port_id_is_invalidFunction · 0.85
memsetFunction · 0.85
port_flow_complainFunction · 0.70
printfFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected