IP Library Granted Patent US 12675338
Granted Patent B2
US 12675338 · App. 18/328,716 · Granted Jul 7, 2026

Dynamic assignment of device queues to virtual functions to provide to virtual machines

Inventors: Bharat Sukhwani (Sudbury, MA); Martin Ohmacht (Yorktown Heights, NY); Hubertus Franke (Cortlandt Manor, NY); Sameh Asaad (Briarcliff Manor, NY); Scott Smith (Brighton, MI); Deming Chen (Champaign, IL)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F9/5077G06F9/505
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12675338
App. No.
18/328,716
Granted
Jul 7, 2026
Kind
B2
Abstract

Provided are a computer product, system, and method for dynamic assignment of device queues to virtual functions to provide to virtual machines. Queues are assigned to a virtual function to access the physical functions of the device. The virtual function is provided to a virtual machine to use to access the physical functions of the device. A determination is made of a utilization of the queues assigned to the virtual function accessed by the virtual machine. A number of the queues assigned to the virtual functions for requests submitted by the virtual machine is changed in response to the determined utilization.

Claims (62)

1 . A computer product for assigning queues to virtual functions used to access physical functions of a device, the computer product comprising at least one of a computer readable storage medium having computer readable program code executed by a processor and a hardware device having hardware logic that when operable performs operations, the operations comprising:

assigning queues to a virtual function to access the physical functions of the device, wherein assigning the queues allocates physical resources on the device to the virtual function;

providing the virtual function to a virtual machine to use to access the physical functions of the device;

using a first queue assignment scheme of a plurality of queue assignment schemes to load balance requests from the virtual machine to the queues of the virtual function;

determining a utilization of the queues assigned to the virtual function accessed by the virtual machine;

assigning an additional queue to the virtual function in response to determining a first utilization of the queues assigned to the virtual function, wherein assigning the additional queue allocates additional physical resources on the device to the virtual function; and

selecting a second queue assignment scheme of the plurality of queue assignment schemes to load balance requests from the virtual machine to the queues and the additional queue in response to determining a second utilization of the queues and the additional queue assigned to the virtual function.

2 . The computer product of claim 1 , wherein the operations further comprise:

receiving a request from the virtual machine for the virtual function and a requested number of queues; and

determining whether the requested number of queues are unassigned to virtual functions, wherein the assigning the queues to the virtual function comprises assigning unassigned queues, up to the requested number of queues, to the virtual function.

3 . The computer product of claim 2 , wherein the virtual function comprises a first virtual function and the virtual machine comprises a first virtual machine, wherein the operations further comprise:

determining whether a second virtual function is assigned an unused queue in response to determining that the requested number of queues are not unassigned; and

reassigning the unused queue to the first virtual function in response to determining that the second virtual function is assigned the unused queue.

4 . The computer product of claim 3 , wherein the operations further comprise:

maintaining a queue table indicating queues as one of assigned to one of a plurality of virtual functions and unassigned; and

indicating an unassigned queue or an unused queue as assigned to the first virtual function by updating an entry in the queue table for the unassigned queue or the unused queue to indicate the first virtual function.

5 . The computer product of claim 1 , wherein the first queue assignment scheme comprises a first hash function, wherein the second queue assignment scheme comprises a second hash function, and wherein the queue assignment schemes comprise a plurality of hash functions used to load balance selection of the queues assigned to the virtual function to assign received requests, wherein the first and the second hash functions use different load balancing algorithms to assign requests to the queues.

6 . The computer product of claim 5 , wherein the second utilization comprises that the queues assigned to the virtual function include at least one queue having a number of requests exceeding a threshold number and at least one other queue assigned to the virtual function having a number of requests falling below the threshold number.

7 . The computer product of claim 1 , wherein the determining the first utilization comprises determining that all of the queues assigned to the virtual function have a number of requests exceeding a threshold number, and wherein the assigning the additional queue to the virtual function comprises:

determining whether there is an unassigned queue not assigned to any virtual function; and

assigning the unassigned queue to the virtual function in response to determining there is the unassigned queue.

8 . The computer product of claim 1 , wherein the virtual function comprises a first virtual function, wherein the first utilization of the queues comprises all of the queues assigned to the first virtual function have a number of requests exceeding a threshold number, and wherein the assigning the additional queue to the first virtual function comprises reassigning an unused queue from a second virtual function to the first virtual function.

9 . The computer program product of claim 1 , wherein the first utilization of the queues indicates a first overfilled condition of the queues and the second utilization indicates a second overfilled condition of the queues, wherein the second overfilled condition indicates fewer overfilled queues than the first overfilled condition.

10 . A system for assigning queues to virtual functions used to access physical functions of a device, comprising:

a hardware device having hardware logic that when operable performs operations, the operations comprising:

assigning queues to a virtual function to access the physical functions of the device, wherein assigning the queues allocates physical resources on the device to the virtual function;

providing the virtual function to a virtual machine to use to access the physical functions of the device;

using a first queue assignment scheme of a plurality of queue assignment schemes to load balance requests from the virtual machine to the queues of the virtual function;

