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

Function cxgbe_dev_set_link_up

dpdk/drivers/net/cxgbe/cxgbe_ethdev.c:248–272  ·  view source on GitHub ↗

* Set device link up. */

Source from the content-addressed store, hash-verified

246 * Set device link up.
247 */
248int cxgbe_dev_set_link_up(struct rte_eth_dev *dev)
249{
250 struct port_info *pi = dev->data->dev_private;
251 struct adapter *adapter = pi->adapter;
252 unsigned int work_done, budget = 32;
253 struct sge *s = &adapter->sge;
254 int ret;
255
256 if (!s->fw_evtq.desc)
257 return -ENOMEM;
258
259 /* Flush all link events */
260 cxgbe_poll(&s->fw_evtq, NULL, budget, &work_done);
261
262 /* If link already up, nothing to do */
263 if (pi->link_cfg.link_ok)
264 return 0;
265
266 ret = cxgbe_set_link_status(pi, true);
267 if (ret)
268 return ret;
269
270 cxgbe_dev_link_update(dev, 1);
271 return 0;
272}
273
274/**
275 * Set device link down.

Callers

nothing calls this directly

Calls 3

cxgbe_pollFunction · 0.85
cxgbe_set_link_statusFunction · 0.85
cxgbe_dev_link_updateFunction · 0.85

Tested by

no test coverage detected