src/dpdk/drivers/net/mlx4/mlx4_ethdev.c
int
mlx4_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
{
	struct mlx4_priv *priv = dev->data->dev_private;
	struct ifreq ifr;
	struct ethtool_pauseparam ethpause = {
		.cmd = ETHTOOL_SPAUSEPARAM,
	};
	int ret;

	ifr.ifr_data = (void *)&ethpause;
	ethpause.autoneg = fc_conf->autoneg;
	if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
	    (fc_conf->mode & RTE_FC_RX_PAUSE))
		ethpause.rx_pause = 1;
	else
		ethpause.rx_pause = 0;
	if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
	    (fc_conf->mode & RTE_FC_TX_PAUSE))
		ethpause.tx_pause = 1;
	else
		ethpause.tx_pause = 0;
	if (mlx4_ifreq(priv, SIOCETHTOOL, &ifr)) {
		ret = rte_errno;
		WARN("ioctl(SIOCETHTOOL, ETHTOOL_SPAUSEPARAM)"
		     " failed: %s",
		     strerror(rte_errno));
		goto out;
	}
	ret = 0;
out:
	MLX4_ASSERT(ret >= 0);
	return -ret;
}
/**
 * DPDK callback to modify flow control parameters.
 *
 * @param dev
 *   Pointer to Ethernet device structure.
 * @param[in] fc_conf
 *   Flow control parameters.
 *
 * @return
 *   0 on success, negative errno value otherwise and rte_errno is set.
 */
DPDK callback to modify flow control parameters.
@param dev
Pointer to Ethernet device structure.
@param[in] fc_conf
Flow control parameters.

@return
0 on success, negative errno value otherwise and rte_errno is set.
DPDK callback to modify flow control parameters . @param dev Pointer to Ethernet device structure . @param [ in ] fc_conf Flow control parameters . @return 0 on success negative errno value otherwise and rte_errno is set .
int
mlx4_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
{
	struct mlx4_priv *priv = dev->data->dev_private;
	struct ifreq ifr;
	struct ethtool_pauseparam ethpause = {
		.cmd = ETHTOOL_SPAUSEPARAM,
	};
	int ret;
	ifr.ifr_data = (void *)&ethpause;
	ethpause.autoneg = fc_conf->autoneg;
	if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
	    (fc_conf->mode & RTE_FC_RX_PAUSE))
		ethpause.rx_pause = 1;
	else
		ethpause.rx_pause = 0;
	if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
	    (fc_conf->mode & RTE_FC_TX_PAUSE))
		ethpause.tx_pause = 1;
	else
		ethpause.tx_pause = 0;
	if (mlx4_ifreq(priv, SIOCETHTOOL, &ifr)) {
		ret = rte_errno;
		WARN("ioctl(SIOCETHTOOL, ETHTOOL_SPAUSEPARAM)"
		     " failed: %s",
		     strerror(rte_errno));
		goto out;
	}
	ret = 0;
out:
	MLX4_ASSERT(ret >= 0);
	return -ret;
}
int mlx4_flow_ctrl_set ( struct rte_eth_dev * dev , struct rte_eth_fc_conf * fc_conf ) { struct mlx4_priv * priv = dev -> data -> dev_private ; struct ifreq ifr ; struct ethtool_pauseparam ethpause = { . cmd = ETHTOOL_SPAUSEPARAM , } ; int ret ; ifr . ifr_data = ( void * ) & ethpause ; ethpause . autoneg = fc_conf -> autoneg ; if ( ( ( fc_conf -> mode & RTE_FC_FULL ) == RTE_FC_FULL ) || ( fc_conf -> mode & RTE_FC_RX_PAUSE ) ) ethpause . rx_pause = 1 ; else ethpause . rx_pause = 0 ; if ( ( ( fc_conf -> mode & RTE_FC_FULL ) == RTE_FC_FULL ) || ( fc_conf -> mode & RTE_FC_TX_PAUSE ) ) ethpause . tx_pause = 1 ; else ethpause . tx_pause = 0 ; if ( mlx4_ifreq ( priv , SIOCETHTOOL , & ifr ) ) { ret = rte_errno ; WARN ( " " " " , strerror ( rte_errno ) ) ; goto out ; } ret = 0 ; out : MLX4_ASSERT ( ret >= 0 ) ; return - ret ; }
DPDK callback to modify flow control parameters.
DPDK callback to modify flow control parameters .