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 6BDD4A0352; Mon, 4 Nov 2019 23:50:35 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B7A352F42; Mon, 4 Nov 2019 23:50:33 +0100 (CET) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 563B22BF4; Mon, 4 Nov 2019 23:50:32 +0100 (CET) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id E4A4E30C101; Mon, 4 Nov 2019 14:47:43 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com E4A4E30C101 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1572907663; bh=4F8h+DwiYmL1+bH5BTg/BcNpJWF6TJbhko9sWwnfBUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X4kvfXNkKlQz9q0APu383PrttoFD9dOagutObAYKrYbzO/nRUu1jtCQX3km9ypof9 D+eCvn6AnEtvAX51/TTy7KZ9BPQV7Na2FCqDS3WVMQPvXbkYssjDOkGJv+pkDZFP70 WSaH3irSdQGnLt132m51LJQvCUnU9YD3Ec7R9bhg= Received: from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net [10.69.74.102]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id D8B8614008C; Mon, 4 Nov 2019 14:50:29 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kalesh AP , stable@dpdk.org, Somnath Kotur Date: Mon, 4 Nov 2019 14:50:22 -0800 Message-Id: <20191104225026.97569-2-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20191104225026.97569-1-ajit.khaparde@broadcom.com> References: <20191104100240.28974-1-kalesh-anakkur.purayil@broadcom.com> <20191104225026.97569-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 1/5] net/bnxt: fix L4 checksum indication in non-vector 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 Reviewed-by: Ajit Khaparde --- 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 ee1444c1d..c35bc1afd 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.21.0 (Apple Git-122)