The handling of blocking and unblocking of inports has been changed. The new code is
more robust and corrrectly handles cases that hadn’t been originally considered. The new
schema runs as follows:
Two lists are added to the nest structure, blocked and deblocked, List blocked holds the
addresses of all blocked inports that have undelivered packets. List deblocked holds the
addresses of all unblocked inports with undelivered packets. The inport_s struct has two
fields used for handling blocked input, blocked (a flag) and unde (a pointer to a struct
holding the blocked deliveries queue and the associated storage pool header). The udne
pointer is null when there is no queue.
Inports are blocked with the dfe_block function. The sole action taken is to set the
blocked flag true; the unde pointer remains null. When input for a blocked inport first
appears the unde struct is created, the input packet is added to the unde queue, and the
inport address is added to the blocked list. Subsequent inputs for the inport are added
to the blocked inputs queue.
Inports are unblocked with the dfe_unblock function. The blocked flag is set false. If
the inport is present in the blocked list it is moved to the deblocked list.
The scheduler switches to the drain_loop state whenever there is content in the deblocked
list. This state has a double loop. The outer loop processes the inports in the deblocked
list. The inner loop processes the inport’s blocked inputs queue.