src/dpdk/drivers/net/mlx5/mlx5_trigger.c
int
mlx5_hairpin_bind(struct rte_eth_dev *dev, uint16_t rx_port)
{
	int ret = 0;
	uint16_t p, pp;
	struct mlx5_priv *priv = dev->data->dev_private;

	/*
	 * If the Rx port has no hairpin configuration with the current port,
	 * the binding will be skipped in the called function of single port.
	 * Device started status will be checked only before the queue
	 * information updating.
	 */
	if (rx_port == RTE_MAX_ETHPORTS) {
		MLX5_ETH_FOREACH_DEV(p, priv->pci_dev) {
			ret = mlx5_hairpin_bind_single_port(dev, p);
			if (ret != 0)
				goto unbind;
		}
		return ret;
	} else {
		return mlx5_hairpin_bind_single_port(dev, rx_port);
	}
unbind:
	MLX5_ETH_FOREACH_DEV(pp, priv->pci_dev)
		if (pp < p)
			mlx5_hairpin_unbind_single_port(dev, pp);
	return ret;
}
/*
 * Bind hairpin ports, Rx could be all ports when using RTE_MAX_ETHPORTS.
 * @see mlx5_hairpin_bind_single_port()
 */
Bind hairpin ports, Rx could be all ports when using RTE_MAX_ETHPORTS.
Bind hairpin ports Rx could be all ports when using RTE_MAX_ETHPORTS .
int
mlx5_hairpin_bind(struct rte_eth_dev *dev, uint16_t rx_port)
{
	int ret = 0;
	uint16_t p, pp;
	struct mlx5_priv *priv = dev->data->dev_private;
	if (rx_port == RTE_MAX_ETHPORTS) {
		MLX5_ETH_FOREACH_DEV(p, priv->pci_dev) {
			ret = mlx5_hairpin_bind_single_port(dev, p);
			if (ret != 0)
				goto unbind;
		}
		return ret;
	} else {
		return mlx5_hairpin_bind_single_port(dev, rx_port);
	}
unbind:
	MLX5_ETH_FOREACH_DEV(pp, priv->pci_dev)
		if (pp < p)
			mlx5_hairpin_unbind_single_port(dev, pp);
	return ret;
}
int mlx5_hairpin_bind ( struct rte_eth_dev * dev , uint16_t rx_port ) { int ret = 0 ; uint16_t p , pp ; struct mlx5_priv * priv = dev -> data -> dev_private ; if ( rx_port == RTE_MAX_ETHPORTS ) { MLX5_ETH_FOREACH_DEV ( p , priv -> pci_dev ) { ret = mlx5_hairpin_bind_single_port ( dev , p ) ; if ( ret != 0 ) goto unbind ; } return ret ; } else { return mlx5_hairpin_bind_single_port ( dev , rx_port ) ; } unbind : MLX5_ETH_FOREACH_DEV ( pp , priv -> pci_dev ) if ( pp < p ) mlx5_hairpin_unbind_single_port ( dev , pp ) ; return ret ; }
Bind hairpin ports, Rx could be all ports when using RTE_MAX_ETHPORTS.
Bind hairpin ports Rx could be all ports when using RTE_MAX_ETHPORTS .
/*
	 * If the Rx port has no hairpin configuration with the current port,
	 * the binding will be skipped in the called function of single port.
	 * Device started status will be checked only before the queue
	 * information updating.
	 */