Subject: Re: kern/31323 (vge on !i386 is broken.)
To: None <mrt@notwork.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: netbsd-bugs
Date: 11/26/2006 01:37:53
> Anyway, I have a small question while reading current if_vge.c
> (rev. 1.27).  Could you tell me why VGE_RX_PAD is defined as 0 in
> the case of !defined(__NO_STRICT_ALIGNMENT).

IIRC, to have less #ifdef in vge_rxeof() in case of receiving
multi-fragment packets:

>		if (rxstat & VGE_RXPKT_SOF) {
>			m->m_len = MCLBYTES - VGE_RX_PAD;
 :
>		if (sc->sc_rx_mhead != NULL) {
>			m->m_len = total_len % (MCLBYTES - VGE_RX_PAD);

Maybe it's better to have proper macro to represent RX bufsize.

> I think, if
> VGE_RX_PAD is 0 in the case of !defined(__NO_STRICT_ALIGNMENT),
> following ifdef block in vge_newbuf() (around line 1060) seems to
> have no difference in the both cases.  Logic flipped?

No. VGE_RX_PAD should always be 4 once it's removed from vge_rxeof().

Anyway, I'll fix it later to avoid confusion. Thanks.
---
Izumi Tsutsui