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

Function mlx4_flow_sync

dpdk/drivers/net/mlx4/mlx4_flow.c:1533–1565  ·  view source on GitHub ↗

* Synchronize flow rules. * * This function synchronizes flow rules with the state of the device by * taking into account isolated mode and whether target queues are * configured. * * @param priv * Pointer to private structure. * @param[out] error * Perform verbose error reporting if not NULL. * * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */

Source from the content-addressed store, hash-verified

1531 * 0 on success, a negative errno value otherwise and rte_errno is set.
1532 */
1533int
1534mlx4_flow_sync(struct mlx4_priv *priv, struct rte_flow_error *error)
1535{
1536 struct rte_flow *flow;
1537 int ret;
1538
1539 /* Internal flow rules are guaranteed to come first in the list. */
1540 if (priv->isolated) {
1541 /*
1542 * Get rid of them in isolated mode, stop at the first
1543 * non-internal rule found.
1544 */
1545 for (flow = LIST_FIRST(&priv->flows);
1546 flow && flow->internal;
1547 flow = LIST_FIRST(&priv->flows))
1548 claim_zero(mlx4_flow_destroy(ETH_DEV(priv), flow,
1549 error));
1550 } else {
1551 /* Refresh internal rules. */
1552 ret = mlx4_flow_internal(priv, error);
1553 if (ret)
1554 return ret;
1555 }
1556 /* Toggle the remaining flow rules . */
1557 LIST_FOREACH(flow, &priv->flows, next) {
1558 ret = mlx4_flow_toggle(priv, flow, priv->started, error);
1559 if (ret)
1560 return ret;
1561 }
1562 if (!priv->started)
1563 MLX4_ASSERT(!priv->drop);
1564 return 0;
1565}
1566
1567/**
1568 * Clean up all flow rules.

Callers 9

mlx4_rxmode_toggleFunction · 0.85
mlx4_mac_addr_removeFunction · 0.85
mlx4_mac_addr_addFunction · 0.85
mlx4_set_mc_addr_listFunction · 0.85
mlx4_vlan_filter_setFunction · 0.85
mlx4_dev_configureFunction · 0.85
mlx4_dev_startFunction · 0.85
mlx4_dev_stopFunction · 0.85
mlx4_flow_isolateFunction · 0.85

Calls 3

mlx4_flow_destroyFunction · 0.85
mlx4_flow_internalFunction · 0.85
mlx4_flow_toggleFunction · 0.85

Tested by

no test coverage detected