# US 8,752,063 B2 · Programming interface for data communications

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

- Number: US 8,752,063 B2
- Document ID: US8752063B2
- Status: Granted
- Kind: B2
- Application number: 13/167,311
- Filed: 2011-06-23
- Published: 2012-12-27
- Granted: 2014-06-10
- Earliest claimed: 2011-06-23
- Assignees: Microsoft Corporation
- Applicants: Osman N. Ertugay; Keith E. Horton; Joseph Nievelt
- Inventors: Osman N. Ertugay; Keith E. Horton; Joseph Nievelt
- Web page: https://patentgrep.com/patent/US8752063B2

## CPC

- G06F 9/544: {Buffers; Shared memory; Pipes}
- G06F 9/545: {where tasks reside in different layers, e.g. user- and kernel-space}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In embodiments of a programming interface for data communications, a request queue and a completion queue can be allocated from a user-mode virtual memory buffer that corresponds to an application. The request queue and the completion queue can be pinned to physical memory and then mapped to kernel-mode system addresses so that the request queue and the completion queue can be accessed by a kernel-mode execution thread. A request can be received from an application for the kernel to handle data in the request queue, and a system issued to the kernel for the kernel-mode execution thread to handle the request. The kernel-mode execution thread can then handle additional requests from the application without additional system calls being issued.

## Claims

### Claim 1

A computer-implemented method, comprising:
registering a user-mode virtual memory buffer corresponding to an application;
issuing a system call to a kernel for a kernel-mode execution thread to handle a request from the application;
allocating a completion queue from the user-mode virtual memory buffer and pinning the completion queue to physical memory;
mapping the completion queue to a first kernel-mode system address in the kernel, the completion queue configured to receive completion notifications from the kernel mode execution thread via the kernel-mode system address and to enable access to the completion notifications by the application via the user-mode virtual memory buffer;
registering a socket configured to provide data requests from the application to the kernel, the registering the socket comprising:
allocating a request queue from the user-mode virtual memory buffer and pinning the request queue to the physical memory;
mapping the request queue to a second kernel-mode system address, the request queue configured to receive data from the application via the user-mode virtual memory buffer and to enable access to the data by the kernel-mode execution thread via the second kernel-mode system address;
identifying the completion queue to the socket; and
receiving an additional request from the application for the kernel-mode execution thread to handle additional data in the request queue, the kernel-mode execution thread handling the additional request without an additional system call being issued to the kernel.

### Claim 2 (depends on 1)

A computer-implemented method as recited in claim 1, wherein the registering the user-mode virtual memory buffer further comprises sending a registration identifier of the buffer to the application.

### Claim 3 (depends on 2)

A computer-implemented method as recited in claim 2, wherein the registering the user-mode virtual memory buffer comprises receiving a request from the application for the kernel to handle the data in the request queue, the request including the registration identifier of the buffer.

### Claim 4 (depends on 3)

A computer-implemented method as recited in claim 3, wherein the kernel-mode execution thread is configured to handle the request by retrieving the data from the request queue via the second kernel-mode system address.

### Claim 5 (depends on 3)

A computer-implemented method as recited in claim 3, further comprising receiving a completion notification in the completion queue, the completion notification posted in the completion queue by the kernel-mode execution thread via the kernel-mode virtual memory buffer when the request is handled.

### Claim 6 (depends on 5)

A computer-implemented method as recited in claim 5, wherein the application is configured for:
monitoring the completion queue via the user-mode virtual memory buffer to detect the completion notification posted by the kernel-mode execution thread, the completion notification indicating to the application that the request has been handled by the kernel-mode execution thread; and
re-using the request queue for an additional request responsive to detecting the completion notification.

### Claim 7

A computing system, comprising:
a memory configured to maintain an application that is executable;
a processor to execute a programming interface that is configured to:
receive a request from the application for a kernel to handle data in a request queue, the request queue allocated from a user-mode virtual memory buffer corresponding to the application;
determine that a kernel-mode execution thread is not assigned to handle the request; and
issue a system call to the kernel for a kernel-mode execution thread to handle the request, the kernel-mode execution thread further configured to handle additional requests from the application without the programming interface having to issue additional system calls to the kernel.

### Claim 8 (depends on 7)

A computing system as recited in claim 7, wherein prior to receiving the request from the application, the programming interface is further configured to:
allocate the request queue and a completion queue from the user-mode virtual memory buffer corresponding to the application;
pin the request queue and the completion queue to physical memory; and
map the request queue to a first kernel-mode system address and map the completion queue to a second kernel-mode system address to enable the request queue and the completion queue to be accessed by the kernel-mode execution thread.

### Claim 9 (depends on 8)

A computing system as recited in claim 8, wherein the kernel-mode execution thread is configured to handle the request from the application by retrieving the data from the request queue via the first kernel-mode system address.

### Claim 10 (depends on 8)

A computing system as recited in claim 8, wherein the completion queue is configured to receive a completion notification from the kernel-mode execution thread after the kernel-mode execution thread handles the request.

### Claim 11 (depends on 10)

A computing system as recited in claim 10, wherein the application is configured to:
monitor the completion queue via the user-mode virtual memory buffer to detect the completion notification posted by the kernel-mode execution thread, the completion notification indicating to the application that the request has been handled by the kernel-mode execution thread; and
re-use the request queue for the additional requests responsive to detecting the completion notification.

### Claim 12 (depends on 11)

A computing system as recited in claim 11, wherein the application is further configured to re-use the request queue for the additional requests without unpinning the request queue and the completion queue from the physical memory.

### Claim 13

A computing device, comprising:
at least a memory and a processor to implement a programming interface, the programming interface configured to:
allocate a request queue and a completion queue from a user-mode virtual memory buffer that corresponds to an application;
pin the request queue and the completion queue to physical memory;
map the request queue and the completion queue to kernel-mode system addresses in a kernel to enable the request queue and the completion queue to be accessed by a kernel-mode execution thread;
receive a request from the application for the kernel to handle data in the request queue;
issue a system call to the kernel for a kernel-mode execution thread to handle the request, the kernel-mode execution thread further configured to handle additional requests from the application; and
receive the additional requests from the application for the kernel-mode execution thread to handle the data in the request queue, the kernel-mode execution thread configured to handle the additional requests without the programming interface issuing additional system calls.

### Claim 14 (depends on 13)

A computing device as recited in claim 13, wherein the completion queue is configured to receive a completion notification from the kernel-mode execution thread after the kernel-mode execution thread handles the request.

### Claim 15 (depends on 14)

A computing device as recited in claim 14, wherein the application is configured to:
monitor the completion queue to detect the completion notification posted by the kernel-mode execution thread, the completion notification indicating to the application that the request has been handled by the kernel-mode execution thread; and
re-use the request queue for the additional requests.

### Claim 16 (depends on 15)

A computing device as recited in claim 15, wherein the application is further configured to re-use the request queue for the additional requests without unpinning the request queue and the completion queue from the physical memory.
