Rx/tx hardware checksumming statistics?

Christian Weisgerber naddy at mips.inka.de
Tue Aug 12 15:33:18 UTC 2008


Pyun YongHyeon <pyunyh at gmail.com> wrote:

>  > OpenBSD's re(4) driver is ported from FreeBSD.  Recently, Brad Smith
>  > has been merging the tx/rx checksum offload support for the newer
>  > chips (RTL8111C etc.) into the OpenBSD driver and I have done some
>  > testing for him.  Looking at the counters, I have noticed:
>  > * IP header rx checksumming is only registered for IP/TCP and IP/UDP
>  >   packets, but not for other protocols, such as IP/ICMP.
> 
> Note, the controller can only offload IP, TCP and UDP checksumming.
> ICMP should be handled by software.

Yes, but the IP/ICMP packet should still be subject to IP checksumming.

What I see with an 8111C (RL_FLAG_DESCV2):
* incoming IP/TCP packet
  => IP checksum processed in hardware
  => TCP checksum processed in hardware
* incoming IP/UDP packet
  => IP checksum processed in hardware
  => UDP checksum processed in hardware
* incoming IP/ICMP packet
  => IP checksum _not_ processed in hardware

With an old 8169S the latter case is different:
* incoming IP/ICMP packet
  => IP checksum processed in hardware

>  > limitations also apply to the FreeBSD driver, but without the
> 
> No, FreeBSD have no such limitation, re(4) takes full advantage of
> hardware assistance if the controller in question is known to work
> with the feature.

I cannot find any difference between the respective drivers suggesting
that the behavior above would be any different on FreeBSD.  There
are no relevant differences in the RX checksumming section in
re_rxeof().

>  > counters, how can you tell?
> 
> I think you can check the output of ifconfig(4).

This does not tell you if an individual received packet has been
marked CSUM_IP_CHECKED|CSUM_IP_VALID.

-- 
Christian "naddy" Weisgerber                          naddy at mips.inka.de



More information about the freebsd-net mailing list