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

Function eth_igb_interrupt_get_status

dpdk/drivers/net/e1000/igb_ethdev.c:2846–2869  ·  view source on GitHub ↗

* It reads ICR and gets interrupt causes, check it and set a bit flag * to update link status. * * @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

2844 * - On failure, a negative value.
2845 */
2846static int
2847eth_igb_interrupt_get_status(struct rte_eth_dev *dev)
2848{
2849 uint32_t icr;
2850 struct e1000_hw *hw =
2851 E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
2852 struct e1000_interrupt *intr =
2853 E1000_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
2854
2855 igb_intr_disable(dev);
2856
2857 /* read-on-clear nic registers here */
2858 icr = E1000_READ_REG(hw, E1000_ICR);
2859
2860 intr->flags = 0;
2861 if (icr & E1000_ICR_LSC) {
2862 intr->flags |= E1000_FLAG_NEED_LINK_UPDATE;
2863 }
2864
2865 if (icr & E1000_ICR_VMMB)
2866 intr->flags |= E1000_FLAG_MAILBOX;
2867
2868 return 0;
2869}
2870
2871/*
2872 * It executes link_update after knowing an interrupt is present.

Callers 1

Calls 1

igb_intr_disableFunction · 0.85

Tested by

no test coverage detected