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

Function mlx4_flow_ctrl_get

dpdk/drivers/net/mlx4/mlx4_ethdev.c:846–877  ·  view source on GitHub ↗

* DPDK callback to get flow control status. * * @param dev * Pointer to Ethernet device structure. * @param[out] fc_conf * Flow control output buffer. * * @return * 0 on success, negative errno value otherwise and rte_errno is set. */

Source from the content-addressed store, hash-verified

844 * 0 on success, negative errno value otherwise and rte_errno is set.
845 */
846int
847mlx4_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
848{
849 struct mlx4_priv *priv = dev->data->dev_private;
850 struct ifreq ifr;
851 struct ethtool_pauseparam ethpause = {
852 .cmd = ETHTOOL_GPAUSEPARAM,
853 };
854 int ret;
855
856 ifr.ifr_data = (void *)&ethpause;
857 if (mlx4_ifreq(priv, SIOCETHTOOL, &ifr)) {
858 ret = rte_errno;
859 WARN("ioctl(SIOCETHTOOL, ETHTOOL_GPAUSEPARAM)"
860 " failed: %s",
861 strerror(rte_errno));
862 goto out;
863 }
864 fc_conf->autoneg = ethpause.autoneg;
865 if (ethpause.rx_pause && ethpause.tx_pause)
866 fc_conf->mode = RTE_ETH_FC_FULL;
867 else if (ethpause.rx_pause)
868 fc_conf->mode = RTE_ETH_FC_RX_PAUSE;
869 else if (ethpause.tx_pause)
870 fc_conf->mode = RTE_ETH_FC_TX_PAUSE;
871 else
872 fc_conf->mode = RTE_ETH_FC_NONE;
873 ret = 0;
874out:
875 MLX4_ASSERT(ret >= 0);
876 return -ret;
877}
878
879/**
880 * DPDK callback to modify flow control parameters.

Callers

nothing calls this directly

Calls 1

mlx4_ifreqFunction · 0.85

Tested by

no test coverage detected