Browse Prior Art Database

Avoid Remapping of Data Buffers in AIX Device Drivers

IP.com Disclosure Number: IPCOM000111509D
Original Publication Date: 1994-Feb-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 2 page(s) / 58K

Publishing Venue

IBM

Related People

Sheffield, DW: AUTHOR

Abstract

Disclosed is a method for a RISC System/6000* AIX* device driver to avoid remapping data buffers for DMA on each I/O operation.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Avoid Remapping of Data Buffers in AIX Device Drivers

      Disclosed is a method for a RISC System/6000* AIX* device
driver to avoid  remapping data buffers for DMA on each I/O
operation.

      Generally, for each I/O operation that involves DMA of a data
buffer to or from an adapter, a device driver must call d_master with
a sufficient TCW (Translation Control Word) range to map the buffer.
These data buffers are often page size buffers and are generally
reused quite frequently.  Therefore, a device driver will often
receive the same data buffer many times for different I/O operations.

      Existing drivers simply ignore the fact that these buffers are
being reused, and remap the buffers on each operation.  Instead of
this approach, a driver could use a least recently used algorithm to
allocate TCWs from a table.  When a buffer is passed down, the table
could be checked, and if the same TCWs that were used on the previous
operation are still available, they could be reused.  This would
eliminate the call to d_master, although the driver would still have
to handle the cache management (depending on the hardware platform).

      A possible problem with this scheme is that if the buffer is
unpinned and then pinned again, it could have a different real
address.  Re-using the same TCW at the device driver would not work
in this case.  Unfortunately, there is no way for the driver to know
if this has occurred since it last received this same buffer (virtual
address).

      The solution to this problem involves a simple set of kernel
services.  These services must maintain a flag for each dr...