sync code with last fixes and improvements from OpenBSD
This commit is contained in:
parent
f960599e67
commit
691f97cc10
215 changed files with 1520 additions and 11518 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_ix.c,v 1.200 2023/07/18 16:01:20 bluhm Exp $ */
|
||||
/* $OpenBSD: if_ix.c,v 1.202 2023/07/28 20:25:08 bluhm Exp $ */
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
|
@ -3225,30 +3225,27 @@ ixgbe_rxeof(struct rx_ring *rxr)
|
|||
sendmp = rxbuf->fmp;
|
||||
rxbuf->buf = rxbuf->fmp = NULL;
|
||||
|
||||
if (sendmp != NULL) { /* secondary frag */
|
||||
sendmp->m_pkthdr.len += mp->m_len;
|
||||
|
||||
/*
|
||||
* 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 {
|
||||
if (sendmp == NULL) {
|
||||
/* 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;
|
||||
sendmp->m_pkthdr.len = 0;
|
||||
sendmp->m_pkthdr.ph_mss = 0;
|
||||
#if NVLAN > 0
|
||||
if (sc->vlan_stripping && staterr & IXGBE_RXD_STAT_VP) {
|
||||
sendmp->m_pkthdr.ether_vtag = vtag;
|
||||
sendmp->m_flags |= M_VLANTAG;
|
||||
SET(sendmp->m_flags, M_VLANTAG);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
sendmp->m_pkthdr.len += mp->m_len;
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/* Pass the head pointer on */
|
||||
if (eop == 0) {
|
||||
|
@ -3275,6 +3272,10 @@ ixgbe_rxeof(struct rx_ring *rxr)
|
|||
/* Calculate header size. */
|
||||
ether_extract_headers(sendmp, &ext);
|
||||
hdrlen = sizeof(*ext.eh);
|
||||
#if NVLAN > 0
|
||||
if (ext.evh)
|
||||
hdrlen += ETHER_VLAN_ENCAP_LEN;
|
||||
#endif
|
||||
if (ext.ip4)
|
||||
hdrlen += ext.ip4->ip_hl << 2;
|
||||
if (ext.ip6)
|
||||
|
@ -3292,7 +3293,8 @@ ixgbe_rxeof(struct rx_ring *rxr)
|
|||
* mark it as TSO, set a correct mss,
|
||||
* and recalculate the TCP checksum.
|
||||
*/
|
||||
paylen = sendmp->m_pkthdr.len - hdrlen;
|
||||
paylen = sendmp->m_pkthdr.len > hdrlen ?
|
||||
sendmp->m_pkthdr.len - hdrlen : 0;
|
||||
if (ext.tcp && paylen >= pkts) {
|
||||
SET(sendmp->m_pkthdr.csum_flags,
|
||||
M_TCP_TSO);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue