| 182 | |
| 183 | |
| 184 | static void |
| 185 | pcmd_link_callback(__rte_unused void *ptr_params, |
| 186 | __rte_unused struct cmdline *ctx, |
| 187 | __rte_unused void *ptr_data) |
| 188 | { |
| 189 | uint16_t id_port; |
| 190 | int stat_port; |
| 191 | |
| 192 | RTE_ETH_FOREACH_DEV(id_port) { |
| 193 | if (!rte_eth_dev_is_valid_port(id_port)) |
| 194 | continue; |
| 195 | stat_port = rte_ethtool_get_link(id_port); |
| 196 | switch (stat_port) { |
| 197 | case 0: |
| 198 | printf("Port %i: Down\n", id_port); |
| 199 | break; |
| 200 | case 1: |
| 201 | printf("Port %i: Up\n", id_port); |
| 202 | break; |
| 203 | default: |
| 204 | printf("Port %i: Error getting link status\n", |
| 205 | id_port |
| 206 | ); |
| 207 | break; |
| 208 | } |
| 209 | } |
| 210 | printf("\n"); |
| 211 | } |
| 212 | |
| 213 | |
| 214 | static void |
nothing calls this directly
no test coverage detected