Page fault support for virtual machine network accelerators
Systems and methods for supporting page faults for virtual machine network accelerators. In one implementation, a processing device may receive, at a network accelerator device of a computer system, from a network, a first incoming packet and a second incoming packet. Responsive to receiving a first notification that an attempt to store the first incoming packet at a first buffer of a plurality of buffers associated with the network accelerator device caused a page fault, the processing device may store the first incoming packet at a second buffer and append a first identifier of the first buffer to a faulty buffer data structure. Responsive to receiving a second notification indicating a resolution of the page fault, the processing device may remove the first identifier from the faulty buffer data structure. The processing device may store the second incoming packet at the first buffer. The processing device may forward, to a driver of the network accelerator device, a second identifier of the second buffer and the first identifier of the first buffer.
1 . A method comprising:
receiving, by a network accelerator device of a computer system, from a network, a first incoming packet and a second incoming packet;
responsive to receiving a first notification that an attempt to store the first incoming packet at a first buffer of a plurality of buffers associated with the network accelerator device caused a page fault:
storing the first incoming packet at a second buffer of the plurality of buffers; and
appending a first identifier of the first buffer to a faulty buffer data structure;
responsive to receiving a second notification indicating a resolution of the page fault, removing the first identifier from the faulty buffer data structure;
storing the second incoming packet at the first buffer; and
forwarding, to a driver of the network accelerator device, a second identifier of the second buffer and the first identifier of the first buffer, wherein the plurality of buffers are allocated by the driver of the network accelerator device, and wherein the driver of the network accelerator device is executed by a guest operating system of a virtual machine running on the computer system.
2 . The method of claim 1 , further comprising:
attempting to translate a virtual address associated with the first buffer to physical address identifying a memory page in a physical memory of the computer system; and
responsive to successfully translating the virtual address to the physical address, storing the first incoming packet at the memory page.
3 . The method of claim 2 , wherein the page fault is generated responsive to the memory page of the first buffer being not present in the physical memory of the computer system.
4 . The method of claim 1 , wherein storing the first incoming packet at the second buffer further comprises:
retrieving, from a data structure that stores a plurality of buffer identifiers, a second buffer identifier that follows a first buffer identifier identifying the first buffer, and wherein the second buffer identifier identifies the second buffer.
5 . The method of claim 1 , wherein storing the second incoming packet at the first buffer further comprises:
retrieving, from a data structure that stores a plurality of buffer identifiers, a first buffer identifier that precedes a second buffer identifier identifying the second buffer, and wherein the first buffer identifier identifies the first buffer.
6 . The method of claim 1 , further comprising:
appending the second identifier of the second buffer and the first identifier of the first buffer to a data structure that stores an order in which the buffers are to be consumed by the computer system.
7 . A system comprising:
a memory; and
a processing device operatively coupled to the memory, the processing device to:
receive, at a network accelerator device of a computer system, form a network, a first incoming packet and a second incoming packet;
responsive to receiving a first notification that an attempt to store the first incoming packet at a first buffer of a plurality of buffers associated with the network accelerator device caused a page fault:
store the first incoming packet at a second buffer of the plurality of buffers; and
append a first identifier of the first buffer to a faulty buffer data structure;
responsive to receiving a second notification indicating a resolution of the page fault, remove the first identifier from the faulty buffer data structure;
store the second incoming packet at the first buffer; and
forward, to a driver of the network accelerator device, a second identifier of the second buffer and the first identifier of the first buffer, wherein the plurality of buffers are allocated by the driver of the network accelerator device, and wherein the driver of the network accelerator device is executed by a guest operating system of a virtual machine running on the computer system.
8 . The system of claim 7 , wherein the processing device is further to:
attempt to translate a virtual address associated with the first buffer to physical address identifying a memory page in a physical memory of the computer system; and
responsive to successfully translating the virtual address to the physical address, store the first incoming packet at the memory page.
9 . The system of claim 8 , wherein the page fault is generated responsive to the memory page of the first buffer being not present in the physical memory of the computer system.
10 . The system of claim 7 , wherein to store the first incoming packet at the second buffer, the processing device is further to:
retrieve, from a data structure that stores a plurality of buffer identifiers, a second buffer identifier that follows a first buffer identifier identifying the first buffer, and wherein the second buffer identifier identifies the second buffer.
11 . The system of claim 7 , wherein to store the second incoming packet at the first buffer, the processing device is further to:
retrieve, from a data structure that stores a plurality of buffer identifiers, a first buffer identifier that precedes a second buffer identifier identifying the second buffer, and wherein the first buffer identifier identifies the first buffer.
12 . The system of claim 7 , wherein the processing device is further to:
append the second identifier of the second buffer and the first identifier of the first buffer to a data structure that stores an order in which the buffers are to be consumed by the computer system.
13 . A non-transitory computer-readable media storing instructions that, when executed, cause a processing device to:
receive, at a network accelerator device of a computer system, form a network, a first incoming packet and a second incoming packet;
responsive to receiving a first notification that an attempt to store the first incoming packet at a first buffer of a plurality of buffers associated with the network accelerator device caused a page fault:
store the first incoming packet at a second buffer of the plurality of buffers; and
append a first identifier of the first buffer to a faulty buffer data structure;
responsive to receiving a second notification indicating a resolution of the page fault, remove the first identifier from the faulty buffer data structure;
store the second incoming packet at the first buffer; and
forward, to a driver of the network accelerator device, a second identifier of the second buffer and the first identifier of the first buffer, wherein the plurality of buffers are allocated by the driver of the network accelerator device, and wherein the driver of the network accelerator device is executed by a guest operating system of a virtual machine running on the computer system.
14 . The non-transitory computer-readable media of claim 13 , wherein the processing device is further to:
attempt to translate a virtual address associated with the first buffer to physical address identifying a memory page in a physical memory of the computer system; and
responsive to successfully translating the virtual address to the physical address, store the first incoming packet at the memory page.
15 . The non-transitory computer-readable media of claim 14 , wherein the page fault is generated responsive to the memory page of the first buffer being not present in the physical memory of the computer system.
16 . The non-transitory computer-readable media of claim 13 , wherein to store the first incoming packet at the second buffer, the processing device is further to:
retrieve, from a data structure that stores a plurality of buffer identifiers, a second buffer identifier that follows a first buffer identifier identifying the first buffer, and wherein the second buffer identifier identifies the second buffer.
17 . The non-transitory computer-readable media of claim 13 , wherein to store the second incoming packet at the first buffer, the processing device is further to:
retrieve, from a data structure that stores a plurality of buffer identifiers, a first buffer identifier that precedes a second buffer identifier identifying the second buffer, and wherein the first buffer identifier identifies the first buffer.
18 . The non-transitory computer-readable media of claim 13 , wherein the processing device is further to:
append the second identifier of the second buffer and the first identifier of the first buffer to a data structure that stores an order in which the buffers are to be consumed by the computer system.