From owner-freebsd-current Mon Jul 27 22:44:21 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA06385 for freebsd-current-outgoing; Mon, 27 Jul 1998 22:44:21 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id WAA06375 for ; Mon, 27 Jul 1998 22:44:17 -0700 (PDT) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id FAA04809; Tue, 28 Jul 1998 05:50:58 +0200 From: Luigi Rizzo Message-Id: <199807280350.FAA04809@labinfo.iet.unipi.it> Subject: Re: SMP kernels... how many processes can be in ? To: julian@whistle.com (Julian Elischer) Date: Tue, 28 Jul 1998 05:50:57 +0200 (MET DST) Cc: mike@smith.net.au, wollman@khavrinen.lcs.mit.edu, current@FreeBSD.ORG In-Reply-To: from "Julian Elischer" at Jul 27, 98 04:55:39 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > trouble is that there needs to be some place to store data > on a 'packet by packet' basis, The data is generated at one point in > processing and needed at another.. > but what if the packet gets queued in between? that's a minor problem in a sence because the queue must have room for the additional info in whatever form you need. > and how do you pass the information into (for example ip_input()) > a function when the arguments of that function are alread defined and well > known. What ever solution you have should be extensible so as to be used > by as-yet un-thought-of users. my idea (similar in principle to the mbuf one you propose) is to adopt one (or a set) of special structs which the caller fills up with all parameters it needs. The called function (say ip_input in this case) first checks its args and if they correspond to the special struct then operates specially. Something like struct xyz_parms { T a ; T2 b ; struct mbuf *m ; } xyz_arg ; In the caller: ... xyz_arg.m = m ; xyz_arg.a = ... ' ip_input ( struct mbuf *)&xyz_arg ); in the called fn: ip_input(struct mbuf *m) { if (m == (struct mbuf *)&xyz_arg ) { struct xyz_parms *p = (struct xyz_parms *)m ; m = p-> m ; /* do special processing with p->a */ } ... My problem is, do we have multiple instances of the kernel running in parallel, so that i need an array of xyz_arg[], one per CPU ? And if this is the case, how do i know the CPU i am running on, so that i can assign the right xyz_arg[i] without having to use locks to allocate them ? 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