From nobody Thu Jul 27 21:53:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RBkzr5JRlz4ppHm; Thu, 27 Jul 2023 21:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RBkzr28dQz4N0s; Thu, 27 Jul 2023 21:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690494824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+eWdIwnKTgJa0Ub55rMa+d6+9jSozXmW88/9pWiLMRI=; b=SwgdmhXI6kNq5AWM8IcneprPGeR/12HHdVX30HhKCtWsrjJEoUzVDjXckcdMYijwnNimPH xqt7hBQco/jGxxgowrNA3zqGKpZUxSbJMfgDXupLW1j0eAZjop9auNdsv6JqQf2D7DmOK3 HC7/6yNrvV/V8TuxPiUJubSR4aXcCzY0NHH1wt8OMaI1xpjhUuGraETTDu8PnjcV+ksNaw 0h/cMRpAII1poAF1LAIE+wUXJ27ac6fD4xzajjLsrSAM42SYO6v18w9a6r6TTa8gjutTaX d4OR68EyNEPGYX3We/AdW/3TMOtAjsTfndW2U4QeEmI5sGO7xUmyR1Ex3gyI5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690494824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+eWdIwnKTgJa0Ub55rMa+d6+9jSozXmW88/9pWiLMRI=; b=DezG6q14g3nE+pxkTTvp1NZo/YLylzsjNxLcRje3cGGfw6V4URtCLSWQghiO/AN7V+4kD/ 2+9g6mp2Z89bfL2jk/UakjmcAzi+BEVrP6flMGUl/bypNkRXYU6yoUFnQk55cSzGq7Tsl8 rHK2Bed8v+pM6vwl33Fk0MHVtDbM9ei5UDNiVJxf/ZM049UVuWbFubvaXpxDn8IscS7jGY 07wA4KNqhv4h0l60mpdNk+L3Vb7ufXM4605XjahzbBya52RKzjGnmg7u7K12VjcORGEaZe 3effC3B2BGy19SvNI67E6rLBQQv+/Mwd2ol+xf1XiePRaMqjsXUY0bIoPU+kKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690494824; a=rsa-sha256; cv=none; b=ts+UeMAnrdTJaWXAQXHYy4JNJXYYCTJ+BHvpqds573u7ru7lnxasYBhMek8coa1b1f0oj3 jmdSHcpFZZiF0cIngUqUWkivnCjj4tG+YQ8g/lrR8+VGY8nrc787IN4Zubg0/15bZuyRBW HnR8YsR8S67KUXS100YgrSHwUurxW1HzJkXttjG+m013x64u9t3VTftQA2NufCtW4rjVpI OiwGGoXWvxfuwov6R6pFKVrf4Pzc3/4eA3niSXbVRJLo8RILcJU7LHQnecmSNmW4oCk6u3 b2ZzT7Qwc3GNr/cFi0L8IFpdI3v69LS7qzUzXudtRrA+Spj4filVfD/cIuSEVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RBkzr1F1GzR2V; Thu, 27 Jul 2023 21:53:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36RLriFx052707; Thu, 27 Jul 2023 21:53:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36RLriUW052706; Thu, 27 Jul 2023 21:53:44 GMT (envelope-from git) Date: Thu, 27 Jul 2023 21:53:44 GMT Message-Id: <202307272153.36RLriUW052706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: e30d990e1a6f - stable/13 - ixl: port ice's atomic API to ixl List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e30d990e1a6fbbed11bfbfa9b130d7a41f28ee8c Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=e30d990e1a6fbbed11bfbfa9b130d7a41f28ee8c commit e30d990e1a6fbbed11bfbfa9b130d7a41f28ee8c Author: Piotr Kubaj AuthorDate: 2023-06-06 15:30:18 +0000 Commit: Eric Joyner CommitDate: 2023-07-27 21:48:34 +0000 ixl: port ice's atomic API to ixl Differential Revision: https://reviews.freebsd.org/D40532 Approved by: erj (cherry picked from commit b8f51b8c5423af0795429836a00f2a968e791f6e) --- sys/dev/ixl/if_ixl.c | 21 +++++----- sys/dev/ixl/ixl_pf.h | 34 +++++++++------- sys/dev/ixl/ixl_pf_iflib.c | 16 ++++---- sys/dev/ixl/ixl_pf_main.c | 98 ++++++++++++++++++++++++++++++++++++++-------- 4 files changed, 118 insertions(+), 51 deletions(-) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 985843d546fa..65f6a400569c 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -602,14 +602,14 @@ ixl_if_attach_pre(if_ctx_t ctx) if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 3)) || (pf->hw.aq.fw_maj_ver < 4)) { i40e_aq_stop_lldp(hw, true, false, NULL); - pf->state |= IXL_PF_STATE_FW_LLDP_DISABLED; + ixl_set_state(&pf->state, IXL_STATE_FW_LLDP_DISABLED); } /* Try enabling Energy Efficient Ethernet (EEE) mode */ if (i40e_enable_eee(hw, true) == I40E_SUCCESS) - atomic_set_32(&pf->state, IXL_PF_STATE_EEE_ENABLED); + ixl_set_state(&pf->state, IXL_STATE_EEE_ENABLED); else - atomic_clear_32(&pf->state, IXL_PF_STATE_EEE_ENABLED); + ixl_clear_state(&pf->state, IXL_STATE_EEE_ENABLED); /* Get MAC addresses from hardware */ i40e_get_mac_addr(hw, hw->mac.addr); @@ -634,11 +634,11 @@ ixl_if_attach_pre(if_ctx_t ctx) /* Query device FW LLDP status */ if (i40e_get_fw_lldp_status(hw, &lldp_status) == I40E_SUCCESS) { if (lldp_status == I40E_GET_FW_LLDP_STATUS_DISABLED) { - atomic_set_32(&pf->state, - IXL_PF_STATE_FW_LLDP_DISABLED); + ixl_set_state(&pf->state, + IXL_STATE_FW_LLDP_DISABLED); } else { - atomic_clear_32(&pf->state, - IXL_PF_STATE_FW_LLDP_DISABLED); + ixl_clear_state(&pf->state, + IXL_STATE_FW_LLDP_DISABLED); } } @@ -777,7 +777,7 @@ ixl_if_attach_post(if_ctx_t ctx) * Driver may have been reloaded. Ensure that the link state * is consistent with current settings. */ - ixl_set_link(pf, (pf->state & IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) != 0); + ixl_set_link(pf, ixl_test_state(&pf->state, IXL_STATE_LINK_ACTIVE_ON_DOWN)); hw->phy.get_link_info = true; i40e_get_link_status(hw, &pf->link_up); @@ -1037,8 +1037,7 @@ ixl_if_stop(if_ctx_t ctx) * e.g. on MTU change. */ if ((if_getflags(ifp) & IFF_UP) == 0 && - (atomic_load_acq_32(&pf->state) & - IXL_PF_STATE_LINK_ACTIVE_ON_DOWN) == 0) + !ixl_test_state(&pf->state, IXL_STATE_LINK_ACTIVE_ON_DOWN)) ixl_set_link(pf, false); } @@ -1419,7 +1418,7 @@ ixl_if_update_admin_status(if_ctx_t ctx) if (!i40e_check_asq_alive(&pf->hw)) return; - if (pf->state & IXL_PF_STATE_MDD_PENDING) + if (ixl_test_state(&pf->state, IXL_STATE_MDD_PENDING)) ixl_handle_mdd_event(pf); ixl_process_adminq(pf, &pending); diff --git a/sys/dev/ixl/ixl_pf.h b/sys/dev/ixl/ixl_pf.h index 888949245133..6a73f5acc838 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -76,26 +76,26 @@ enum ixl_i2c_access_method_t { }; /* Used in struct ixl_pf's state field */ -enum ixl_pf_state { - IXL_PF_STATE_RECOVERY_MODE = (1 << 0), - IXL_PF_STATE_RESETTING = (1 << 1), - IXL_PF_STATE_MDD_PENDING = (1 << 2), - IXL_PF_STATE_PF_RESET_REQ = (1 << 3), - IXL_PF_STATE_VF_RESET_REQ = (1 << 4), - IXL_PF_STATE_PF_CRIT_ERR = (1 << 5), - IXL_PF_STATE_CORE_RESET_REQ = (1 << 6), - IXL_PF_STATE_GLOB_RESET_REQ = (1 << 7), - IXL_PF_STATE_EMP_RESET_REQ = (1 << 8), - IXL_PF_STATE_FW_LLDP_DISABLED = (1 << 9), - IXL_PF_STATE_EEE_ENABLED = (1 << 10), - IXL_PF_STATE_LINK_ACTIVE_ON_DOWN = (1 << 11), +enum ixl_state { + IXL_STATE_RECOVERY_MODE = 0, + IXL_STATE_RESETTING = 1, + IXL_STATE_MDD_PENDING = 2, + IXL_STATE_PF_RESET_REQ = 3, + IXL_STATE_VF_RESET_REQ = 4, + IXL_STATE_PF_CRIT_ERR = 5, + IXL_STATE_CORE_RESET_REQ = 6, + IXL_STATE_GLOB_RESET_REQ = 7, + IXL_STATE_EMP_RESET_REQ = 8, + IXL_STATE_FW_LLDP_DISABLED = 9, + IXL_STATE_EEE_ENABLED = 10, + IXL_STATE_LINK_ACTIVE_ON_DOWN = 11, }; #define IXL_PF_IN_RECOVERY_MODE(pf) \ - ((atomic_load_acq_32(&pf->state) & IXL_PF_STATE_RECOVERY_MODE) != 0) + ixl_test_state(&pf->state, IXL_STATE_RECOVERY_MODE) #define IXL_PF_IS_RESETTING(pf) \ - ((atomic_load_acq_32(&pf->state) & IXL_PF_STATE_RESETTING) != 0) + ixl_test_state(&pf->state, IXL_STATE_RESETTING) struct ixl_vf { struct ixl_vsi vsi; @@ -284,6 +284,10 @@ struct ixl_pf { #define ixl_dbg_iov(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_IOV, s, ##__VA_ARGS__) /* PF-only function declarations */ +void ixl_set_state(volatile u32 *s, enum ixl_state bit); +void ixl_clear_state(volatile u32 *s, enum ixl_state bit); +bool ixl_test_state(volatile u32 *s, enum ixl_state bit); +u32 ixl_testandset_state(volatile u32 *s, enum ixl_state bit); int ixl_setup_interface(device_t, struct ixl_pf *); void ixl_print_nvm_cmd(device_t, struct i40e_nvm_access *); diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index 6ea20389c547..b70388bd6f6e 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -158,7 +158,7 @@ ixl_msix_adminq(void *arg) if (reg & I40E_PFINT_ICR0_MAL_DETECT_MASK) { mask &= ~I40E_PFINT_ICR0_ENA_MAL_DETECT_MASK; - atomic_set_32(&pf->state, IXL_PF_STATE_MDD_PENDING); + ixl_set_state(&pf->state, IXL_STATE_MDD_PENDING); do_task = TRUE; } @@ -185,7 +185,7 @@ ixl_msix_adminq(void *arg) } device_printf(dev, "Reset Requested! (%s)\n", reset_type); /* overload admin queue task to check reset progress */ - atomic_set_int(&pf->state, IXL_PF_STATE_RESETTING); + ixl_set_state(&pf->state, IXL_STATE_RESETTING); do_task = TRUE; } @@ -202,8 +202,8 @@ ixl_msix_adminq(void *arg) /* Checks against the conditions above */ if (reg & IXL_ICR0_CRIT_ERR_MASK) { mask &= ~IXL_ICR0_CRIT_ERR_MASK; - atomic_set_32(&pf->state, - IXL_PF_STATE_PF_RESET_REQ | IXL_PF_STATE_PF_CRIT_ERR); + ixl_set_state(&pf->state, + IXL_STATE_PF_RESET_REQ | IXL_STATE_PF_CRIT_ERR); do_task = TRUE; } @@ -1037,11 +1037,11 @@ ixl_rebuild_hw_structs_after_reset(struct ixl_pf *pf, bool is_up) /* Query device FW LLDP status */ if (i40e_get_fw_lldp_status(hw, &lldp_status) == I40E_SUCCESS) { if (lldp_status == I40E_GET_FW_LLDP_STATUS_DISABLED) { - atomic_set_32(&pf->state, - IXL_PF_STATE_FW_LLDP_DISABLED); + ixl_set_state(&pf->state, + IXL_STATE_FW_LLDP_DISABLED); } else { - atomic_clear_32(&pf->state, - IXL_PF_STATE_FW_LLDP_DISABLED); + ixl_clear_state(&pf->state, + IXL_STATE_FW_LLDP_DISABLED); } } diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 0b4e69a5ce37..5cf686c5b7cf 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -116,6 +116,71 @@ static char *ixl_fec_string[3] = { "None" }; +/* Functions for setting and checking driver state. Note the functions take + * bit positions, not bitmasks. The atomic_set_32 and atomic_clear_32 + * operations require bitmasks. This can easily lead to programming error, so + * we provide wrapper functions to avoid this. + */ + +/** + * ixl_set_state - Set the specified state + * @s: the state bitmap + * @bit: the state to set + * + * Atomically update the state bitmap with the specified bit set. + */ +inline void +ixl_set_state(volatile u32 *s, enum ixl_state bit) +{ + /* atomic_set_32 expects a bitmask */ + atomic_set_32(s, BIT(bit)); +} + +/** + * ixl_clear_state - Clear the specified state + * @s: the state bitmap + * @bit: the state to clear + * + * Atomically update the state bitmap with the specified bit cleared. + */ +inline void +ixl_clear_state(volatile u32 *s, enum ixl_state bit) +{ + /* atomic_clear_32 expects a bitmask */ + atomic_clear_32(s, BIT(bit)); +} + +/** + * ixl_test_state - Test the specified state + * @s: the state bitmap + * @bit: the bit to test + * + * Return true if the state is set, false otherwise. Use this only if the flow + * does not need to update the state. If you must update the state as well, + * prefer ixl_testandset_state. + */ +inline bool +ixl_test_state(volatile u32 *s, enum ixl_state bit) +{ + return !!(*s & BIT(bit)); +} + +/** + * ixl_testandset_state - Test and set the specified state + * @s: the state bitmap + * @bit: the bit to test + * + * Atomically update the state bitmap, setting the specified bit. Returns the + * previous value of the bit. + */ +inline u32 +ixl_testandset_state(volatile u32 *s, enum ixl_state bit) +{ + /* atomic_testandset_32 expects a bit position, as opposed to bitmask + expected by other atomic functions */ + return atomic_testandset_32(s, bit); +} + MALLOC_DEFINE(M_IXL, "ixl", "ixl driver allocations"); /* @@ -210,7 +275,7 @@ ixl_pf_reset(struct ixl_pf *pf) fw_mode = ixl_get_fw_mode(pf); ixl_dbg_info(pf, "%s: before PF reset FW mode: 0x%08x\n", __func__, fw_mode); if (fw_mode == IXL_FW_MODE_RECOVERY) { - atomic_set_32(&pf->state, IXL_PF_STATE_RECOVERY_MODE); + ixl_set_state(&pf->state, IXL_STATE_RECOVERY_MODE); /* Don't try to reset device if it's in recovery mode */ return (0); } @@ -224,7 +289,7 @@ ixl_pf_reset(struct ixl_pf *pf) fw_mode = ixl_get_fw_mode(pf); ixl_dbg_info(pf, "%s: after PF reset FW mode: 0x%08x\n", __func__, fw_mode); if (fw_mode == IXL_FW_MODE_RECOVERY) { - atomic_set_32(&pf->state, IXL_PF_STATE_RECOVERY_MODE); + ixl_set_state(&pf->state, IXL_STATE_RECOVERY_MODE); return (0); } @@ -387,7 +452,7 @@ retry: } /* Keep link active by default */ - atomic_set_32(&pf->state, IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + ixl_set_state(&pf->state, IXL_STATE_LINK_ACTIVE_ON_DOWN); /* Print a subset of the capability information. */ device_printf(dev, @@ -1869,7 +1934,7 @@ ixl_handle_mdd_event(struct ixl_pf *pf) ixl_handle_tx_mdd_event(pf); ixl_handle_rx_mdd_event(pf); - atomic_clear_32(&pf->state, IXL_PF_STATE_MDD_PENDING); + ixl_clear_state(&pf->state, IXL_STATE_MDD_PENDING); /* re-enable mdd interrupt cause */ reg = rd32(hw, I40E_PFINT_ICR0_ENA); @@ -1937,7 +2002,7 @@ ixl_handle_empr_reset(struct ixl_pf *pf) if (!IXL_PF_IN_RECOVERY_MODE(pf) && ixl_get_fw_mode(pf) == IXL_FW_MODE_RECOVERY) { - atomic_set_32(&pf->state, IXL_PF_STATE_RECOVERY_MODE); + ixl_set_state(&pf->state, IXL_STATE_RECOVERY_MODE); device_printf(pf->dev, "Firmware recovery mode detected. Limiting functionality. Refer to Intel(R) Ethernet Adapters and Devices User Guide for details on firmware recovery mode.\n"); pf->link_up = FALSE; @@ -1946,7 +2011,7 @@ ixl_handle_empr_reset(struct ixl_pf *pf) ixl_rebuild_hw_structs_after_reset(pf, is_up); - atomic_clear_32(&pf->state, IXL_PF_STATE_RESETTING); + ixl_clear_state(&pf->state, IXL_STATE_RESETTING); } void @@ -4464,7 +4529,7 @@ ixl_start_fw_lldp(struct ixl_pf *pf) } } - atomic_clear_32(&pf->state, IXL_PF_STATE_FW_LLDP_DISABLED); + ixl_clear_state(&pf->state, IXL_STATE_FW_LLDP_DISABLED); return (0); } @@ -4501,7 +4566,7 @@ ixl_stop_fw_lldp(struct ixl_pf *pf) } i40e_aq_set_dcb_parameters(hw, true, NULL); - atomic_set_32(&pf->state, IXL_PF_STATE_FW_LLDP_DISABLED); + ixl_set_state(&pf->state, IXL_STATE_FW_LLDP_DISABLED); return (0); } @@ -4511,7 +4576,7 @@ ixl_sysctl_fw_lldp(SYSCTL_HANDLER_ARGS) struct ixl_pf *pf = (struct ixl_pf *)arg1; int state, new_state, error = 0; - state = new_state = ((pf->state & IXL_PF_STATE_FW_LLDP_DISABLED) == 0); + state = new_state = !ixl_test_state(&pf->state, IXL_STATE_FW_LLDP_DISABLED); /* Read in new mode */ error = sysctl_handle_int(oidp, &new_state, 0, req); @@ -4537,7 +4602,7 @@ ixl_sysctl_eee_enable(SYSCTL_HANDLER_ARGS) enum i40e_status_code cmd_status; /* Init states' values */ - state = new_state = (!!(pf->state & IXL_PF_STATE_EEE_ENABLED)); + state = new_state = ixl_test_state(&pf->state, IXL_STATE_EEE_ENABLED); /* Get requested mode */ sysctl_handle_status = sysctl_handle_int(oidp, &new_state, 0, req); @@ -4554,9 +4619,9 @@ ixl_sysctl_eee_enable(SYSCTL_HANDLER_ARGS) /* Save new state or report error */ if (!cmd_status) { if (new_state == 0) - atomic_clear_32(&pf->state, IXL_PF_STATE_EEE_ENABLED); + ixl_clear_state(&pf->state, IXL_STATE_EEE_ENABLED); else - atomic_set_32(&pf->state, IXL_PF_STATE_EEE_ENABLED); + ixl_set_state(&pf->state, IXL_STATE_EEE_ENABLED); } else if (cmd_status == I40E_ERR_CONFIG) return (EPERM); else @@ -4571,17 +4636,16 @@ ixl_sysctl_set_link_active(SYSCTL_HANDLER_ARGS) struct ixl_pf *pf = (struct ixl_pf *)arg1; int error, state; - state = !!(atomic_load_acq_32(&pf->state) & - IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + state = ixl_test_state(&pf->state, IXL_STATE_LINK_ACTIVE_ON_DOWN); error = sysctl_handle_int(oidp, &state, 0, req); if ((error) || (req->newptr == NULL)) return (error); if (state == 0) - atomic_clear_32(&pf->state, IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + ixl_clear_state(&pf->state, IXL_STATE_LINK_ACTIVE_ON_DOWN); else - atomic_set_32(&pf->state, IXL_PF_STATE_LINK_ACTIVE_ON_DOWN); + ixl_set_state(&pf->state, IXL_STATE_LINK_ACTIVE_ON_DOWN); return (0); } @@ -4628,7 +4692,7 @@ ixl_sysctl_do_pf_reset(SYSCTL_HANDLER_ARGS) return (error); /* Initiate the PF reset later in the admin task */ - atomic_set_32(&pf->state, IXL_PF_STATE_PF_RESET_REQ); + ixl_set_state(&pf->state, IXL_STATE_PF_RESET_REQ); return (error); }