In looking at porting BPF to STREAMS there is one complication that I'm not quite sure how to handle - delayed receiving of data, say every 100ms.
Picking up a packet from below is fine, and it can be put into a buffer attached to the q_ptr ok. Copying the data into the buffer would need to be protected by holding some lock so that this is synchronised with the reader from above. That's the easy part. The hard part is how to do the receive side. For reference, in the immediate delivery mode, the buffer is checked against a BPF filter before being passed along to the next module. With delayed wait we don't want to just call "putnext" to deliver the message onwards and upwards, rather we want to either: 1) tell the system that a buffer is waiting to be read (with 0 or more bytes ready) so that select/poll wakeup; 2) tell the system that getmsg can continue and return to user space. My problem is that in both cases it isn't enough to store a pointer to the top queue because that might get closed while we're waiting for more data. I'm tempted to just go in and look at what bufmod does to copy that but it's supposedly not that great from the performance standpoint so that might not necessarily help. Clues anyone? Darren _______________________________________________ networking-discuss mailing list [email protected]
