From 739ccb1a8c1a7fd6202022d6a9f7910800b3b025 Mon Sep 17 00:00:00 2001 From: Mike Belopuhov Date: Wed, 7 Nov 2012 12:46:50 +0000 Subject: do not depend on IFCAP_CSUM flags set when reading rx checksumming results from the hardware --- sys/dev/pci/if_oce.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'sys') diff --git a/sys/dev/pci/if_oce.c b/sys/dev/pci/if_oce.c index b5d6794f436..84eaaaa4125 100644 --- a/sys/dev/pci/if_oce.c +++ b/sys/dev/pci/if_oce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_oce.c,v 1.42 2012/11/07 12:43:35 mikeb Exp $ */ +/* $OpenBSD: if_oce.c,v 1.43 2012/11/07 12:46:49 mikeb Exp $ */ /* * Copyright (c) 2012 Mike Belopuhov @@ -1163,18 +1163,16 @@ oce_rxeof(struct oce_rq *rq, struct oce_nic_rx_cqe *cqe) /* first fragment, fill out much of the packet header */ pkt->mbuf->m_pkthdr.len = len; pkt->mbuf->m_pkthdr.csum_flags = 0; - if (IF_CSUM_ENABLED(ifp)) { - if (cqe->u0.s.ip_cksum_pass) { - if (!cqe->u0.s.ip_ver) { /* IPV4 */ - pkt->mbuf->m_pkthdr.csum_flags = - M_IPV4_CSUM_IN_OK; - } - } - if (cqe->u0.s.l4_cksum_pass) { - pkt->mbuf->m_pkthdr.csum_flags |= - M_TCP_CSUM_IN_OK | M_UDP_CSUM_IN_OK; + if (cqe->u0.s.ip_cksum_pass) { + if (!cqe->u0.s.ip_ver) { /* IPV4 */ + pkt->mbuf->m_pkthdr.csum_flags = + M_IPV4_CSUM_IN_OK; } } + if (cqe->u0.s.l4_cksum_pass) { + pkt->mbuf->m_pkthdr.csum_flags |= + M_TCP_CSUM_IN_OK | M_UDP_CSUM_IN_OK; + } m = tail = pkt->mbuf; } pkt->mbuf = NULL; -- cgit v1.2.3