# US 5,893,162 A · Method and apparatus for allocation and management of shared memory with data in memory stored as multiple linked lists

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

- Number: US 5,893,162 A
- Document ID: US5893162A
- Status: Granted
- Kind: A
- Application number: 08/796,085
- Filed: 1997-02-05
- Granted: 1999-04-06
- Earliest claimed: 1997-02-05
- Assignees: TranSwitch Corporation
- Inventors: Joseph C. Lau; Subhash C. Roy; Dirk L. M. Callaerts; Ivo Edmond Nicole Vandeweerd
- Web page: https://patentgrep.com/patent/US5893162A

## CPC

- H04Q 11/0478: {Provisions for broadband connections}
- G06F 5/065: {Partitioned buffers, e.g. allowing multiple independent queues, bidirectional FIFO's}
- G06F 12/023: {Free address space management}
- G06F 2205/064: Linked list, i.e. structure using pointers, e.g. allowing non-contiguous address segments in one logical buffer or dynamic buffer space allocation
- H04L 2012/5681: {Buffer or queue management}
- H04Q: SELECTING (switches, relays, selectors H01H; wireless communication networks H04W)
- 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

Apparatus and methods for allocating shared memory utilizing linked lists are provided which are particularly useful in telecommunications applications such as ATM. A management RAM contained within a VLSI circuit is provided for controlling the flow of data into and out of a shared memory (data RAM), and stores information regarding a number of link lists and a free link list in the shared memory, and a block pointer to unused RAM locations. A head pointer, tail pointer, block counter and empty flag are stored for each data link list. The head and tail pointers each include a block pointer and a position counter. The block counter contains the number of blocks used in the particular queue. The empty flag indicates whether the queue is empty. The free link list includes a head pointer, a block counter, and an empty flag. Each memory page of the shared data RAM receiving the incoming data includes locations for storing data. The last location of the last page in a block of shared data RAM memory is preferably used to store a next-block pointer plus parity information. If there are no more blocks in the queue, that last location is set to all ones. An independent agent is utilized in the background to monitor the integrity of the link list structure. Using the methods and apparatus of the invention, four operations are defined for ATM cell management: cell write, cell read, queue clear, and link list monitoring.

## Claims

### Claim 1

Apparatus for managing the storage of data in a memory, comprising:
a) a shared memory means having a plurality of data storage locations;
b) control means for receiving said data and forwarding said data to desired of said plurality of data storage locations in said shared memory means, wherein said data is stored in said plurality of data storage locations in the form of a plurality of link lists, each link list having a head;
c) management memory means for storing information regarding each of said plurality of link lists, said information including a head pointer and a queue empty flag for each link list, said head pointer for each particular respective link list pointing to a location of a respective said head of that particular link list, and said queue empty flag for a link list indicating that that link list has no valid data contained therein.

### Claim 2 (depends on 1)

An apparatus according to claim 1, wherein:
said control means reads data from said shared memory means,
at least a plurality of said data storage locations are in the form of a free link list, said free link list relating to data storage locations from which data has been read by said control means, and
said management memory means includes a pointer and a queue empty flag for said free link list.

### Claim 3 (depends on 1)

An apparatus according to claim 1, wherein:
upon initialization, at least a plurality of said data storage locations of said shared memory means are unused, and
said management memory means includes a pointer to at least one of said unused data storage locations.

### Claim 4 (depends on 2)

An apparatus according to claim 2, wherein:
at least a plurality of said data storage locations of said shared memory means are unused, and
said management memory means includes a pointer to said at least one of said unused data storage locations.

### Claim 5 (depends on 1)

An apparatus according to claim 1, wherein:
said shared memory means is arranged in a plurality of blocks with each block having a plurality of said data storage locations, and
said information stored in said management memory means regarding each of said plurality of link list queues includes a block counter for each of said plurality of link list queues, each block counter counting the number of blocks contained in that link list queue.

### Claim 6 (depends on 5)

An apparatus according to claim 5, wherein:
each of said plurality of blocks is arranged as a plurality of contiguous pages with each page having a plurality of said data storage locations, and
each said head pointer comprises a block pointer which points to a block and a page counter which points to a page in said block.

### Claim 7 (depends on 5)

An apparatus according to claim 5, wherein:
each block storing data includes at least one location containing one of (i) a pointer to a next block in the link list, and (ii) an indicator which indicates that the block is the last block in the link list.

### Claim 8 (depends on 7)

An apparatus according to claim 7, wherein:
said pointer to a next block in the link list includes a parity bit for said pointer.

### Claim 9 (depends on 6)

An apparatus according to claim 6, wherein:
each block storing data includes at least one location in a last page of that block containing one of (i) a pointer to a next block in the link list, and (ii) an indicator which indicates that the block is the last block in the link list.

### Claim 10 (depends on 1)

An apparatus according to claim 1, wherein:
said information includes a tail pointer for each link list containing said data.

### Claim 11 (depends on 5)

An apparatus according to claim 5, wherein:
said information includes a tail pointer for each link list containing said data.

### Claim 12 (depends on 6)

An apparatus according to claim 6, wherein:
said information includes a tail pointer for each link list containing said data,
each of said plurality of blocks is arranged as a plurality of contiguous pages with each page having a plurality of said data storage locations,
each said head pointer comprises a first block pointer which points to a block and a page counter which points to a page in said block, and
each said tail pointer comprises a second block pointer which points to a tail block and a page counter which points to a page in said tail block.

### Claim 13 (depends on 6)

An apparatus according to claim 6, wherein:
said data comprises ATM data received in cell format, and each said page includes enough of said data storage locations to store all of the data contained in an ATM cell.

### Claim 14 (depends on 13)

An apparatus according to claim 13, wherein:
each page includes thirty-two sixteen bit word locations.

