STREAMS/UX for the HP 9000 Reference Manual
151
Debugging STREAMS/UX Modules and Drivers
STREAMS/UX Debugging Tool
q_flag = 0x103d
QREADR
QFULL
QWANTR
QWANTW
QUSE
QSYNCH
q_minpsz = 0
q_maxpsz = -1
q_hiwat = 0x200
q_lowat = 0x100
q_bandp = 0x0
q_nband = 0
q_pad1[0] = 00
q_pad1[1] = 00
The user notices that the QFULL flag is set. This indicates that the queue is
flow controlled. q_hiwat is set to 0x200 (512 decimal). Therefore, lo can
write only 512 bytes of data to the stream head before a user program does a
read, relieving the flow control condition.
The user realizes that this problem occurs because STREAMS/UX
fragmented the 1024 bytes into smaller messages. If STREAMS/UX put all
the data in one message, lo would put the entire message on the stream head
read queue. lo would be able to do this because the driver tests once for flow
control before sending the data upstream. Then, when lo tests for flow
control, the stream head read queue is empty. lo cannot send all the data
when it is fragmented because lo must check for flow control before sending
each fragment. After 512 bytes are in the stream head write queue, the flow
control check fails.
The user wonders why STREAMS/UX fragmented the data. The user enters
m to look at the fragments.
m
struct msgb 0x50da00 S:2
b_next = 0x513780
b_prev = 0x0
b_cont = 0x0
b_rptr = 0x47a700
b_wptr = 0x47a800
b_datap = 0x50da40
b_band = 0
b_pad1 = 00
b_flag = 0x0
b_pad2 = 0