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

Function mlx4_dev_set_link

dpdk/drivers/net/mlx4/mlx4_ethdev.c:273–288  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

271 * 0 on success, negative errno value otherwise and rte_errno is set.
272 */
273static int
274mlx4_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.

Callers 2

mlx4_dev_set_link_downFunction · 0.85
mlx4_dev_set_link_upFunction · 0.85

Calls 1

mlx4_set_flagsFunction · 0.85

Tested by

no test coverage detected