Another big step to kill superflous bloat
I rewrote the half of src/lq_packet.[ch] which deals with incoming packets. This was triggered with performance output of gcc procuced by Sven-Ola Tuecke at CCCamp07.
It kills lots of (more than) superflous malloc()s and the same number of (free()s). And it also kills some code.
And if someone wants to play around, I tagged the CVS with BEFORE_LQ_PACKET_PART_1 and AFTER_LQ_PACKET_PART_1.
BTW is *_PART_2 reserved for the sending side - a rewrite of this doesn't seem to save that much CPU power and it is much more complicated, but it is also worth.
Update on the simulation/test hardware
Does any one find a reason below why I don't have bad hardware karma?
- I replaced the broken power supply and got a (too thick) CPU fan.
- Then it didn't booted anymore - not even for the first error code on the display on the mainboard, nothing on the VGA display, etc. Plain simply "dead".
- I took it home and sent the mainboard to the seller (some Internet shop in Graz. And queued up for half an hour at the postal office - now I know why no one uses them if possible) to be exchanged because "it was br0ken from the begin".
- They actually accepted it as such and sent a new mainboard (+ cables etc.). I ordered elsewhere (Internet shop in Vienna) a correct CPU fan.
- Both arrived just at the end of my holidays.
- I put all the stuff in - the BIOS was a V1.03 (a newer one - which we wanted to flash - than the one on the broken/old mainboard). Didn't really boot reliable with 8 GB RAM. but it booted with 4 GB RAM. Checked the BIOS again, just be sure: At the begin of August, BIOS V1.04 came out. Downloaded it and tried to flash it. According to the docs there, one needs a DOS boot floppy.
- Alas, the mainboard didn't want to boot from my USB-Stick - neither from the small 1.44 pseudo-floppy (aka "USB floppy") nor from the large partition (aka "USB disk"). For other mainboards, it worked BTW (but I'm almost never booting hardware from an USB stick - we have a portable DVD drive at work and that works for all somewhat recent PCs/BIOSes/....). Making a "native" boot floppy was not possible - either no floppy drive in the (Windows) PC (read: the Win-PC of my colleague at work.
- and my laptop) or Win2000 there (you can't make DOS boot floppies with Win2000 - no "sys a:", no "format /s")
- Downloaded DOS boot floppies and find some fscking floppy and a floppy drive where it actually works.
- Added a floppy to texas.funkfeuer.at. Did it. After various tries with "which boot floppy does actually work." Yes, I know, floppies and drives and combinations thereof were quite robust years ago. But either the hardware is getting bad "("dieing"?) or it's my bad hardware karma or something else.
- Now the thing booted 3 times without any problems with all 8 GB RAM onboard.
Ongoing Work
There is quite an action now:
- Sven- Ola Tuecke sent a patch to convert more plugins to the version 5 interface. As the changes were quite clear, I committed it.
- Hannes Gredler rewrote the route handling. I'm waiting for feedback and opinions before committing. Since Sven-Ola Tuecke integrated it the development FreiFunkFirmware, it should be pretty acceptable.
One issue remains (which is now in discussion on the olsr-dev@lists.olsr.org mailinglist): In his patch, Hannes has a pointer to the "struct interface" (which represents an network interface, e.g. "eth0" or "wlan0"). If an interface is deactivated ("down"), this struct is removed and the pointers are - thus - dangling. Sven-Ola wrote a patch to replace the pointer with the interface number and calls to the POSIX function "if_indextoname" to resolve the name (since that is the only purpose for the pointer apparently). But "Windows" ("POSIX compliant" if you really want to believe it's vendor) didn't has it on Windows XP. It has that only on Vista - if you belive their docs on http://msdn2.microsoft.com/en-us/library/bb408408.aspx.
- And Sven-Ola Tuecke also is working on the conversion of ioctl() to netlink sockets - at least for Linux. This has some minor issues since the Linux kernels netlink part is not so gracefully like the ioctl() interface.
Patch Update
I cvs-comitted several patches submitted via olsr-dev@olsr.org in the last days. To quote from the CHANGELOG:
---- snip ----
PATCHES by Sven-Ola Tücke to be found on from
http://download-master.berlin.freifunk.net/sven-ola/nylon/packages/olsrd/files/
- 110-olsrd-double-wlancard-neigh-hack.patch:
This is a hack for Nodes having to wifi cards with the same channel,
bssid, IP-Range etc. If two nodes can see each other by means of two
possible links (here: two wifi cards with equal config), a bug is triggered
with the Neigh-is-SYM detections. This small little hack prevents this.
- 112-olsrd-nameservice-fixemptyname.patch:
This is an addon to my lat/lon stuff which will prevent olsrd from
running (oops?) if no hostname is given and the nameservice plugin
is loaded.
- 113-olsrd-dyngwplain-pluginvers5.patch:
This updates the dyngwplain plugin to the new Plugin Iface
- 140-olsrd-arprefreshed.patch:
This is a new one. Opens a packet socket and listen to UDP(698), extract
the sender MAC and refreshes the ARP cache whith that. Should speedup
especially in cases, if you initially try to use a longer routing path which normally
triggers a "ARP-Lookup-Chain".
PATCH by Arnd Hannemann
olsr_makefile_make_use_of_exename.patch
- This patch makes sure that the EXENAME variable of Makefile.inc is used
in Makefile.
---- snip ----
And some minor cleanups (as I stumbled over them)
---- snip ----
- paving the way to activate -Wshadow, much mor todo
- const-ify parameters here and there
- use NULL for pointers (and not "0")
- Killed "extern" declarations in (not generated) .c files
---- snip ----