src/dpdk/drivers/net/ixgbe/ixgbe_ethdev.c
static int
ixgbe_dev_set_link_down(struct rte_eth_dev *dev)
{
	struct ixgbe_hw *hw =
		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
	if (hw->mac.type == ixgbe_mac_82599EB) {
#ifdef RTE_LIBRTE_IXGBE_BYPASS
		if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) {
			/* Not suported in bypass mode */
			PMD_INIT_LOG(ERR, "Set link down is not supported "
				     "by device id 0x%x", hw->device_id);
			return -ENOTSUP;
		}
#endif
	}

	if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper) {
		/* Turn off the copper */
		ixgbe_set_phy_power(hw, false);
	} else {
		/* Turn off the laser */
		ixgbe_disable_tx_laser(hw);
		ixgbe_dev_link_update(dev, 0);
	}

	return 0;
}
/*
 * Set device link down: disable tx.
 */
Set device link down: disable tx.
Set device link down : disable tx .
static int
ixgbe_dev_set_link_down(struct rte_eth_dev *dev)
{
	struct ixgbe_hw *hw =
		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
	if (hw->mac.type == ixgbe_mac_82599EB) {
#ifdef RTE_LIBRTE_IXGBE_BYPASS
		if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) {
			PMD_INIT_LOG(ERR, "Set link down is not supported "
				     "by device id 0x%x", hw->device_id);
			return -ENOTSUP;
		}
#endif
	}
	if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper) {
		ixgbe_set_phy_power(hw, false);
	} else {
		ixgbe_disable_tx_laser(hw);
		ixgbe_dev_link_update(dev, 0);
	}
	return 0;
}
static int ixgbe_dev_set_link_down ( struct rte_eth_dev * dev ) { struct ixgbe_hw * hw = IXGBE_DEV_PRIVATE_TO_HW ( dev -> data -> dev_private ) ; if ( hw -> mac . type == ixgbe_mac_82599EB ) { #ifdef RTE_LIBRTE_IXGBE_BYPASS if ( hw -> device_id == IXGBE_DEV_ID_82599_BYPASS ) { PMD_INIT_LOG ( ERR , " " " " , hw -> device_id ) ; return - ENOTSUP ; } #endif } if ( hw -> mac . ops . get_media_type ( hw ) == ixgbe_media_type_copper ) { ixgbe_set_phy_power ( hw , false ) ; } else { ixgbe_disable_tx_laser ( hw ) ; ixgbe_dev_link_update ( dev , 0 ) ; } return 0 ; }
Set device link down: disable tx.
Set device link down : disable tx .
/* Not suported in bypass mode */ /* Turn off the copper */ /* Turn off the laser */