From owner-freebsd-questions Wed Aug 20 02:29:23 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA11064 for questions-outgoing; Wed, 20 Aug 1997 02:29:23 -0700 (PDT) Received: from blizzard.wise.edt.ericsson.se (blizzard-ext.wise.edt.ericsson.se [194.237.142.2]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA11059 for ; Wed, 20 Aug 1997 02:29:16 -0700 (PDT) Received: from kkb3 (kkb3.kk.etx.ericsson.se [130.100.97.23]) by blizzard.wise.edt.ericsson.se (8.7.5/8.7.3/glacier-0.9) with SMTP id LAA00483 for ; Wed, 20 Aug 1997 11:29:03 +0200 (MET DST) Received: from kk662.kk.etx.ericsson.se by kkb3 (SMI-8.6/LME-2.2.6) id LAA20186; Wed, 20 Aug 1997 11:28:44 +0200 From: erakupa@kk.etx.ericsson.se (ETX-B-SL Martti Kuparinen) Received: by kk662.kk.etx.ericsson.se (SMI-8.6/client-1.6) id LAA12825; Wed, 20 Aug 1997 11:28:45 +0200 Date: Wed, 20 Aug 1997 11:28:45 +0200 Message-Id: <199708200928.LAA12825@kk662.kk.etx.ericsson.se> To: freebsd-questions@FreeBSD.ORG Subject: Re: poll() for ethernet devices X-Sun-Charset: US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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