Patent ID: 7974190

Claim:
A method in an Ethernet controller for allocating memory space in a buffer memory between a transmit queue (TXQ) and a receive queue (RXQ) comprising: allocating initial memory space in the buffer memory to the RXQ and the TXQ; defining a RXQ high watermark indicating high memory usage in the RXQ and a RXQ low watermark indicating low memory usage in the RXQ, wherein defining a RXQ high watermark comprises setting a minimum distance from a write pointer of the RXQ to a read pointer of the RXQ as the RXQ high watermark, and defining a RXQ low watermark comprises setting a maximum distance from the write pointer of the RXQ to the read pointer of the RXQ as the RXQ low watermark; receiving an ingress data frame; determining if a memory usage in the RXQ exceeds the RXQ high watermark by determining if the distance from the write pointer of the RXQ to the read pointer of the RXQ is less than the RXQ high watermark; if the memory usage in the RXQ does not exceed the RXQ high watermark, storing the ingress data frame in the RXQ; if the memory usage in the RXQ is at or exceed the RXQ high watermark, determining if there are unused memory space in the TXQ; if there are no unused memory space in the TXQ, transmitting a pause frame to halt further ingress data frame; if there are unused memory space in the TXQ, allocating unused memory space in the TXQ to the RXQ at a location after the write pointer of the RXQ; and storing the ingress data frame in the RXQ.