Direct Memory Access Between Device Drivers Using Cookie Structure
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In computer systems, when data objects used by one device driver need to be accessed by another, conventional methods require multiple copies of the data, leading to latency and data integrity issues due to the need for data copying between different memory allocations.
Innovation Solution
A method for direct memory access (DMA) is implemented, where a first application obtains a kernel address space identifier for a first device driver's memory, sends it to a second device driver, and performs a DMA operation using a cookie structure to transfer data directly from the first driver's kernel memory to the second driver's kernel memory, eliminating the need for intermediate copies.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If data objects are copied between different driver memory allocations, then data can be accessed by multiple device drivers, but latency increases and data integrity issues occur due to multiple copies
Solution Approach 1:
The patent merges multiple driver memory allocations into a shared memory space where multiple device drivers can access the same data objects directly. Instead of copying data between separate memory allocations, the system creates a unified memory region that all drivers can access simultaneously, eliminating the need for multiple copies and their associated latency and integrity issues.
Solution Approach 2:
The patent introduces a memory management intermediary layer that handles address translation and access coordination between device drivers and shared memory. This intermediary mechanism allows drivers to access shared data objects through virtual addresses while maintaining physical memory unity, resolving the contradiction between data sharing and memory allocation isolation.
2Ease of operation
If multiple copies of data objects are created for different device drivers, then each driver can access its own copy, but memory usage increases and data consistency becomes difficult to maintain
Solution Approach 1:
The patent combines multiple separate data copies into a single shared memory region. Device drivers access the same physical data objects through different virtual addresses, eliminating redundant data storage while maintaining ease of access through address translation mechanisms.
Solution Approach 2:
The shared memory space serves multiple device drivers simultaneously, making the memory resource universal. A single memory region performs the function of multiple separate allocations, allowing any driver to access any data object in the shared space without requiring dedicated memory copies.
3Adaptability or versatility
If data is copied between driver memory allocations, then data can be shared between drivers, but the copying process increases system complexity
Solution Approach 1:
The patent introduces an intermediary address translation layer that simplifies data sharing between drivers. Instead of implementing complex copying and synchronization logic in each driver, the system provides a unified access mechanism through virtual addresses that automatically handles the complexity of shared memory management.
Solution Approach 2:
The shared memory system provides self-service through automatic address translation and access coordination. The memory management infrastructure handles the complexity of data sharing transparently, allowing drivers to access shared data objects without implementing their own copying or synchronization logic.
Data Source
AI summary
A method for performing direct memory access includes obtaining, by a application executing on a host, a kernel address space identifier of a first driver kernel memory. The application sends the kernel address space identifier to a second device driver. The second device driver obtains, using the kernel address space identifier, a cookie structure binding the first driver kernel memory to a second device driver address space for the first driver kernel memory. The application sends a request for a direct memory access operation. The request includes a location identifier of a location storing a data object in the first driver kernel memory. Based on the cookie structure, the second device driver performs, using the location identifier, the direct memory access operation to transfer the data object from the first driver kernel memory to a second driver kernel memory.


