From owner-freebsd-current Mon Jul 27 11:45:03 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA12062 for freebsd-current-outgoing; Mon, 27 Jul 1998 11:45:03 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA11976 for ; Mon, 27 Jul 1998 11:44:39 -0700 (PDT) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id LAA22085; Mon, 27 Jul 1998 11:36:26 -0700 (PDT) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpdh22055; Mon Jul 27 18:36:16 1998 Date: Mon, 27 Jul 1998 11:36:05 -0700 (PDT) From: Julian Elischer To: Luigi Rizzo cc: current@FreeBSD.ORG Subject: Re: SMP kernels... how many processes can be in ? In-Reply-To: <199807271345.PAA04072@labinfo.iet.unipi.it> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 27 Jul 1998, Luigi Rizzo wrote: > Hi, > > I am about to do some minor modifications to the dummynet code and, for > technical reasons (don't want to change interfaces to widely used > kernel functions) need to keep some state to be passed between > functions in a static variable. > > Something similar is already done in the ipfw package using the > DIVERT option. Now my doubt is, on a multiprocessor machine, could > it happen that multiple instances of the code in /sys/netinet are > run, in which case i should also have multiple instances of such > variables where i pass state ? In fine-graned SMP it breaks, however the 'chunkiness' of the present SMP means that only one processor is in the networking stacks at a time.. now I've been thinking about how to fix this... 1/ Some extra flags in the header mbuf. 2/ sticking some 'MT_RIGHTS' or 'MT_CONTROL' mbufs can be added on the head or end of the packet, and used to hold this info. (encoded like tcp options.. 1 byte type, 1 byte len, data.) the hack would be to put code that 'unpacks' this info on entry to ip_input and ip_output. (and tcp_input) Normal data flow woudl be the same if the lead type or flags did not indicate the existance of these modifiers.. I would include a 'flow' as one of the modifiers. julian > > luigi > -----------------------------+-------------------------------------- > Luigi Rizzo | Dip. di Ingegneria dell'Informazione > email: luigi@iet.unipi.it | Universita' di Pisa > tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) > fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ > _____________________________|______________________________________ > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message