git: d0633af7658f - main - em: skip rxcsum offload processing when disabled

From: Vincenzo Maffione <vmaffione_at_FreeBSD.org>
Date: Wed, 01 Dec 2021 21:13:02 UTC
The branch main has been updated by vmaffione:

URL: https://cgit.FreeBSD.org/src/commit/?id=d0633af7658fe02bc1af8639ef6dbb0d029c1b65

commit d0633af7658fe02bc1af8639ef6dbb0d029c1b65
Author:     Vincenzo Maffione <vmaffione@FreeBSD.org>
AuthorDate: 2021-12-01 21:10:46 +0000
Commit:     Vincenzo Maffione <vmaffione@FreeBSD.org>
CommitDate: 2021-12-01 21:10:46 +0000

    em: skip rxcsum offload processing when disabled
    
    Similarly to the other Intel drivers, don't try to process
    RX checksum offloads when this feature (IFCAP_RXCSUM) is
    disabled.
    
    Reviewed by:    gallatin, kbowling, erj
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D33155
---
 sys/dev/e1000/em_txrx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c
index 6ac66a9011f4..1f1c13c9a099 100644
--- a/sys/dev/e1000/em_txrx.c
+++ b/sys/dev/e1000/em_txrx.c
@@ -706,7 +706,8 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
 		i++;
 	} while (!eop);
 
-	em_receive_checksum(staterr, staterr >> 24, ri);
+	if (if_getcapenable(ri->iri_ifp) & IFCAP_RXCSUM)
+		em_receive_checksum(staterr, staterr >> 24, ri);
 
 	if (staterr & E1000_RXD_STAT_VP) {
 		vtag = le16toh(rxd->wb.upper.vlan);