From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 47A9FA04A2; Mon, 4 Nov 2019 10:51:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CDD3F4C8B; Mon, 4 Nov 2019 10:51:09 +0100 (CET) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id 1DADB397D for ; Mon, 4 Nov 2019 10:51:06 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 0C3C91BCA24; Mon, 4 Nov 2019 01:51:04 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 0C3C91BCA24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1572861065; bh=9YR0/lJHILMxnFdITuFaM92aG4+TxEc9ycsEC7MyXtg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q4YCbC+RrhxpUYAU83cMAJPEI3gGtD+AJaWp4FmFv+GbuI9NGIY99YbmdQs88YFHy mb8QH73/Jwethh0KwePcY3BvcriUjfVlbLd/DXgpRquWSUYI6TF1c73SKcUc/15Hev FOeGq89pagEv2ofhy3YqKvF4a0cr8sYnVmZMCqPc= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Mon, 4 Nov 2019 15:32:36 +0530 Message-Id: <20191104100240.28974-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20191104100240.28974-1-kalesh-anakkur.purayil@broadcom.com> References: <20191104100240.28974-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH v2 1/5] net/bnxt: fix L4 checksum error indication in non-vector mode rx X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP Update "mbuf->ol_flags" correctly for inner and ourter ip checksum errors in case of tunnel and non-tunnel packets. Fixes: 65ee636872eb ("net/bnxt: fix Rx checksum flags") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_rxr.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index ee1444c..c35bc1a 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -512,15 +512,19 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, flags2_f = flags2_0xf(rxcmp1); /* IP Checksum */ - if (unlikely(((IS_IP_NONTUNNEL_PKT(flags2_f)) && - (RX_CMP_IP_CS_ERROR(rxcmp1))) || - (IS_IP_TUNNEL_PKT(flags2_f) && - (RX_CMP_IP_OUTER_CS_ERROR(rxcmp1))))) { - mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD; + if (likely(IS_IP_NONTUNNEL_PKT(flags2_f))) { + if (unlikely(RX_CMP_IP_CS_ERROR(rxcmp1))) + mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD; + else + mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD; + } else if (IS_IP_TUNNEL_PKT(flags2_f)) { + if (unlikely(RX_CMP_IP_OUTER_CS_ERROR(rxcmp1) || + RX_CMP_IP_CS_ERROR(rxcmp1))) + mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD; + else + mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD; } else if (unlikely(RX_CMP_IP_CS_UNKNOWN(rxcmp1))) { mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN; - } else { - mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD; } /* L4 Checksum */ -- 2.10.1