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

Function flow_drv_rxq_flags_set

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

* Set the Rx queue flags (Mark/Flag and Tunnel Ptypes) according to the device * flow. * * @param[in] dev * Pointer to the Ethernet device structure. * @param[in] dev_handle * Pointer to device flow handle structure. */

Source from the content-addressed store, hash-verified

1671 * Pointer to device flow handle structure.
1672 */
1673void
1674flow_drv_rxq_flags_set(struct rte_eth_dev *dev,
1675 struct mlx5_flow_handle *dev_handle)
1676{
1677 struct mlx5_priv *priv = dev->data->dev_private;
1678 const int tunnel = !!(dev_handle->layers & MLX5_FLOW_LAYER_TUNNEL);
1679 struct mlx5_ind_table_obj *ind_tbl = NULL;
1680 unsigned int i;
1681
1682 if (dev_handle->fate_action == MLX5_FLOW_FATE_QUEUE) {
1683 struct mlx5_hrxq *hrxq;
1684
1685 hrxq = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_HRXQ],
1686 dev_handle->rix_hrxq);
1687 if (hrxq)
1688 ind_tbl = hrxq->ind_table;
1689 } else if (dev_handle->fate_action == MLX5_FLOW_FATE_SHARED_RSS) {
1690 struct mlx5_shared_action_rss *shared_rss;
1691
1692 shared_rss = mlx5_ipool_get
1693 (priv->sh->ipool[MLX5_IPOOL_RSS_SHARED_ACTIONS],
1694 dev_handle->rix_srss);
1695 if (shared_rss)
1696 ind_tbl = shared_rss->ind_tbl;
1697 }
1698 if (!ind_tbl)
1699 return;
1700 for (i = 0; i != ind_tbl->queues_n; ++i) {
1701 int idx = ind_tbl->queues[i];
1702 struct mlx5_rxq_ctrl *rxq_ctrl;
1703
1704 if (mlx5_is_external_rxq(dev, idx))
1705 continue;
1706 rxq_ctrl = mlx5_rxq_ctrl_get(dev, idx);
1707 MLX5_ASSERT(rxq_ctrl != NULL);
1708 if (rxq_ctrl == NULL)
1709 continue;
1710 /*
1711 * To support metadata register copy on Tx loopback,
1712 * this must be always enabled (metadata may arive
1713 * from other port - not from local flows only.
1714 */
1715 if (tunnel) {
1716 unsigned int j;
1717
1718 /* Increase the counter matching the flow. */
1719 for (j = 0; j != MLX5_FLOW_TUNNEL; ++j) {
1720 if ((tunnels_info[j].tunnel &
1721 dev_handle->layers) ==
1722 tunnels_info[j].tunnel) {
1723 rxq_ctrl->flow_tunnels_n[j]++;
1724 break;
1725 }
1726 }
1727 flow_rxq_tunnel_ptype_update(rxq_ctrl);
1728 }
1729 }
1730}

Callers 2

flow_rxq_flags_setFunction · 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