From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 2 00:36:51 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AA8E1065673 for ; Sun, 2 Nov 2008 00:36:51 +0000 (UTC) (envelope-from freebsd.dev@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mx1.freebsd.org (Postfix) with ESMTP id DF0CA8FC14 for ; Sun, 2 Nov 2008 00:36:50 +0000 (UTC) (envelope-from freebsd.dev@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1526554fgb.35 for ; Sat, 01 Nov 2008 17:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=7XfYhQlpfsMtQBt8m9R9t97Q7Pz1meSul1vBvdC8k38=; b=mIe3g7MAkmkJeQN40xPqhTUuFHBBg51CKwgutttpgvoV5QvPHrXXlWo0i6HudfbWxP XuQD967XE5/Imu1zQ8JNjflW9IbcO760JYzEXJdpbJ0IRU1EXIhpzrZs4XNk1325CPdH si8hrrnvx6Th5jutUJjct5goGWnALO+LefbtE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=Ou3cpBD5DZ2Ry1+f64eF1ytvE51288ph7C2wH5ZB5AuDL065rVm91E0957IMKUCKId 3HPWeutk0tdfa9Tw5FlYy5bZR3CWuxgN2GMj5ygswCFO0vlDndqngWid4SjSXDbLR8zc D5qvsmXqT+6pElErBYYjIhxrOtsGs+KbBFJyQ= Received: by 10.86.68.2 with SMTP id q2mr4684705fga.3.1225584523261; Sat, 01 Nov 2008 17:08:43 -0700 (PDT) Received: by 10.86.68.14 with HTTP; Sat, 1 Nov 2008 17:08:43 -0700 (PDT) Message-ID: <50cd4e5f0811011708t1f4fc665u592602d5085a6d56@mail.gmail.com> Date: Sat, 1 Nov 2008 19:08:43 -0500 From: "Biks N" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Need to optimize cutstom kernel hacks X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 00:36:51 -0000 Hi, 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 :) Bikrant