Re: Dupping message data

From: Andrew Valencia <vandys_at_nospam.org>
Date: Tue Oct 12 1993 - 20:20:25 PDT

[dave@computone.com (David Johnson) writes:]

>For example, say two processes have the Ethernet driver open and are
>registered to receive all packets (promiscuous mode). I need to take
>each incoming packet and duplicate it to each of these receivers.

Nick is right, but perhaps I can flesh out some details.

First, your ethernet driver will not be receiving messages; he will be
arming DMA down onto the Lance (or whatever ether chip), and filling in
wired pages in his address space. He will be receiving interrupt messages
as packets are completely received.

Now he has some private memory, with interesting contents, and he wants
to send it to two folks. Or does he? Is he a server (and thus must wait
to RECEIVE requests) or a client (he gets to initiate requests)? I'd
guess he's a server, since he must receive messages concerning interrupts,
anyway.

So, he has a packet, and has previously had msg_receive() return him two
requests, neither to which he has msg_reply()'ed yet. All he does is find
the pending messages, fill in the scatter/gather list with the packet,
and do a msg_reply() to each client.

You can see logic for handling multiple outstanding I/O requests. See
the kbd driver, for instance. I think the fd driver queues multiple
requests as well.

                                        Andy
Received on Tue Oct 12 20:21:03 1993

This archive was generated by hypermail 2.1.8 : Wed Sep 21 2005 - 19:37:12 PDT