# US 2020/0264889 A1 · Reverse order queue updates by virtual devices

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

- Number: US 2020/0264889 A1
- Document ID: US20200264889A1
- Status: Published application
- Kind: A1
- Application number: 16/869,915
- Filed: 2020-05-08
- Published: 2020-08-20
- Earliest claimed: 2018-05-29
- Assignees: Red Hat, Inc.
- Applicants: Red Hat, Inc.
- Inventors: Michael Tsirkin
- Web page: https://patentgrep.com/patent/US20200264889A1

## CPC

- G06F 9/3856: {Reordering of instructions, e.g. using queues or age tags}
- G06F 12/0857: {by multiple requestors}
- G06F 9/45545: {Guest-host, i.e. hypervisor is an application program itself, e.g. VirtualBox}
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 9/544: {Buffers; Shared memory; Pipes}
- G06F 12/0851: {Cache with interleaved addressing}
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F 2212/1008: Correctness of operation, e.g. memory ordering
- G06F 2212/1024: Latency reduction
- G06F 2212/152: Virtualized environment, e.g. logically partitioned system
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system includes a memory including a ring buffer having a plurality of slots, a processor in communication with the memory, a guest operating system, and a hypervisor. The hypervisor is configured to detect a request associated with a memory entry, retrieve up to a predetermined quantity of memory entries in the ring buffer from an original slot to an end slot, and test a respective descriptor of each successive slot from the original slot through the end slot while the respective descriptor of each successive slot in the ring buffer remains unchanged. Additionally, the hypervisor is configured to execute the request associated with the memory entries and respective valid descriptors. The hypervisor is also configured to walk the ring buffer backwards from the end slot to the original slot while clearing the valid descriptors.

## Claims

### Claim 1

A system comprising:
a memory including a ring buffer having a plurality of slots;
a processor in communication with the memory; and
a hypervisor configured to:
retrieve a plurality of memory entries in the ring buffer from an original slot to an end slot,
test a respective descriptor of each successive slot from the original slot through the end slot,
responsive to determining the respective descriptor is a valid descriptor, execute a request associated with the memory entry and the respective descriptor,
walk the ring buffer backwards from the end slot to the original slot, and
clear the valid descriptor in each slot between the end slot and the original slot.

### Claim 2 (depends on 1)

The system of claim 1, wherein the request is one of (i) a request to transmit the respective memory entry from the memory, (ii) a request to copy the respective memory entry into a virtual machine memory, or (iii) a request to copy the respective memory entry out of a virtual machine memory.

### Claim 3 (depends on 1)

The system of claim 1, wherein the plurality of memory entries are stored in a first quantity of slots.

### Claim 4 (depends on 3)

The system of claim 3, wherein the plurality of memory entries is a first plurality of memory entries, and wherein a second plurality of memory entries are retrieved, and the second plurality is of lesser quantity than the first plurality.

### Claim 5 (depends on 1)

The system of claim 1, wherein the descriptor is at least one of a bit, a field entry, an address, and a packet length, and wherein a valid descriptor is at least one of a valid bit, a special value in the field entry, a non-zero address, and a non-zero packet length.

### Claim 6

A method comprising:
retrieving a plurality of memory entries in the ring buffer from an original slot to an end slot;
testing a respective descriptor of each successive slot from the original slot through the end slot;
responsive to determining the respective descriptor is a valid descriptor, executing a request associated with the memory entry and the respective descriptor;
walking the ring buffer backwards from the end slot to the original slot; and
clearing the valid descriptor in each slot between the end slot and the original slot.

### Claim 7 (depends on 6)

The method of claim 6, wherein the plurality of memory entries are stored in a first quantity of slots.

### Claim 8 (depends on 6)

The method of claim 6, wherein walking the ring buffer backwards includes at least one of counting the quantity of memory entries as they are retrieved and decrementing a counter.

### Claim 9 (depends on 6)

The method of claim 6, wherein clearing the valid descriptor in each slot includes overwriting the descriptor with a different value.

### Claim 10 (depends on 6)

The method of claim 6, wherein the plurality of memory entries includes a first memory entry in the original slot, a second memory entry in an intermediate slot, and a third memory entry located in the end slot.

### Claim 11 (depends on 6)

The method of claim 6, wherein the testing stops responsive to at least one of (i) receiving a value other than a valid descriptor from one of the successive slots from the original slot through the end slot and (ii) retrieving the plurality of memory entries in the ring buffer.

### Claim 12 (depends on 6)

The method of claim 6, wherein a cache line bounce occurs after clearing the valid descriptor in the original slot.

### Claim 13 (depends on 6)

The method of claim 6, wherein clearing the valid descriptor includes one of overwriting a valid bit with an invalid bit, deleting a special entry in a valid field, overwriting a packet address with a zero value or NULL value, and changing a packet length to an invalid packet length.

### Claim 14

A method comprising:
storing a location of an original slot in hypervisor memory;
testing a respective descriptor of each successive slot from the original slot through the end slot while the respective descriptor of each successive slot in the ring buffer remains unchanged;
responsive to determining the respective descriptor is a valid descriptor, executing a request associated with the respective descriptor;
responsive to executing the request, incrementing a counter from an original value to an end value; and
clearing the valid descriptor in each slot between the end slot and the original slot while walking the ring buffer backwards.

### Claim 15 (depends on 14)

The method of claim 14, wherein the request is a transmission request to transmit the respective memory entry from the first memory to the second memory.

### Claim 16 (depends on 14)

The method of claim 14, wherein clearing the valid descriptor in each slot includes overwriting the descriptor with a different value.

### Claim 17 (depends on 14)

The method of claim 14, wherein testing is stopped responsive to receiving a value other than a valid descriptor from one of the successive slots from the original slot through the end slot.

### Claim 18 (depends on 14)

The method of claim 14, wherein testing is stopped responsive to retrieving the plurality of memory entries in the ring buffer.

### Claim 19 (depends on 14)

The method of claim 14, wherein a cache line bounce occurs after clearing the valid descriptor in the original slot.

### Claim 20 (depends on 14)

The method of claim 14, wherein clearing the valid descriptor includes one of overwriting a valid bit with an invalid bit, deleting a special entry in a valid field, overwriting a packet address with a zero value or NULL value, and changing a packet length to an invalid packet length.
