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 2FF2FA0613 for ; Tue, 30 Jul 2019 17:44:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF3A51C022; Tue, 30 Jul 2019 17:44:28 +0200 (CEST) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 8935C1BF6C for ; Tue, 30 Jul 2019 17:44:27 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id r7so30051688pfl.3 for ; Tue, 30 Jul 2019 08:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EZdXS6BZ/BgJD5z+VjywALf5F5Iwe6LutdDnoVc0ruo=; b=JPj0QNfsZi9P/+rHMA8yGWjI7ziM13muX6x2ZbIKbOjsOeUf1+PfitR6Z1M/nYdf6g 67Ud5dyB9sQCQZpOQieZ8cS3/yCVwaKaGeZGfxHBdH7nXqAe8YUr+KlYRlXdFIZWZDFS plah4UNdlpwTu2JztUIAdqsnslaNX6yncVEfg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EZdXS6BZ/BgJD5z+VjywALf5F5Iwe6LutdDnoVc0ruo=; b=T9ljXftDRd62ikfrD53n4mKIBS5eqlX0vn+Hz7CmaIcVVU3tsyoakQzOawzJYWYFQ/ phU7sFQoABSk09R/1kIMRzhNdosTBdZWL/Gys3yzS18+qulyMUVeOXaLPx9fXT9P1/ph GLWlljWd00E8PzMsAZvC5hybmnbzyj3hvJ8FYyYdUfziv5cbGfwRVIozhiRfSwHJjK07 o/ULOwhMeQMYZFfftBArX9DPqvRdu3KnM+s0ymBBSnrONF/p4ZoqP9MvB7Dr1OBgzzoe 0aDt9S/BWCPe6wx6ZrnEa2C/QJigK49HBKJY7h86KhHf2ZltxtjgecclF0iwe3sbGc0F mwkQ== X-Gm-Message-State: APjAAAXub89ZAUzJm6Yfkz9obmUhdMC76VTa/ljAxNxiUJkeMBw2RrJZ CBXF2D1Q7GM7vDc/Nqixzfm/+f2IT/ekZcZktIfNOw== X-Google-Smtp-Source: APXvYqyUVEBCW/ukLyVtQnjErWKW4gUfXV8/w/qEV96XsZ7qSX+Wazgtu1sFf2Uqxp/OpozqaWfySmjLrLAYo50KAUM= X-Received: by 2002:a62:1ac8:: with SMTP id a191mr42528048pfa.164.1564501466681; Tue, 30 Jul 2019 08:44:26 -0700 (PDT) MIME-Version: 1.0 References: <20190729212825.5077-1-lance.richardson@broadcom.com> In-Reply-To: <20190729212825.5077-1-lance.richardson@broadcom.com> From: Somnath Kotur Date: Tue, 30 Jul 2019 21:15:08 +0530 Message-ID: To: Lance Richardson Cc: dev , Ajit Kumar Khaparde , Kalesh AP Content-Type: text/plain; charset="UTF-8" Subject: Re: [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" On Tue, Jul 30, 2019 at 2:58 AM Lance Richardson wrote: > > 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 > Acked-by: Somnath Kotur