Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jul 1997 12:11:17 +0900
From:      itojun@itojun.org
To:        hackers@freebsd.org
Subject:   odd xxget() in some network drivers
Message-ID:  <16903.869800277@itojun.csl.sony.co.jp>

next in thread | raw e-mail | index | archive | help
	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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?16903.869800277>