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

Function igb_reset_swfw_lock

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

Source from the content-addressed store, hash-verified

613}
614
615static int
616igb_reset_swfw_lock(struct e1000_hw *hw)
617{
618 int ret_val;
619
620 /*
621 * Do mac ops initialization manually here, since we will need
622 * some function pointers set by this call.
623 */
624 ret_val = e1000_init_mac_params(hw);
625 if (ret_val)
626 return ret_val;
627
628 /*
629 * SMBI lock should not fail in this early stage. If this is the case,
630 * it is due to an improper exit of the application.
631 * So force the release of the faulty lock.
632 */
633 if (e1000_get_hw_semaphore_generic(hw) < 0) {
634 PMD_DRV_LOG(DEBUG, "SMBI lock released");
635 }
636 e1000_put_hw_semaphore_generic(hw);
637
638 if (hw->mac.ops.acquire_swfw_sync != NULL) {
639 uint16_t mask;
640
641 /*
642 * Phy lock should not fail in this early stage. If this is the case,
643 * it is due to an improper exit of the application.
644 * So force the release of the faulty lock.
645 */
646 mask = E1000_SWFW_PHY0_SM << hw->bus.func;
647 if (hw->bus.func > E1000_FUNC_1)
648 mask <<= 2;
649 if (hw->mac.ops.acquire_swfw_sync(hw, mask) < 0) {
650 PMD_DRV_LOG(DEBUG, "SWFW phy%d lock released",
651 hw->bus.func);
652 }
653 hw->mac.ops.release_swfw_sync(hw, mask);
654
655 /*
656 * This one is more tricky since it is common to all ports; but
657 * swfw_sync retries last long enough (1s) to be almost sure that if
658 * lock can not be taken it is due to an improper lock of the
659 * semaphore.
660 */
661 mask = E1000_SWFW_EEP_SM;
662 if (hw->mac.ops.acquire_swfw_sync(hw, mask) < 0) {
663 PMD_DRV_LOG(DEBUG, "SWFW common locks released");
664 }
665 hw->mac.ops.release_swfw_sync(hw, mask);
666 }
667
668 return E1000_SUCCESS;
669}
670
671/* Remove all ntuple filters of the device */
672static int igb_ntuple_filter_uninit(struct rte_eth_dev *eth_dev)

Callers 2

eth_igb_dev_initFunction · 0.85
eth_igb_closeFunction · 0.85

Calls 3

e1000_init_mac_paramsFunction · 0.85

Tested by

no test coverage detected