* Set device link up. */
| 246 | * Set device link up. |
| 247 | */ |
| 248 | int 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. |
nothing calls this directly
no test coverage detected