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

Function ixgbe_swfw_lock_reset

dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:1016–1044  ·  view source on GitHub ↗

* Ensure that all locks are released before first NVM or PHY access */

Source from the content-addressed store, hash-verified

1014 * Ensure that all locks are released before first NVM or PHY access
1015 */
1016static void
1017ixgbe_swfw_lock_reset(struct ixgbe_hw *hw)
1018{
1019 uint16_t mask;
1020
1021 /*
1022 * Phy lock should not fail in this early stage. If this is the case,
1023 * it is due to an improper exit of the application.
1024 * So force the release of the faulty lock. Release of common lock
1025 * is done automatically by swfw_sync function.
1026 */
1027 mask = IXGBE_GSSR_PHY0_SM << hw->bus.func;
1028 if (ixgbe_acquire_swfw_semaphore(hw, mask) < 0) {
1029 PMD_DRV_LOG(DEBUG, "SWFW phy%d lock released", hw->bus.func);
1030 }
1031 ixgbe_release_swfw_semaphore(hw, mask);
1032
1033 /*
1034 * These ones are more tricky since they are common to all ports; but
1035 * swfw_sync retries last long enough (1s) to be almost sure that if
1036 * lock can not be taken it is due to an improper lock of the
1037 * semaphore.
1038 */
1039 mask = IXGBE_GSSR_EEP_SM | IXGBE_GSSR_MAC_CSR_SM | IXGBE_GSSR_SW_MNG_SM;
1040 if (ixgbe_acquire_swfw_semaphore(hw, mask) < 0) {
1041 PMD_DRV_LOG(DEBUG, "SWFW common locks released");
1042 }
1043 ixgbe_release_swfw_semaphore(hw, mask);
1044}
1045
1046static void
1047ixgbe_parse_devargs(struct ixgbe_adapter *adapter,

Callers 2

eth_ixgbe_dev_initFunction · 0.85
ixgbe_dev_closeFunction · 0.85

Calls 2

Tested by

no test coverage detected