Date: Sun, 11 Feb 2001 22:15:56 -0800 From: Julian Elischer <julian@elischer.org> To: Bill Paul <wpaul@FreeBSD.ORG> Cc: Archie Cobbs <archie@dellroad.org>, hackers@FreeBSD.ORG, net@FreeBSD.ORG Subject: Re: call for testers: port aggregation netgraph module Message-ID: <3A877F9C.9641A97F@elischer.org> References: <20010212025610.F37C937B401@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Bill Paul wrote: > > > > You know, so far I've gotten close to a dozen replies to this e-mail, > but none of contain the one thing I really wanted, namely test results. actually I saw one person say it worked flawlessly for them (see mail from: Rainer Clasen <bj@zuto.de> ) (working in 4.2) > > Look. I said this was a call for *testers*. Not kibitzers, not criticizers, > not commenters, not lamers -- *testers*. I want you to try out the code > and tell me if it works or not, and if not, describe the bugs so I can > fix them. I don't want to hear anything else. If your e-mail concerns > any other topic, it will be summarily ignored. Got it people? Good. Ok well how about code suggestions from the netgraph writers? Put me in your position.. You are one of the first people to use netgraph so I and interested in hearing results from YOU.. now as for the code.. in the 5.0 version you may add the following code to the ng_fec_free_unit() function.. (you took it from 4.x ng_iface.c but this snippet was added to 5.x) /* * XXX We could think about reducing the size of ng_iface_units[] * XXX here if the last portion is all ones * XXX At least free it if no more units. * Needed if we are to eventually be able to unload. */ ng_units_in_use--; if (ng_units_in_use == 0) { /* XXX make SMP safe */ FREE(ng_iface_units, M_NETGRAPH_IFACE); ng_iface_units_len = 0; ng_iface_units = NULL; } > in 5.x SMP you may have trouble with synchronising the timout callout and normal activity, especially removal of a port. I am still working on the 'right' way to do this, so I'll let you know when I have the 'correct' answer. You have allowed any hooks to be added yet you don't use hooks. (something I have issues with, but hey, it's your node) This is ok except that you will leak mbufs badly if anything is ever sent to the node via a hook you have allowed to be created, because you just accept the packet and then leak it. You should add in the 5.x version: NG_FREE_ITEM(item); and in the 4.x version: NG_FREE_DATA(m, meta); OR alernatively you could NOT DECLARE a rcvdata method (leave it NULL), in which case this will be done automatically. All ethernet class interfaces grow a ng_ether interface automaticaly when ng_ether.c is modloaded, so I would have used and extended that interface to connect to the drivers rather than the way you did. The reason is that it allows arbitrary stacking of protocol elements rather than just a direct version such as you have done. You've used the netgraph infrastructure very well, yet somehow completely avoided the aim of netgraph which is to allow objects to be connected together in arbitrary fashion. You've got the 'net' but completely closed off the 'graph' part.. I would have added some control messages to the ng_ether class to handle the specific functions needed to do this sort of thing. still what you did works just fine, and with the caveat of the suggestions I made re: leaking mbufs, and synchronisation, I see no real problems > -Bill > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message -- __--_|\ Julian Elischer / \ julian@elischer.org ( OZ ) World tour 2000-2001 ---> X_.---._/ v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A877F9C.9641A97F>