With tweaks from patrick@ and bluhm@.
OK bluhm@
-/* $OpenBSD: if_ix.c,v 1.195 2023/05/18 08:22:37 jan Exp $ */
+/* $OpenBSD: if_ix.c,v 1.196 2023/05/23 09:16:16 jan Exp $ */
/******************************************************************************
sendmp = rxbuf->fmp;
rxbuf->buf = rxbuf->fmp = NULL;
- if (sendmp != NULL) /* secondary frag */
+ if (sendmp != NULL) { /* secondary frag */
sendmp->m_pkthdr.len += mp->m_len;
- else {
+
+ /*
+ * This function iterates over interleaved descriptors.
+ * Thus, we reuse ph_mss as global segment counter per
+ * TCP connection, instead of introducing a new variable
+ * in m_pkthdr.
+ */
+ if (rsccnt)
+ sendmp->m_pkthdr.ph_mss += rsccnt - 1;
+ } else {
/* first desc of a non-ps chain */
sendmp = mp;
sendmp->m_pkthdr.len = mp->m_len;
+ if (rsccnt)
+ sendmp->m_pkthdr.ph_mss = rsccnt - 1;
#if NVLAN > 0
if (sc->vlan_stripping && staterr & IXGBE_RXD_STAT_VP) {
sendmp->m_pkthdr.ether_vtag = vtag;
SET(sendmp->m_pkthdr.csum_flags, M_FLOWID);
}
+ if (sendmp->m_pkthdr.ph_mss == 1)
+ sendmp->m_pkthdr.ph_mss = 0;
+
+ if (sendmp->m_pkthdr.ph_mss > 0) {
+ struct ether_extracted ext;
+ uint16_t pkts = sendmp->m_pkthdr.ph_mss;
+
+ ether_extract_headers(sendmp, &ext);
+ if (ext.tcp)
+ tcpstat_inc(tcps_inhwlro);
+ else
+ tcpstat_inc(tcps_inbadlro);
+ tcpstat_add(tcps_inpktlro, pkts);
+ }
+
ml_enqueue(&ml, sendmp);
}
next_desc:
-/* $OpenBSD: tcp_usrreq.c,v 1.218 2023/05/10 12:07:16 bluhm Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.219 2023/05/23 09:16:16 jan Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
ASSIGN(tcps_outhwtso);
ASSIGN(tcps_outpkttso);
ASSIGN(tcps_outbadtso);
+ ASSIGN(tcps_inhwlro);
+ ASSIGN(tcps_inpktlro);
+ ASSIGN(tcps_inbadlro);
#undef ASSIGN
-/* $OpenBSD: tcp_var.h,v 1.166 2023/05/18 08:22:37 jan Exp $ */
+/* $OpenBSD: tcp_var.h,v 1.167 2023/05/23 09:16:16 jan Exp $ */
/* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */
/*
u_int32_t tcps_outhwtso; /* output tso processed by hardware */
u_int32_t tcps_outpkttso; /* packets generated by tso */
u_int32_t tcps_outbadtso; /* output tso failed, packet dropped */
+ u_int32_t tcps_inhwlro; /* input lro from hardware */
+ u_int32_t tcps_inpktlro; /* packets coalesced by hardware lro */
+ u_int32_t tcps_inbadlro; /* input bad lro packets */
};
/*
tcps_outhwtso,
tcps_outpkttso,
tcps_outbadtso,
+ tcps_inhwlro,
+ tcps_inpktlro,
+ tcps_inbadlro,
tcps_ncounters,
};
-/* $OpenBSD: inet.c,v 1.175 2023/05/10 12:07:17 bluhm Exp $ */
+/* $OpenBSD: inet.c,v 1.176 2023/05/23 09:16:16 jan Exp $ */
/* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */
/*
p(tcps_inswcsum, "\t\t%u packet%s software-checksummed\n");
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_inhwlro, "\t\t%u input LRO generated packet%s from hardware\n");
+ p(tcps_inpktlro, "\t\t%u input LRO coalesced packet%s by hardware\n");
+ p(tcps_inbadlro, "\t\t%u input bad LRO packet%s\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");