determining a utilization of the queues assigned to the virtual function accessed by the virtual machine;

assigning an additional queue to the virtual function in response to determining a first utilization of the queues assigned to the virtual function, wherein assigning the additional queue allocates additional physical resources on the device to the virtual function; and

selecting a second queue assignment scheme of the plurality of queue assignment schemes to load balance requests from the virtual machine to the queues and the additional queue in response to determining a second utilization of the queues and the additional queue assigned to the virtual function.

11 . The system of claim 10 , wherein the operations further comprise:

receiving a request from the virtual machine for the virtual function and a requested number of queues; and

determining whether the requested number of queues are unassigned to virtual functions, wherein the assigning the queues to the virtual function comprises assigning unassigned queues, up to the requested number of queues, to the virtual function.

12 . The system of claim 11 , wherein the virtual function comprises a first virtual function and the virtual machine comprises a first virtual machine, wherein the operations further comprise:

determining whether a second virtual function is assigned an unused queue in response to determining that the requested number of queues are not unassigned; and

reassigning the unused queue to the first virtual function in response to determining that the second virtual function is assigned the unused queue.

13 . The system of claim 10 , wherein the first queue assignment scheme comprises a first hash function, wherein the second queue assignment scheme comprises a second hash function, and wherein the queue assignment schemes comprise a plurality of hash functions used to load balance selection of the queues assigned to the virtual function to assign received requests, wherein the first and the second hash functions use different load balancing algorithms to assign requests to the queues.

14 . The system of claim 10 , wherein the determining the first utilization comprises determining that all of the queues assigned to the virtual function have a number of requests exceeding a threshold number, and wherein the assigning the additional queue to the virtual function comprises:

determining whether there is an unassigned queue not assigned to any virtual function; and

assigning the unassigned queue to the virtual function in response to determining there is the unassigned queue.

15 . The system of claim 10 , wherein the virtual function comprises a first virtual function, wherein the first utilization of the queues comprises all of the queues assigned to the first virtual function have a number of requests exceeding a threshold number, and wherein the assigning the additional queue to the first virtual function comprises reassigning an unused queue from a second virtual function to the first virtual function.

16 . The system of claim 10 , wherein the first utilization of the queues indicates a first overfilled condition of the queues and the second utilization indicates a second overfilled condition of the queues, wherein the second overfilled condition indicates fewer overfilled queues than the first overfilled condition.

17 . A method for assigning queues to virtual functions used to access physical functions of a device, comprising:

assigning queues to a virtual function to access the physical functions of the device, wherein assigning the queues allocates physical resources on the device to the virtual function;

providing the virtual function to a virtual machine to use to access the physical functions of the device;

using a first queue assignment scheme of a plurality of queue assignment schemes to load balance requests from the virtual machine to the queues of the virtual function;

determining a utilization of the queues assigned to the virtual function accessed by the virtual machine;

assigning an additional queue to the virtual function in response to determining a first utilization of the queues assigned to the virtual function, wherein assigning the additional queue allocates additional physical resources on the device to the virtual function; and

selecting a second queue assignment scheme of the plurality of queue assignment schemes to load balance requests from the virtual machine to the queues and the additional queue in response to determining a second utilization of the queues and the additional queue assigned to the virtual function.

18 . The method of claim 17 , comprising:

receiving a request from the virtual machine for the virtual function and a requested number of queues; and

determining whether the requested number of queues are unassigned to virtual functions, wherein the assigning the queues to the virtual function comprises assigning unassigned queues, up to the requested number of queues, to the virtual function.

19 . The method of claim 18 , wherein the virtual function comprises a first virtual function and the virtual machine comprises a first virtual machine, further comprising:

determining whether a second virtual function is assigned an unused queue in response to determining that the requested number of queues are not unassigned; and

reassigning the unused queue to the first virtual function in response to determining that the second virtual function is assigned the unused queue.

20 . The method of claim 17 , wherein the first queue assignment scheme comprises a first hash function, wherein the second queue assignment scheme comprises a second hash function, and wherein the queue assignment schemes comprise a plurality of hash functions used to load balance selection of the queues assigned to the virtual function to assign received requests, wherein the first and the second hash functions use different load balancing algorithms to assign requests to the queues.

21 . The method of claim 17 , wherein the determining the first utilization comprises determining that all of the queues assigned to the virtual function have a number of requests exceeding a threshold number, and wherein the assigning the additional queue to the virtual function comprises:

determining whether there is an unassigned queue not assigned to any virtual function; and

assigning the unassigned queue to the virtual function in response to determining there is the unassigned queue.

22 . The method of claim 17 , wherein the virtual function comprises a first virtual function, wherein the first utilization of the queues comprises all of the queues assigned to the first virtual function have a number of requests exceeding a threshold number and wherein the assigning the additional queue to the first virtual function comprises reassigning an unused queue from a second virtual function to the first virtual function.

23 . The method of claim 17 , wherein the first utilization of the queues indicates a first overfilled condition of the queues and the second utilization indicates a second overfilled condition of the queues, wherein the second overfilled condition indicates fewer overfilled queues than the first overfilled condition.