On Thu, Jul 27, 2023 at 09:15:48AM -0700, Chris Cappuccio wrote: > Jan Klemkow [j.klem...@wemelug.de] wrote: > > +#if NVLAN > 0 > > + if (ext.evh) > > + hdrlen += ETHER_VLAN_ENCAP_LEN; > > +#endif > > if (ext.ip4) > > hdrlen += ext.ip4->ip_hl << 2; > > if (ext.ip6) > > I'm not sure this should be tied to the compilation of the vlan > driver in the kernel. Since the length is larger in either case, > the ix driver should behave the same in either case.
If NVLAN is not compiled in, vlan should be ignored here. That works as ether_extract_headers() also has #if NVLAN > 0. Then ext.ip4 and ext.ip6 is NULL. This is correct in this place. More important question is what happens when ether_extract_headers() is called during transmit in em(4), igc(4), ixl(4) and ix(4). Without NVLAN in kernel everything is fine as ether_extract_headers() ignores IP in packets with vlan tag. With vlan it looks like checksum offloading is broken if M_VLANTAG is not set. But with vlan hardware offloading everything should work. That is the case for em(4), ixl(4) and ix(4). igc(4) has #ifdef notyet #if NVLAN > 0, so I guess transmit checksum offload does not work for vlan packets. Jan's diff improves it a little bit, but does not fix it completely. I will test and see what works. But this is unrelated to Jan's fix. I think it should be commited, as I see better test results with ix(4) and it should fix sthen's setup. bluhm