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

Function port_flow_flush

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

Remove all flow rules. */

Source from the content-addressed store, hash-verified

3693
3694/** Remove all flow rules. */
3695int
3696port_flow_flush(portid_t port_id)
3697{
3698 struct rte_flow_error error;
3699 struct rte_port *port;
3700 int ret = 0;
3701
3702 if (port_id_is_invalid(port_id, ENABLED_WARN) ||
3703 port_id == (portid_t)RTE_PORT_ALL)
3704 return -EINVAL;
3705
3706 port = &ports[port_id];
3707
3708 if (port->flow_list == NULL)
3709 return ret;
3710
3711 /* Poisoning to make sure PMDs update it in case of error. */
3712 memset(&error, 0x44, sizeof(error));
3713 if (rte_flow_flush(port_id, &error)) {
3714 port_flow_complain(&error);
3715 }
3716
3717 while (port->flow_list) {
3718 struct port_flow *pf = port->flow_list->next;
3719
3720 free(port->flow_list);
3721 port->flow_list = pf;
3722 }
3723 return ret;
3724}
3725
3726/** Dump flow rules. */
3727int

Callers 3

stop_portFunction · 0.85
cmd_flow_parsedFunction · 0.85

Calls 5

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

Tested by 2

stop_portFunction · 0.68