### Claim 15 (depends on 5)

An apparatus according to claim 5, wherein:
said control means reads data from said shared memory means,
at least a plurality of said data storage locations are in the form of a free link list, said free link list relating to data storage locations from which data has been read by said control means, and
said management memory means includes a pointer, a block counter, and a queue empty flag for said free link list,
at least a plurality of said data storage locations of said shared memory means are unused, and
said management memory means includes a pointer to said at least one of said unused data storage locations, and
said control means includes means for comparing a sum of counts of said block counters of each link list containing data, said free link list, and said unused pointer to the number of blocks in said shared memory means.

### Claim 16 (depends on 15)

An apparatus according to claim 15, wherein:
said control means further comprises means for generating an error signal if said sum of counts does not equal said number of blocks in said shared memory means.

### Claim 17 (depends on 11)

An apparatus according to claim 11, wherein:
said control means includes means for comparing, for each link list containing data, said tail pointer to said head pointer.

### Claim 18 (depends on 17)

An apparatus according to claim 17, wherein:
said control means further comprises means for generating an error signal if said tail pointer and said head pointer for a link list containing data point to an identical block, and said block counter for said link list does not equal one.

### Claim 19 (depends on 17)

An apparatus according to claim 17, wherein:
said control means further comprises means for generating an error signal if said tail pointer and said head pointer for a link list containing data point to different blocks, and said block counter for said link list equals one.

### Claim 20 (depends on 5)

An apparatus according to claim 5, wherein:
said control means further comprises means for checking the count of each block counter of a link list where the queue empty flag is not set, and for generating an error signal if the count is zero and the queue empty flag is not set.

### Claim 21 (depends on 1)

An apparatus according to claim 1, wherein:
said control means and said management memory means are contained on a single integrated circuit.

### Claim 22

An apparatus for managing the storage of data in a memory, comprising:
a) a shared memory means having a plurality of data storage locations;
b) control means for receiving said data and forwarding said data to desired of said plurality of data storage locations in said shared memory means, and for reading data from said shared memory means, wherein said data is stored in said plurality of data storage locations in the form of a plurality of link lists, each link list having a head;
c) management memory means for storing information regarding each of said plurality of link lists, said information including a head pointer for each link list queue, said head pointer for each particular respective link list pointing to a location of a respective said head of that particular link list,
wherein upon initialization, at least a plurality of said data storage locations of said shared memory means are unused, and after utilization, at least a plurality of said data storage locations are in the form of a free link list, said free link list relating to data storage locations from which data has been read by said control means, and
wherein said management memory means includes a pointer to at least one of said unused data storage locations, and said management memory means includes a pointer for said free link list.

### Claim 23 (depends on 22)

An apparatus according to claim 22, wherein:
said information further includes a queue empty flag for each link list, said queue empty flag for a link list indicating that that link list has no valid data contained therein.

### Claim 24 (depends on 22)

An apparatus according to claim 22, wherein:
said shared memory means is arranged in a plurality of blocks with each block having a plurality of said data storage locations, and
said information stored in said management memory means regarding each of said plurality of link list queues includes a block counter for each of said plurality of link list queues, each block counter counting the number of blocks contained in that link list queue.

### Claim 25 (depends on 24)

An apparatus according to claim 24, wherein:
each of said plurality of blocks is arranged as a plurality of contiguous pages with each page having a plurality of said data storage locations, and
each said head pointer comprises a block pointer which points to a block and a page counter which points to a page in said block.

### Claim 26 (depends on 24)

An apparatus according to claim 24, wherein:
each block storing data includes at least one location containing one of (i) a pointer to a next block in the link list, and (ii) an indicator which indicates that the block is the last block in the link list.

### Claim 27 (depends on 26)

An apparatus according to claim 26, wherein:
said pointer to a next block in the link list includes a parity bit for said pointer.

### Claim 28 (depends on 22)

An apparatus according to claim 22, wherein:
said information includes a tail pointer for each link list containing said data.

### Claim 29 (depends on 25)

An apparatus according to claim 25, wherein:
said data comprises ATM data received in cell format, and each said page includes enough of said data storage locations to store all of the data contained in an ATM cell.

### Claim 30 (depends on 24)

An apparatus according to claim 24, wherein:
said management memory means includes said pointer, a block counter, and a queue empty flag for said free link list, and
said control means includes means for comparing a sum of counts of said block counters of each link list containing data, said free link list, and said unused pointer to the number of blocks in said shared memory means, and means for generating an error signal is said sum of counts does not equal said number of blocks in said shared memory means.

### Claim 31 (depends on 28)

An apparatus according to claim 28, wherein:
said control means includes means for comparing, for each link list containing data, said tails pointer to said head pointer, and means for generating an error signal if either
(i) said tail pointer and said head pointer for a link list containing data point to an identical block, and said block counter for said link list does not equal one, or
(ii) said tail pointer and said head pointer for a link list containing data point to different blocks, and said block counter for said link list equals one.

### Claim 32 (depends on 23)

An apparatus according to claim 23, wherein:
said control means further comprises means for checking the count of each block counter of a link list where the queue empty flag is not set, and for generating an error signal if the count is zero and the queue empty flag is not set.

### Claim 33

A method of managing the storage of data utilizing a controller, a shared memory having a plurality of data storage locations, and a management memory, said method comprising:
a) using said controller to forward received data to desired of the plurality of data storage locations in the shared memory, wherein the data is stored in the plurality of data storage locations in the form of a plurality of link lists, each link list having a head; and
b) storing information regarding each of the plurality of link lists in the management memory, said information including a head pointer and a queue empty flag for each link list, said head pointer for each particular respective link list pointing to a location of a respective said head of that particular link list, and said queue empty flag for a link list indicating that that link list has no valid data contained therein.
