Skip to content
/ src Public

Commit 554dd12

Browse files
committed
Reorder checks for I210/I350 chips so that we don't remove the last 4 bytes
of the packet if they happen to be split across an mbuf boundary, as these always strip the CRC before the driver sees it. all the hard work figuring out what was happening done by dtucker@ tested on I210 by dtucker@ and kevlo@, on I350 by me and hrvoje ok kevlo@ stsp@
1 parent 67948ec commit 554dd12

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

sys/dev/pci/if_em.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
3131
3232
***************************************************************************/
3333

34-
/* $OpenBSD: if_em.c,v 1.378 2024/08/31 16:23:09 deraadt Exp $ */
34+
/* $OpenBSD: if_em.c,v 1.379 2025/07/14 11:52:43 jmatthew Exp $ */
3535
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
3636

3737
#include <dev/pci/if_em.h>
@@ -3116,13 +3116,14 @@ em_rxeof(struct em_queue *que)
31163116

31173117
if (status & E1000_RXD_STAT_EOP) {
31183118
eop = 1;
3119-
if (desc_len < ETHER_CRC_LEN) {
3119+
if (sc->hw.mac_type == em_i210 ||
3120+
sc->hw.mac_type == em_i350) {
3121+
/* crc has already been stripped */
3122+
len = desc_len;
3123+
} else if (desc_len < ETHER_CRC_LEN) {
31203124
len = 0;
31213125
prev_len_adj = ETHER_CRC_LEN - desc_len;
3122-
} else if (sc->hw.mac_type == em_i210 ||
3123-
sc->hw.mac_type == em_i350)
3124-
len = desc_len;
3125-
else
3126+
} else
31263127
len = desc_len - ETHER_CRC_LEN;
31273128
} else {
31283129
eop = 0;

0 commit comments

Comments
 (0)