主权项 |
1. A method for implementing dynamic resizing of a Single Root Input/Output Virtualization (SRIOV) virtual function in a SRIOV adapter in a virtualized system in a computer system, the SRIOV adapter comprising a plurality of virtual functions (VFs), and a physical function (PF) containing said plurality of virtual functions (VFs); the computer system comprising a processor; at least one logical partition (LPAR) coupled to the processor; a virtual function (VF) device driver provided with the LPAR; a management function and a hypervisor managing allocation of resources to each LPAR and managing functions associated with the SRIOV adapter including the SRIOV PF and VFs; said method comprising:
enabling the virtual function (VF) to be dynamically resizable; determining SRIOV virtual function (VF) usage for the SRIOV virtual function (VF) to be resized based on adapter statistics; and generating a resize event to selectively scale-up or scale down VF resources based upon the SRIOV virtual function (VF) usage; allocating, by the hypervisor, new direct memory access (DMA) and memory management input output (MIMO) buffers for the VF; performing the resize event, the resize event including the steps of:
checking, by the VF driver, a current VF state and determining whether the VF is busy;in response to determining that the VF is not busy,
resizing, by the VF driver, the internal structures of said VF driver, notifying the hypervisor of the completion of the resizing; andin response to the notification, said hypervisor freeing old DMA and MMIO buffers allocated to the VF and issuing a command to use the new DMA and MIMO buffers,in response to determining that the VF is busy,
notifying the hypervisor of an inability to complete the resize event based on determining that a predetermined wait threshold has been reached, andin response to the notification, releasing, by said hypervisor, the new DMA and MIMO buffers. |