Date: Thu, 14 Jan 2016 01:14:21 +0300 From: Alexander V. Chernikov <melifaro@ipfw.ru> To: Karim Fodil-Lemelin <fodillemlinkarim@gmail.com>, "freebsd-ipfw@freebsd.org" <freebsd-ipfw@freebsd.org>, freebsd-net <freebsd-net@freebsd.org> Subject: Re: ipfw NAT, igb and hardware checksums Message-ID: <552671452723261@web11h.yandex.ru> In-Reply-To: <5696ABBE.4050709@gmail.com> References: null <5696ABBE.4050709@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
13.01.2016, 22:56, "Karim Fodil-Lemelin" <fodillemlinkarim@gmail.com>: > Hi, > > I've hit a very interesting problem with ipfw-nat and local TCP traffic > that has enough TCP options to hit a special case in m_megapullup(). > Here is the story: > > I am using the following NIC: > > igb0@pci0:4:0:0: class=0x020000 card=0x00008086 chip=0x150e8086 > rev=0x01 hdr=0x00 > > And when I do ipfw nat to locally emitted packets I see packets not > being processed in the igb driver for HW checksum. Now a quick search > for m_pullup in the igb driver code will show that our igb driver > expects a contiguous ethernet + ip header in igb_tx_ctx_setup(). Now the > friendly m_megapullup() in alias.c doesn't reserve any space before the > ip header for the ethernet header after its call to m_getcl like > tcp_output.c (see m->m_data += max_linkhdr in tcp_output.c). > > So the call to M_PREPEND() in ether_output() is forced to prepend a new > mbuf for the ethernet header, leading to a non contiguous ether + ip. > This in turn leads to a failure to properly read the IP protocol in the > igb driver and apply the proper HW checksum function. Particularly this > call in igb_tcp_ctx_setup(): ip = (struct ip *)(mp->m_data + ehdrlen); Thanks for the detailed explanation. Looks reasonable. I'll do several more tests on that and commit. > > It would be nice if some FBSD comitter could review and hopefully add > this patch to FBSD. > > Thank you, > > Karim. > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?552671452723261>