# US 2021/0342272 A1 · Memory page fault handling for network interface devices in a virtualized environment

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0342272 A1
- Document ID: US20210342272A1
- Status: Published application
- Kind: A1
- Application number: 16/862,466
- Filed: 2020-04-29
- Published: 2021-11-04
- Earliest claimed: 2020-04-29
- Assignees: Red Hat, Inc.
- Applicants: Red Hat, Inc.
- Inventors: Michael Tsirkin
- Web page: https://patentgrep.com/patent/US20210342272A1

## CPC

- G06F 12/1009: using page tables, e.g. page table structures
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 12/08: in hierarchically structured memory systems, e.g. virtual memory systems
- H04L 49/9021: {Plurality of buffers per packet}
- G06F 2009/45579: {I/O management, e.g. providing access to device drivers or storage}
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F 2009/45595: {Network integration; Enabling network access in virtual machine instances}
- G06F 2212/1016: Performance improvement
- G06F 2212/151: Emulated environment, e.g. virtual machine
- G06F 2212/154: Networked environment
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Systems and methods for supporting memory page fault handling for network devices are disclosed. In one implementation, a processing device may receive, at a network interface device of a host computer system, an incoming packet from a network. The processing device may also select a first buffer from a plurality of buffers associated with a receiving queue of the network interface device. The processing device may attempt to store the incoming packet at the first buffer of the plurality of buffers. Responsive to receiving a notification that attempting to store the incoming packet at the first buffer encountered a page fault, the processing device may assign the first buffer to a wait queue of the network interface device. The processing device may further store the incoming packet at a second buffer of the plurality of buffers associated with the receiving queue.

## Claims

### Claim 1

A method, comprising:
receiving, by a network interface device of a host computer system, an incoming packet from a network;
selecting a first buffer from a plurality of buffers associated with a receiving queue of the network interface device;
attempting to store the incoming packet at the first buffer of the plurality of buffers; and
responsive to receiving a notification that attempting to store the incoming packet at the first buffer encountered a page fault:
assigning the first buffer to a wait queue of the network interface device; and
storing the incoming packet at a second buffer of the plurality of buffers associated with the receiving queue.

### Claim 2 (depends on 1)

The method of claim 1, wherein the plurality of buffers are allocated by a driver of the network interface device, and wherein the plurality of buffer are marked as available upon allocation.

### Claim 3 (depends on 2)

The method of claim 2, wherein the driver of the network interface device is executed by a guest operating system of a virtual machine running on the host computer system.

### Claim 4 (depends on 1)

The method of claim 1, wherein the network interface device comprises a Network Interface Card (NIC).

### Claim 5 (depends on 1)

The method of claim 1, wherein the page fault is generated responsive to a memory page of the first buffer being not present in a physical memory of the host computer system.

### Claim 6 (depends on 1)

The method of claim 1 further comprising:
responsive to handling the page fault having been completed, detecting that the memory page of the first buffer is present.

### Claim 7 (depends on 1)

The method of claim 1, wherein the receiving queue and the wait queue are allocated by the driver of the network interface device.

### Claim 8 (depends on 1)

The method of claim 1 further comprising:
responsive to detecting that the page fault is handled:
removing the first buffer from the wait queue;
storing a second incoming packet at the first buffer; and
assigning the first buffer to the receiving queue.

### Claim 9 (depends on 1)

The method of claim 1, wherein responsive to storing the incoming packet at the second buffer, marking the second buffer as used.

### Claim 10 (depends on 9)

The method of claim 9, wherein responsive to detecting that the incoming packet at the second buffer has been read by the network interface device, marking the second buffer as available.

### Claim 11

A system comprising:
a memory;
a processing device operatively coupled to the memory, the processing device to:
receive, at a network interface device, an incoming packet from a network;
select a first buffer from a plurality of buffers associated with a receiving queue of the network interface device;
attempt to store the incoming packet at the first buffer of the plurality of buffers; and
responsive to receiving a notification that attempting to store the incoming packet at the first buffer encountered a page fault:
assign the first buffer to a wait queue of the network interface device; and
store the incoming packet at a second buffer of the plurality of buffers associated with the receiving queue.

### Claim 12 (depends on 11)

The system of claim 11, wherein the plurality of buffers are allocated by a driver of the network interface device, and wherein the plurality of buffer are marked as available upon allocation.

### Claim 13 (depends on 11)

The system of claim 11, wherein the page fault is generated responsive to a memory page of the first buffer being not present.

### Claim 14 (depends on 11)

The system of claim 11, wherein the processing device is further to:
responsive to the page fault being handled, detect that the memory page of the first buffer is present.

### Claim 15 (depends on 11)

The system of claim 11, wherein the processing device is further to:
responsive to detecting that the page fault is handled:
remove the first buffer from the wait queue;
store a second incoming packet at the first buffer; and
assign the first buffer to the receiving queue.

### Claim 16 (depends on 11)

The system of claim 11, wherein responsive to storing the incoming packet at the second buffer, mark the second buffer as used.

### Claim 17

A non-transitory computer-readable media storing instructions that, when executed, cause a processing device to:
receive, at a network interface device, an incoming packet from a network;
select a first buffer from a plurality of buffers associated with a receiving queue of the network interface device;
attempt to store the incoming packet at the first buffer of the plurality of buffers; and
responsive to receiving a notification that attempting to store the incoming packet at the first buffer encountered a page fault:
assign the first buffer to a wait queue of the network interface device; and
store the incoming packet at a second buffer of the plurality of buffers associated with the receiving queue.

### Claim 18 (depends on 17)

The non-transitory computer-readable media of claim 17, wherein the plurality of buffers are allocated by a driver of the network interface device, and wherein the plurality of buffer are marked as available upon allocation.

### Claim 19 (depends on 17)

The non-transitory computer-readable media of claim 17, wherein the driver of the network interface device is executed by a guest operating system of a virtual machine.

### Claim 20 (depends on 17)

The non-transitory computer-readable media of claim 17, wherein the processing device is further to:
responsive to detecting that the page fault is handled:
remove the first buffer from the wait queue;
store a second incoming packet at the first buffer; and
assign the first buffer to the receiving queue.
