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

Function flow_drv_rxq_flags_trim

dpdk/drivers/net/mlx5/mlx5_flow.c:1798–1851  ·  view source on GitHub ↗

* Clear the Rx queue flags (Mark/Flag and Tunnel Ptype) associated with the * device flow if no other flow uses it with the same kind of request. * * @param dev * Pointer to Ethernet device. * @param[in] dev_handle * Pointer to the device flow handle structure. */

Source from the content-addressed store, hash-verified

1796 * Pointer to the device flow handle structure.
1797 */
1798static void
1799flow_drv_rxq_flags_trim(struct rte_eth_dev *dev,
1800 struct mlx5_flow_handle *dev_handle)
1801{
1802 struct mlx5_priv *priv = dev->data->dev_private;
1803 const int tunnel = !!(dev_handle->layers & MLX5_FLOW_LAYER_TUNNEL);
1804 struct mlx5_ind_table_obj *ind_tbl = NULL;
1805 unsigned int i;
1806
1807 if (dev_handle->fate_action == MLX5_FLOW_FATE_QUEUE) {
1808 struct mlx5_hrxq *hrxq;
1809
1810 hrxq = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_HRXQ],
1811 dev_handle->rix_hrxq);
1812 if (hrxq)
1813 ind_tbl = hrxq->ind_table;
1814 } else if (dev_handle->fate_action == MLX5_FLOW_FATE_SHARED_RSS) {
1815 struct mlx5_shared_action_rss *shared_rss;
1816
1817 shared_rss = mlx5_ipool_get
1818 (priv->sh->ipool[MLX5_IPOOL_RSS_SHARED_ACTIONS],
1819 dev_handle->rix_srss);
1820 if (shared_rss)
1821 ind_tbl = shared_rss->ind_tbl;
1822 }
1823 if (!ind_tbl)
1824 return;
1825 MLX5_ASSERT(dev->data->dev_started);
1826 for (i = 0; i != ind_tbl->queues_n; ++i) {
1827 int idx = ind_tbl->queues[i];
1828 struct mlx5_rxq_ctrl *rxq_ctrl;
1829
1830 if (mlx5_is_external_rxq(dev, idx))
1831 continue;
1832 rxq_ctrl = mlx5_rxq_ctrl_get(dev, idx);
1833 MLX5_ASSERT(rxq_ctrl != NULL);
1834 if (rxq_ctrl == NULL)
1835 continue;
1836 if (tunnel) {
1837 unsigned int j;
1838
1839 /* Decrease the counter matching the flow. */
1840 for (j = 0; j != MLX5_FLOW_TUNNEL; ++j) {
1841 if ((tunnels_info[j].tunnel &
1842 dev_handle->layers) ==
1843 tunnels_info[j].tunnel) {
1844 rxq_ctrl->flow_tunnels_n[j]--;
1845 break;
1846 }
1847 }
1848 flow_rxq_tunnel_ptype_update(rxq_ctrl);
1849 }
1850 }
1851}
1852
1853/**
1854 * Clear the Rx queue flags (Mark/Flag and Tunnel Ptype) associated with the

Callers 1

flow_rxq_flags_trimFunction · 0.85

Calls 4

mlx5_ipool_getFunction · 0.85
mlx5_is_external_rxqFunction · 0.85
mlx5_rxq_ctrl_getFunction · 0.85

Tested by

no test coverage detected