From owner-freebsd-net@FreeBSD.ORG Sun Jun 5 01:07:27 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F14D416A41C for ; Sun, 5 Jun 2005 01:07:27 +0000 (GMT) (envelope-from silby@silby.com) Received: from relay.pair.com (relay00.pair.com [209.68.1.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 815A943D48 for ; Sun, 5 Jun 2005 01:07:25 +0000 (GMT) (envelope-from silby@silby.com) Received: (qmail 70429 invoked from network); 5 Jun 2005 01:07:24 -0000 Received: from unknown (HELO localhost) (unknown) by unknown with SMTP; 5 Jun 2005 01:07:24 -0000 X-pair-Authenticated: 209.68.2.70 Date: Sat, 4 Jun 2005 20:07:12 -0500 (CDT) From: Mike Silbersack To: jun lu In-Reply-To: <20050601032104.65888.qmail@web15502.mail.cnb.yahoo.com> Message-ID: <20050604200407.U14750@odysseus.silby.com> References: <20050601032104.65888.qmail@web15502.mail.cnb.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org Subject: Re: some question about mbuf reuse X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2005 01:07:28 -0000 On Wed, 1 Jun 2005, jun lu wrote: > our project write a web server in freebsd kernel. we can receive and > send data directly in kernel.Now i have some idea, i think i can creat a > mbuf with cluster buffer before i send some data,because the data i want > to send are all in kernel,so i can take thest data in cluster i create > before,and transfer this mbuf to sosend(),then i make tcp/ip cann't > release this mbuf after it received the ack.In this way, i can send data > in kernel next time use the same mbuf with different cluster.i am not > sure whether this way can enhance the performance.So,i hope some one can > discuss with me I don't think that what you are proposing would work. Mbuf clusters can be used in multiple mbuf chains at the same time, but I don't see how you could do that with mbufs. You probably should focus your optimization efforts elsewhere, because changing the mbuf api would make your code diverge too much from the standard FreeBSD kernel to be useful to anyone. Mike "Silby" Silbersack