mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-08-21 16:31:14 +02:00

Our initial VF control implementation was focused on providing a very minimal support for the VF_STATE_NOTIFY events just to meet GuC requirements, without tracking a VF state or doing any expected actions (like cleanup in case of the FLR notification). Try to improve this by defining set of VF state machines, each responsible for processing one activity (PAUSE, RESUME, STOP or FLR). All required steps defined by the VF state machine are then executed by the PF worker from the dedicated workqueue. Any external requests or notifications simply try to transition between the states to trigger a work and then wait for that work to finish. Some predefined default timeouts are used to avoid changing existing API calls, but it should be easy to extend the control API to also accept specific timeout values. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Piotr Piórkowski <piotr.piorkowski@intel.com> Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240828210809.1528-5-michal.wajdeczko@intel.com
32 lines
880 B
C
32 lines
880 B
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2023-2024 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _XE_GT_SRIOV_PF_CONTROL_H_
|
|
#define _XE_GT_SRIOV_PF_CONTROL_H_
|
|
|
|
#include <linux/errno.h>
|
|
#include <linux/types.h>
|
|
|
|
struct xe_gt;
|
|
|
|
int xe_gt_sriov_pf_control_init(struct xe_gt *gt);
|
|
void xe_gt_sriov_pf_control_restart(struct xe_gt *gt);
|
|
|
|
int xe_gt_sriov_pf_control_pause_vf(struct xe_gt *gt, unsigned int vfid);
|
|
int xe_gt_sriov_pf_control_resume_vf(struct xe_gt *gt, unsigned int vfid);
|
|
int xe_gt_sriov_pf_control_stop_vf(struct xe_gt *gt, unsigned int vfid);
|
|
int xe_gt_sriov_pf_control_trigger_flr(struct xe_gt *gt, unsigned int vfid);
|
|
|
|
#ifdef CONFIG_PCI_IOV
|
|
int xe_gt_sriov_pf_control_process_guc2pf(struct xe_gt *gt, const u32 *msg, u32 len);
|
|
#else
|
|
static inline int xe_gt_sriov_pf_control_process_guc2pf(struct xe_gt *gt, const u32 *msg, u32 len)
|
|
{
|
|
return -EPROTO;
|
|
}
|
|
#endif
|
|
|
|
#endif
|