git: 56eeb84f1093 - stable/13 - em: skip rxcsum offload processing when disabled

From: Vincenzo Maffione <vmaffione_at_FreeBSD.org>
Date: Sat, 18 Dec 2021 12:07:43 UTC
The branch stable/13 has been updated by vmaffione:

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

commit 56eeb84f1093a81ff9e103b09dcd12983609d1de
Author:     Vincenzo Maffione <vmaffione@FreeBSD.org>
AuthorDate: 2021-12-01 21:10:46 +0000
Commit:     Vincenzo Maffione <vmaffione@FreeBSD.org>
CommitDate: 2021-12-18 12:00:25 +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
    
    (cherry picked from commit d0633af7658fe02bc1af8639ef6dbb0d029c1b65)
---
 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);