From owner-freebsd-hackers Fri May 21 12:22:51 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from dingo.cdrom.com (castles521.castles.com [208.214.165.85]) by hub.freebsd.org (Postfix) with ESMTP id 963FD1502C for ; Fri, 21 May 1999 12:22:48 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.cdrom.com [127.0.0.1]) by dingo.cdrom.com (8.9.3/8.8.8) with ESMTP id MAA01832; Fri, 21 May 1999 12:20:54 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Message-Id: <199905211920.MAA01832@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Zhihui Zhang Cc: freebsd-hackers@freebsd.org Subject: Re: mmap of a network buffer In-reply-to: Your message of "Fri, 21 May 1999 14:15:20 EDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 21 May 1999 12:20:54 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > I really do not know how to describe the problem. But a friend here asks > me how to mmap a network buffer so that there is no need to copy the data > from user space to kernel space. We are not sure whether FreeBSD can > create a device file (mknod) for a network card, and if so, we can use the > mmap() call to do so because mmap() requires a file descriptor. We assume > that the file descriptor can be acquired by opening the network device. > If this is infeasible, is there another way to accomplish the same goal? Use sendfile() for zero-copy file transmission; in all other cases it's necessary to copy data into the kernel. Memory-mapping a network buffer makes no sense if you just think about it for a moment... There's also very little need for this under "real" circumstances; some simple tests have demonstrated we can sustain about 800Mbps throughput (UDP), and the bottleneck here seems to be checksum calculations, not copyin/out. -- \\ The mind's the standard \\ Mike Smith \\ of the man. \\ msmith@freebsd.org \\ -- Joseph Merrick \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message