| 1875 | } |
| 1876 | |
| 1877 | static void |
| 1878 | ngbe_dev_overheat(struct rte_eth_dev *dev) |
| 1879 | { |
| 1880 | struct ngbe_hw *hw = ngbe_dev_hw(dev); |
| 1881 | s32 temp_state; |
| 1882 | |
| 1883 | temp_state = hw->mac.check_overtemp(hw); |
| 1884 | if (!temp_state) |
| 1885 | return; |
| 1886 | |
| 1887 | if (temp_state == NGBE_ERR_UNDERTEMP) { |
| 1888 | PMD_DRV_LOG(CRIT, "Network adapter has been started again, " |
| 1889 | "since the temperature has been back to normal state."); |
| 1890 | wr32m(hw, NGBE_PBRXCTL, NGBE_PBRXCTL_ENA, NGBE_PBRXCTL_ENA); |
| 1891 | ngbe_dev_set_link_up(dev); |
| 1892 | } else if (temp_state == NGBE_ERR_OVERTEMP) { |
| 1893 | PMD_DRV_LOG(CRIT, "Network adapter has been stopped because it has over heated."); |
| 1894 | wr32m(hw, NGBE_PBRXCTL, NGBE_PBRXCTL_ENA, 0); |
| 1895 | ngbe_dev_set_link_down(dev); |
| 1896 | } |
| 1897 | } |
| 1898 | |
| 1899 | /* return 0 means link status changed, -1 means not changed */ |
| 1900 | int |
no test coverage detected