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 96AEEA0487 for ; Mon, 29 Jul 2019 23:28:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 709001BFB4; Mon, 29 Jul 2019 23:28:32 +0200 (CEST) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 47AC51BF54 for ; Mon, 29 Jul 2019 23:28:31 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id u17so28884486pgi.6 for ; Mon, 29 Jul 2019 14:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=94t0zbGESv8BCrnbzIKYYzQIovl+yPZnf8zVk7Uk3+A=; b=FNN+HNaD1G27C3HlCuNvrB7aa2fdlOTboGpF9p9bqdylVnkD8ESS7k68mqwR6ceE8O SZ0mAc9KOymfAZL+ELaI6AtbOVdrmcMrEyOUVBAA3F6FJYZyhQt6Z1cSWy81nx7KVB+1 51EV4GrKhkdcNzEVrOcz3mNH0Upe+I1mHvn3c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=94t0zbGESv8BCrnbzIKYYzQIovl+yPZnf8zVk7Uk3+A=; b=CXgyuCan6tJso+7qCtUquwhtrw17O3mRtDmuTBtqR3cOa85j2XyL2yl4WOmV9/vwOQ Uo7aarnywYUn/KXgpMWxU50aPcuii0TI1aHfmoL7Sc4jPkCl5KbFBvmbCQlf3JtRAlYD o6b9RhEtOvokWFAbU8WO2ra/+Bw6+Rpth/sBVqJiZlmZnPWuM34vKJJTKZZLfCZu2/MR unOsqT7DMM79ndp3F5aXk6NG61qeBw10WVbxIY+nMc3hTpOA5fGhdZUAlsvNvxiztg3c 85qwf0K7QNM5JfKkP6iDMgfVTI5BUivJcdFqI26wBrxVL/0iigpe3kTgt2PpyeAVNYUf iJZg== X-Gm-Message-State: APjAAAXtAgUWZlM2mgMaXjabKMfcgfU2EXNigIhna/tQ90N2bgwOUlis BD2k0WRVpsl0gUB0njVKHpOgXqnoaGA8YkjHO6imA7qDEfW7xPsUSgSTVrA5WW/recJTjU3qrhj YwZIk70vQV7HoZKzAOs3Y5IDRwcawEZ40CPfD56PZhM89QUEAHYW6CR9q1CFEO/ja X-Google-Smtp-Source: APXvYqwO3QPYt+fCso7+bD8LZdO05PvEMLxEaHY0Bcj7KhbwlNbindp46LTc/Unj7rDeTHqHXwb1sQ== X-Received: by 2002:a62:ae01:: with SMTP id q1mr37661290pff.219.1564435710395; Mon, 29 Jul 2019 14:28:30 -0700 (PDT) Received: from localhost.localdomain ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id 23sm66396758pfn.176.2019.07.29.14.28.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 14:28:30 -0700 (PDT) From: Lance Richardson To: dev@dpdk.org Cc: ajit.khaparde@broadcom.com, Kalesh AP , Lance Richardson Date: Mon, 29 Jul 2019 17:28:25 -0400 Message-Id: <20190729212825.5077-1-lance.richardson@broadcom.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH 2/2] net/bnxt: set Rx checksum flags in vector mode receive 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 Fixed to return the checksum status of rx packets by setting "ol_flags" correctly in vector mode receive. These changes have been there for non vector mode receive. In vector mode receive also indicate inner and outer checksum errors individually in "ol_flag" to indicate L3 and L4 error. Fixes: bc4a000f2f53 ("net/bnxt: implement SSE vector mode") Signed-off-by: Kalesh AP Reviewed-by: Lance Richardson Signed-off-by: Lance Richardson --- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c index adc5020ec..2e6e83c94 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c +++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c @@ -157,6 +157,52 @@ bnxt_parse_pkt_type(struct rx_pkt_cmpl *rxcmp, struct rx_pkt_cmpl_hi *rxcmp1) return pkt_type; } +static void +bnxt_parse_csum(struct rte_mbuf *mbuf, struct rx_pkt_cmpl_hi *rxcmp1) +{ + uint32_t flags; + + flags = flags2_0xf(rxcmp1); + /* IP Checksum */ + if (likely(IS_IP_NONTUNNEL_PKT(flags))) { + 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(flags)) { + 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; + } + + /* L4 Checksum */ + if (likely(IS_L4_NONTUNNEL_PKT(flags))) { + if (unlikely(RX_CMP_L4_INNER_CS_ERR2(rxcmp1))) + mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD; + else + mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD; + } else if (IS_L4_TUNNEL_PKT(flags)) { + if (unlikely(RX_CMP_L4_INNER_CS_ERR2(rxcmp1))) + mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD; + else + mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD; + if (unlikely(RX_CMP_L4_OUTER_CS_ERR2(rxcmp1))) { + mbuf->ol_flags |= PKT_RX_OUTER_L4_CKSUM_BAD; + } else if (unlikely(IS_L4_TUNNEL_PKT_ONLY_INNER_L4_CS + (flags))) { + mbuf->ol_flags |= PKT_RX_OUTER_L4_CKSUM_UNKNOWN; + } else { + mbuf->ol_flags |= PKT_RX_OUTER_L4_CKSUM_GOOD; + } + } else if (unlikely(RX_CMP_L4_CS_UNKNOWN(rxcmp1))) { + mbuf->ol_flags |= PKT_RX_L4_CKSUM_UNKNOWN; + } +} + uint16_t bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) @@ -254,6 +300,7 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, mbuf->ol_flags |= PKT_RX_VLAN; } + bnxt_parse_csum(mbuf, rxcmp1); mbuf->packet_type = bnxt_parse_pkt_type(rxcmp, rxcmp1); rx_pkts[nb_rx_pkts++] = mbuf; -- 2.17.1