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

Function ixgbe_dev_interrupt_action

dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:4664–4724  ·  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

4662 * - On failure, a negative value.
4663 */
4664static int
4665ixgbe_dev_interrupt_action(struct rte_eth_dev *dev)
4666{
4667 struct ixgbe_interrupt *intr =
4668 IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
4669 int64_t timeout;
4670 struct ixgbe_hw *hw =
4671 IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
4672
4673 PMD_DRV_LOG(DEBUG, "intr action type %d", intr->flags);
4674
4675 if (intr->flags & IXGBE_FLAG_MAILBOX) {
4676 ixgbe_pf_mbx_process(dev);
4677 intr->flags &= ~IXGBE_FLAG_MAILBOX;
4678 }
4679
4680 if (intr->flags & IXGBE_FLAG_PHY_INTERRUPT) {
4681 ixgbe_handle_lasi(hw);
4682 intr->flags &= ~IXGBE_FLAG_PHY_INTERRUPT;
4683 }
4684
4685 if (intr->flags & IXGBE_FLAG_NEED_LINK_UPDATE) {
4686 struct rte_eth_link link;
4687
4688 /* get the link status before link update, for predicting later */
4689 rte_eth_linkstatus_get(dev, &link);
4690
4691 ixgbe_dev_link_update(dev, 0);
4692
4693 /* likely to up */
4694 if (!link.link_status)
4695 /* handle it 1 sec later, wait it being stable */
4696 timeout = IXGBE_LINK_UP_CHECK_TIMEOUT;
4697 /* likely to down */
4698 else
4699 /* handle it 4 sec later, wait it being stable */
4700 timeout = IXGBE_LINK_DOWN_CHECK_TIMEOUT;
4701
4702 ixgbe_dev_link_status_print(dev);
4703
4704 /* Don't program delayed handler if LSC interrupt is disabled.
4705 * It means one is already programmed.
4706 */
4707 if (intr->mask & IXGBE_EIMS_LSC) {
4708 if (rte_eal_alarm_set(timeout * 1000,
4709 ixgbe_dev_interrupt_delayed_handler, (void *)dev) < 0)
4710 PMD_DRV_LOG(ERR, "Error setting alarm");
4711 else {
4712 /* remember original mask */
4713 intr->mask_original = intr->mask;
4714 /* only disable lsc interrupt */
4715 intr->mask &= ~IXGBE_EIMS_LSC;
4716 }
4717 }
4718 }
4719
4720 PMD_DRV_LOG(DEBUG, "enable intr immediately");
4721 ixgbe_enable_intr(dev);

Callers 1

Calls 7

ixgbe_pf_mbx_processFunction · 0.85
ixgbe_handle_lasiFunction · 0.85
rte_eth_linkstatus_getFunction · 0.85
ixgbe_dev_link_updateFunction · 0.85
ixgbe_enable_intrFunction · 0.85
rte_eal_alarm_setFunction · 0.50

Tested by

no test coverage detected