src/dpdk/drivers/net/atlantic/atl_ethdev.c
static int
atl_dev_set_link_up(struct rte_eth_dev *dev)
{
	struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
	uint32_t link_speeds = dev->data->dev_conf.link_speeds;
	uint32_t speed_mask = 0;

	if (link_speeds == ETH_LINK_SPEED_AUTONEG) {
		speed_mask = hw->aq_nic_cfg->link_speed_msk;
	} else {
		if (link_speeds & ETH_LINK_SPEED_10G)
			speed_mask |= AQ_NIC_RATE_10G;
		if (link_speeds & ETH_LINK_SPEED_5G)
			speed_mask |= AQ_NIC_RATE_5G;
		if (link_speeds & ETH_LINK_SPEED_1G)
			speed_mask |= AQ_NIC_RATE_1G;
		if (link_speeds & ETH_LINK_SPEED_2_5G)
			speed_mask |=  AQ_NIC_RATE_2G5;
		if (link_speeds & ETH_LINK_SPEED_100M)
			speed_mask |= AQ_NIC_RATE_100M;
	}

	return hw->aq_fw_ops->set_link_speed(hw, speed_mask);
}
/*
 * Set device link up: enable tx.
 */
Set device link up: enable tx.
Set device link up : enable tx .
static int
atl_dev_set_link_up(struct rte_eth_dev *dev)
{
	struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
	uint32_t link_speeds = dev->data->dev_conf.link_speeds;
	uint32_t speed_mask = 0;
	if (link_speeds == ETH_LINK_SPEED_AUTONEG) {
		speed_mask = hw->aq_nic_cfg->link_speed_msk;
	} else {
		if (link_speeds & ETH_LINK_SPEED_10G)
			speed_mask |= AQ_NIC_RATE_10G;
		if (link_speeds & ETH_LINK_SPEED_5G)
			speed_mask |= AQ_NIC_RATE_5G;
		if (link_speeds & ETH_LINK_SPEED_1G)
			speed_mask |= AQ_NIC_RATE_1G;
		if (link_speeds & ETH_LINK_SPEED_2_5G)
			speed_mask |=  AQ_NIC_RATE_2G5;
		if (link_speeds & ETH_LINK_SPEED_100M)
			speed_mask |= AQ_NIC_RATE_100M;
	}
	return hw->aq_fw_ops->set_link_speed(hw, speed_mask);
}
static int atl_dev_set_link_up ( struct rte_eth_dev * dev ) { struct aq_hw_s * hw = ATL_DEV_PRIVATE_TO_HW ( dev -> data -> dev_private ) ; uint32_t link_speeds = dev -> data -> dev_conf . link_speeds ; uint32_t speed_mask = 0 ; if ( link_speeds == ETH_LINK_SPEED_AUTONEG ) { speed_mask = hw -> aq_nic_cfg -> link_speed_msk ; } else { if ( link_speeds & ETH_LINK_SPEED_10G ) speed_mask |= AQ_NIC_RATE_10G ; if ( link_speeds & ETH_LINK_SPEED_5G ) speed_mask |= AQ_NIC_RATE_5G ; if ( link_speeds & ETH_LINK_SPEED_1G ) speed_mask |= AQ_NIC_RATE_1G ; if ( link_speeds & ETH_LINK_SPEED_2_5G ) speed_mask |= AQ_NIC_RATE_2G5 ; if ( link_speeds & ETH_LINK_SPEED_100M ) speed_mask |= AQ_NIC_RATE_100M ; } return hw -> aq_fw_ops -> set_link_speed ( hw , speed_mask ) ; }
Set device link up: enable tx.
Set device link up : enable tx .