
IBM3206K0424
Preliminary
IBM Processor for Network Resources
pnr25.chapt05.01
August 14, 2000
Receive Queues (RXQUE)
Page 379 of 676
RXQUE Normal Operation
This section describes how to use the receive queues (rxq) and the rxq operations. 
The receive queue contains events for the end user to process. These events are obtained by the user by 
executing the rxq deq operation. The user can be notified of new events by setting up the threshold and inter-
rupt enable registers appropriately. Otherwise, the rxq length register can be polled to check for events. 
The deq operation is executed by reading the deq register address for the appropriate rxq. The event at the 
head of the queue is returned and the event is removed from the queue. Some events have a packet/cell 
buffer associated with it. This buffer is owned by the user, and it is the users responsibility to free this buffer. 
The following pseudo code illustrates how an rxq could be processed: 
RXQUE Queue Full Operation
When a receive queue is full (length is equal to maximum length), the appropriate status bit is set. When a 
queue is full, all subsequent events are flushed until room is available in the receive queue. If a buffer was 
associated with the event and the RXQUE-Properties-Register bit Disable Auto-Free is not set, then that 
buffer is freed back to POOLS. 
When an event is dropped, the event dropped status bit is set and the event data that was dropped can be 
found in RXQUE Last Event Dropped Register. The RXQUE Last Event Dropped Register will not be 
changed until the event dropped status bit is cleared. 
It is not good to let a receive queue become full. 
RXQUE Dequeue Event Loop 
// rxq was polled or int ocurred to get here
Event = RXQUE->Deq;
// read an event from rxq
if (Event neq 0) {
EventType = Event & 0x7f;
Event = Event & ~(0x7f); // calc lc or buffer ptr
// need to check for null event
// calc event type
switch (EventType) {
case(Event1):
ProcessSimpleEvent1(Event);
break;
case(Event2):
ProcessSimpleEvent2(Event);
break;
case(EventX):
ProcessSimpleEventX(Event);
break;
}
}