From: Jan Klemkow Subject: Re: names for TSO and LRO To: Alexander Bluhm Cc: tech@openbsd.org Date: Thu, 17 Apr 2025 15:23:43 +0200 On Wed, Apr 16, 2025 at 11:39:21PM +0200, Alexander Bluhm wrote: > Also the netstat -s description is not quite right anymore. The > idea is that we have one counter each when we do something in > software, and one for offloading. The loopback pseudo device it > special, as it just passes large packets. > > Here is an expample for lo(4). Large packets are processed by > device, but no small packets are on the network. > > tcp: > 34977 packets sent > 0 output TSO large packets chopped in software > 1486 output TSO large packets to device > 0 output TSO generated packets sent to network > 0 bad TSO packets dropped > 34970 packets received > 0 input LRO generated packets glued in software > 1486 input LRO generated packets from device > 0 input LRO small packets received from network > 0 bad LRO packets dropped > > And this is accounted with ixl(4). TSO is done in hardware, LRO > is software only implementation. > > tcp: > 3267132 packets sent > 0 output TSO large packets chopped in software > 4644123 output TSO large packets to device > 57013318 output TSO generated packets sent to network > 0 bad TSO packets dropped > 5962903 packets received > 5663423 input LRO generated packets glued in software > 0 input LRO generated packets from device > 40208598 input LRO small packets received from network > 0 bad LRO packets dropped > > ok? I like this rephrasing of the counter descriptions. As well as the fix of the loopback counter. ok jan@ for the part below Thanks, Jan > Index: sys/net/if.c > =================================================================== > RCS file: /data/mirror/openbsd/cvs/src/sys/net/if.c,v > diff -u -p -r1.729 if.c > --- sys/net/if.c 19 Mar 2025 23:29:49 -0000 1.729 > +++ sys/net/if.c 16 Apr 2025 20:39:52 -0000 > @@ -824,9 +824,7 @@ if_input_local(struct ifnet *ifp, struct > ISSET(ifp->if_capabilities, IFCAP_TSOv4)) || > (af == AF_INET6 && > ISSET(ifp->if_capabilities, IFCAP_TSOv6)))) { > - tcpstat_inc(tcps_inswlro); > - tcpstat_add(tcps_inpktlro, > - (m->m_pkthdr.len + ifp->if_mtu - 1) / ifp->if_mtu); > + tcpstat_inc(tcps_inhwlro); > } else { > tcpstat_inc(tcps_inbadlro); > m_freem(m); > Index: usr.bin/netstat/inet.c > =================================================================== > RCS file: /data/mirror/openbsd/cvs/src/usr.bin/netstat/inet.c,v > diff -u -p -r1.183 inet.c > --- usr.bin/netstat/inet.c 12 Aug 2024 06:22:36 -0000 1.183 > +++ usr.bin/netstat/inet.c 16 Apr 2025 21:18:39 -0000 > @@ -408,10 +408,13 @@ tcp_stats(char *name) > p(tcps_sndwinup, "\t\t%u window update packet%s\n"); > p(tcps_sndctrl, "\t\t%u control packet%s\n"); > p(tcps_outswcsum, "\t\t%u packet%s software-checksummed\n"); > - p(tcps_outswtso, "\t\t%u output TSO packet%s software chopped\n"); > - p(tcps_outhwtso, "\t\t%u output TSO packet%s hardware processed\n"); > - p(tcps_outpkttso, "\t\t%u output TSO packet%s generated\n"); > - p(tcps_outbadtso, "\t\t%u output TSO packet%s dropped\n"); > + p(tcps_outswtso, > + "\t\t%u output TSO large packet%s chopped in software\n"); > + p(tcps_outhwtso, > + "\t\t%u output TSO large packet%s to device\n"); > + p(tcps_outpkttso, > + "\t\t%u output TSO generated packet%s sent to network\n"); > + p(tcps_outbadtso, "\t\t%u bad TSO packet%s dropped\n"); > p(tcps_rcvtotal, "\t%u packet%s received\n"); > p2(tcps_rcvackpack, tcps_rcvackbyte, "\t\t%u ack%s (for %llu byte%s)\n"); > p(tcps_rcvdupack, "\t\t%u duplicate ack%s\n"); > @@ -440,11 +443,12 @@ tcp_stats(char *name) > p(tcps_rcvbadsig, "\t\t%u bad/missing md5 checksum%s\n"); > p(tcps_rcvgoodsig, "\t\t%llu good md5 checksum%s\n"); > p(tcps_inswlro, > - "\t\t%u input LRO packet%s passed through pseudo device\n"); > - p(tcps_inhwlro, "\t\t%u input LRO generated packet%s from hardware\n"); > + "\t\t%u input LRO generated packet%s glued in software\n"); > + p(tcps_inhwlro, > + "\t\t%u input LRO generated packet%s from device\n"); > p(tcps_inpktlro, > - "\t\t%u input LRO coalesced packet%s by network device\n"); > - p(tcps_inbadlro, "\t\t%u input bad LRO packet%s dropped\n"); > + "\t\t%u input LRO small packet%s received from network\n"); > + p(tcps_inbadlro, "\t\t%u bad LRO packet%s dropped\n"); > p(tcps_connattempt, "\t%u connection request%s\n"); > p(tcps_accepts, "\t%u connection accept%s\n"); > p(tcps_connects, "\t%u connection%s established (including accepts)\n");