* Change the link state (UP / DOWN). * * @param priv * Pointer to Ethernet device private data. * @param up * Nonzero for link up, otherwise link down. * * @return * 0 on success, negative errno value otherwise and rte_errno is set. */
| 271 | * 0 on success, negative errno value otherwise and rte_errno is set. |
| 272 | */ |
| 273 | static int |
| 274 | mlx4_dev_set_link(struct mlx4_priv *priv, int up) |
| 275 | { |
| 276 | int err; |
| 277 | |
| 278 | if (up) { |
| 279 | err = mlx4_set_flags(priv, ~IFF_UP, IFF_UP); |
| 280 | if (err) |
| 281 | return err; |
| 282 | } else { |
| 283 | err = mlx4_set_flags(priv, ~IFF_UP, ~IFF_UP); |
| 284 | if (err) |
| 285 | return err; |
| 286 | } |
| 287 | return 0; |
| 288 | } |
| 289 | |
| 290 | /** |
| 291 | * DPDK callback to bring the link DOWN. |
no test coverage detected