From owner-freebsd-hackers Thu Jul 24 20:11:36 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id UAA10108 for hackers-outgoing; Thu, 24 Jul 1997 20:11:36 -0700 (PDT) Received: from itojun.csl.sony.co.jp (root@itojun.csl.sony.co.jp [133.138.1.134]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA10102 for ; Thu, 24 Jul 1997 20:11:33 -0700 (PDT) From: itojun@itojun.org Received: from localhost (itojun@localhost [127.0.0.1]) by itojun.csl.sony.co.jp (8.8.5/3.3W3) with ESMTP id MAA16906 for ; Fri, 25 Jul 1997 12:11:17 +0900 (JST) To: hackers@freebsd.org Subject: odd xxget() in some network drivers X-Template-Reply-To: itojun@itojun.org X-Template-Return-Receipt-To: itojun@itojun.org X-PGP-Fingerprint: F8 24 B4 2C 8C 98 57 FD 90 5F B4 60 79 54 16 E2 X-Mailer: comp (MHng project) version 1997/04/30 02:23:09, by Jun-ichiro Itoh MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Content-ID: Date: Fri, 25 Jul 1997 12:11:17 +0900 Message-ID: <16903.869800277@itojun.csl.sony.co.jp> Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk If my memory is correct, it is assumed that network packets received by NICs should be placed into either: - single internal mbuf - two internal mbufs - multiple external mbufs (for ground information, see m_devget() in /sys/kern/uipc_mbuf.c or "TCP/IP illustrated vol.2" p42) # second case (two internal mbufs) can be omitted for simplicity # in current memory-rich environment, IMHO. However, there seems to be several drivers that does not meet this practice. For example, /sys/dev/vx/if_vx.c will return the packet received in one of the following condition: - single internal mbuf (only if len % 4 == 0) - two internal mbufs (if len % 4 != 0) mbuf 1: m_len = len - (len % 4) mbuf 2: m_len = len % 4 - three internal mbufs mbuf 1: m_len = MLEN mbuf 2: m_len = len - mlen - (len % 4) mbuf 3: m_len = len % 4 - one external mbuf (only if len % 4 == 0) - two external mbufs mbuf 1: m_len = len - (len % 4) mbuf 2: m_len = len % 4 - more than two external mbuf mbuf 1: m_len = MCLBYTES ... mbuf n: m_len = len % 4 I sent PR kernel/4020 but nobody seem to reply to this one. Questions: - could I apply the patch in kernel/4020 to the current source? (who is the boss in /sys/dev/vx?) - could I make some check for other drivers, and apply patches if necessery? Thanks. Jun-ichiro Itoh