summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/ice/ice_vf_mbx.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2024-12-02 11:53:34 +1000
committerDave Airlie <airlied@redhat.com>2024-12-02 11:53:34 +1000
commit9ee603b619a6fcc030b46012a900b67e0041b90d (patch)
tree00bf3ba8d87c6720ba1f7de62ce6ef4dd0c5c371 /drivers/net/ethernet/intel/ice/ice_vf_mbx.c
parent25961511c559ed13db76df3ae5ee0b7f43d209e8 (diff)
parent40384c840ea1944d7c5a392e8975ed088ecf0b37 (diff)
Merge remote-tracking branch 'drm/drm-next' into drm-tip
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_vf_mbx.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_vf_mbx.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_vf_mbx.c b/drivers/net/ethernet/intel/ice/ice_vf_mbx.c
index 40cb4ba0789c..75c8113e58ee 100644
--- a/drivers/net/ethernet/intel/ice/ice_vf_mbx.c
+++ b/drivers/net/ethernet/intel/ice/ice_vf_mbx.c
@@ -211,6 +211,38 @@ ice_mbx_detect_malvf(struct ice_hw *hw, struct ice_mbx_vf_info *vf_info,
}
/**
+ * ice_mbx_vf_dec_trig_e830 - Decrements the VF mailbox queue counter
+ * @hw: pointer to the HW struct
+ * @event: pointer to the control queue receive event
+ *
+ * This function triggers to decrement the counter
+ * MBX_VF_IN_FLIGHT_MSGS_AT_PF_CNT when the driver replenishes
+ * the buffers at the PF mailbox queue.
+ */
+void ice_mbx_vf_dec_trig_e830(const struct ice_hw *hw,
+ const struct ice_rq_event_info *event)
+{
+ u16 vfid = le16_to_cpu(event->desc.retval);
+
+ wr32(hw, E830_MBX_VF_DEC_TRIG(vfid), 1);
+}
+
+/**
+ * ice_mbx_vf_clear_cnt_e830 - Clear the VF mailbox queue count
+ * @hw: pointer to the HW struct
+ * @vf_id: VF ID in the PF space
+ *
+ * This function clears the counter MBX_VF_IN_FLIGHT_MSGS_AT_PF_CNT, and should
+ * be called when a VF is created and on VF reset.
+ */
+void ice_mbx_vf_clear_cnt_e830(const struct ice_hw *hw, u16 vf_id)
+{
+ u32 reg = rd32(hw, E830_MBX_VF_IN_FLIGHT_MSGS_AT_PF_CNT(vf_id));
+
+ wr32(hw, E830_MBX_VF_DEC_TRIG(vf_id), reg);
+}
+
+/**
* ice_mbx_vf_state_handler - Handle states of the overflow algorithm
* @hw: pointer to the HW struct
* @mbx_data: pointer to structure containing mailbox data