Date: Wed, 20 Aug 1997 11:28:45 +0200 From: erakupa@kk.etx.ericsson.se (ETX-B-SL Martti Kuparinen) To: freebsd-questions@FreeBSD.ORG Subject: Re: poll() for ethernet devices Message-ID: <199708200928.LAA12825@kk662.kk.etx.ericsson.se>
next in thread | raw e-mail | index | archive | help
Ok, seems like my description was not clear enough... I try to make
a better story now :-)
> > I am running FreeBSD 2.2.2 on a PPro 200 MHz PC. I have created a
> > loadable kernel module which will schedule IP-packets on user-defineable
> > interfaces and priorities.
So I have a router which is able to prioritize outgoing packets
based on {address, port, protocol}-decision. To achieve this I have
two different tables in memory:
addresstable: { address, port, protocol, priority }
interfacetable: list of interfaces which are scheduled
So the user is able to type e.g.
schconfig attach fxp0 fxp1 fxp2 fxp3
schconfig add 192.168.100.200 icmp high
schconfig add \* \* \* low
(schconfig is a user-space control program like ifconfig to
modify the scheduler at run-time)
This means that icmp packets (e.g. ping) to 192.168.100.200 have the
high priority whereas all other packets are low priority traffic. These
actions take effect on fxp[0-3] interfaces.
I have modified ether_output() to put the packet in to the correct
position inside the if_snd queue. The position is calculated from
{ address, port, protocol, priority }-information.
In order to do the prioritity queueing one must always read packets
from interfaces before writing them out. So inside ether_output()
I want to force the kernel to execute ether_input().
My version work great (checking the priority and the position
in the queue for every packet) expect that it is always writing
someting out from ether_output. As a "minor" side effect packets
are not prioritized :-('So I need to check if there is more packets
to read from any of the attached interfaces. Of course I have a "timeout"
mechanism to prevent the system from not writing anything out...
Any ideas how to check for new incoming packets on all interfaces in
the system?
/Martti
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708200928.LAA12825>
