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 622D0A00BE; Wed, 30 Oct 2019 08:53:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 383E61BF19; Wed, 30 Oct 2019 08:53:05 +0100 (CET) Received: from relay.smtp.broadcom.com (unknown [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id 6055E1BF06 for ; Wed, 30 Oct 2019 08:53:01 +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 DEB9D1BAFC3; Wed, 30 Oct 2019 00:52:59 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com DEB9D1BAFC3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1572421980; bh=8eFbcAEWuzakP0xQWb9TRc2WsB5ne7Or1LCYQRpr+I8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QPNFTbsWl8gP9lJueG+dIND2HmhjwPG+d/lGXHbw/Zb4tpGH6C7WIpJ794HBII7bQ rRrzeskyOutVZTc1tSIErg29It70DfudKAIL+fyHvLFW9sCSnZtMOFMVxJ3Ag7Jl5u Gh5HCf1fbRh1RaDr9LWweyXAYwwsFQkUnzUnGxEA= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Wed, 30 Oct 2019 13:34:34 +0530 Message-Id: <20191030080438.27530-2-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20191030080438.27530-1-kalesh-anakkur.purayil@broadcom.com> References: <20191030080438.27530-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH 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 */ -- 1.8.3.1