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

Function ngbe_dev_interrupt_action

dpdk/drivers/net/ngbe/ngbe_ethdev.c:2248–2283  ·  view source on GitHub ↗

* It executes link_update after knowing an interrupt occurred. * * @param dev * Pointer to struct rte_eth_dev. * * @return * - On success, zero. * - On failure, a negative value. */

Source from the content-addressed store, hash-verified

2246 * - On failure, a negative value.
2247 */
2248static int
2249ngbe_dev_interrupt_action(struct rte_eth_dev *dev)
2250{
2251 struct ngbe_interrupt *intr = ngbe_dev_intr(dev);
2252
2253 PMD_DRV_LOG(DEBUG, "intr action type %d", intr->flags);
2254
2255 if (intr->flags & NGBE_FLAG_MAILBOX) {
2256 ngbe_pf_mbx_process(dev);
2257 intr->flags &= ~NGBE_FLAG_MAILBOX;
2258 }
2259
2260 if (intr->flags & NGBE_FLAG_NEED_LINK_UPDATE) {
2261 struct rte_eth_link link;
2262
2263 /*get the link status before link update, for predicting later*/
2264 rte_eth_linkstatus_get(dev, &link);
2265
2266 ngbe_dev_link_update(dev, 0);
2267 intr->flags &= ~NGBE_FLAG_NEED_LINK_UPDATE;
2268 ngbe_dev_link_status_print(dev);
2269 if (dev->data->dev_link.link_speed != link.link_speed)
2270 rte_eth_dev_callback_process(dev,
2271 RTE_ETH_EVENT_INTR_LSC, NULL);
2272 }
2273
2274 if (intr->flags & NGBE_FLAG_OVERHEAT) {
2275 ngbe_dev_overheat(dev);
2276 intr->flags &= ~NGBE_FLAG_OVERHEAT;
2277 }
2278
2279 PMD_DRV_LOG(DEBUG, "enable intr immediately");
2280 ngbe_enable_intr(dev);
2281
2282 return 0;
2283}
2284
2285/**
2286 * Interrupt handler triggered by NIC for handling

Callers 1

Calls 8

ngbe_dev_intrFunction · 0.85
ngbe_pf_mbx_processFunction · 0.85
rte_eth_linkstatus_getFunction · 0.85
ngbe_dev_link_updateFunction · 0.85
ngbe_dev_overheatFunction · 0.85
ngbe_enable_intrFunction · 0.85

Tested by

no test coverage detected