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

Function ixgbe_dev_set_link_down

dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:3026–3061  ·  view source on GitHub ↗

* Set device link down: disable tx. */

Source from the content-addressed store, hash-verified

3024 * Set device link down: disable tx.
3025 */
3026static int
3027ixgbe_dev_set_link_down(struct rte_eth_dev *dev)
3028{
3029 struct ixgbe_hw *hw =
3030 IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
3031
3032 /*
3033 * This function calls into the base driver, which in turn will use
3034 * function pointers, which are not guaranteed to be valid in secondary
3035 * processes, so avoid using this function in secondary processes.
3036 */
3037 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
3038 return -E_RTE_SECONDARY;
3039
3040 if (hw->mac.type == ixgbe_mac_82599EB) {
3041#ifdef RTE_LIBRTE_IXGBE_BYPASS
3042 if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) {
3043 /* Not supported in bypass mode */
3044 PMD_INIT_LOG(ERR, "Set link down is not supported "
3045 "by device id 0x%x", hw->device_id);
3046 return -ENOTSUP;
3047 }
3048#endif
3049 }
3050
3051 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper) {
3052 /* Turn off the copper */
3053 ixgbe_set_phy_power(hw, false);
3054 } else {
3055 /* Turn off the laser */
3056 ixgbe_disable_tx_laser(hw);
3057 ixgbe_dev_link_update(dev, 0);
3058 }
3059
3060 return 0;
3061}
3062
3063/*
3064 * Reset and stop device.

Callers

nothing calls this directly

Calls 4

rte_eal_process_typeFunction · 0.85
ixgbe_set_phy_powerFunction · 0.85
ixgbe_disable_tx_laserFunction · 0.85
ixgbe_dev_link_updateFunction · 0.85

Tested by

no test coverage detected