Need to optimize cutstom kernel hacks
freebsd.dev at gmail.com
Sat Nov 1 17:36:51 PDT 2008
To get started with FreeBSD kernel, I have been working on IP Packet
compression. After numerous crashes and failures now everything looks
good and stable. I am using kernel zlib routines to compress payload.
However I think my implementation is not efficient at all.
Here are the steps I am doing for compression:
1. copy Payload to empty buffer using m_copydata() function
2. call deflateInit2 () for deflate initialization
3. call deflate() for actual compression
4. copy the compressed data in buffer back to Payload
I have to go through all above 4 steps for each packet!
I think it will be lot faster and efficient if:
* Somehow get away with deflateinit2() each time for each packet.
* I can get to Payload pointer without using m_copydata() so that I
don't need to copy data back and forth.
Looking for your valuable suggestions and tips :)
More information about the freebsd-hackers