From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Rybchenko Subject: Re: [PATCH v2 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Date: Wed, 3 Oct 2018 11:29:29 +0300 Message-ID: References: <20180913134707.23698-1-jerin.jacob@caviumnetworks.com> <20181002192451.19119-1-jerin.jacob@caviumnetworks.com> <20181002192451.19119-4-jerin.jacob@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: , To: Jerin Jacob , Wenzhuo Lu , Jingjing Wu , "Bernard Iremonger" Return-path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 3ACA74C8B for ; Wed, 3 Oct 2018 10:30:20 +0200 (CEST) In-Reply-To: <20181002192451.19119-4-jerin.jacob@caviumnetworks.com> Content-Language: en-GB 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 10/2/18 10:24 PM, Jerin Jacob wrote: > Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD > errors. > > Signed-off-by: Jerin Jacob Reviewed-by: Andrew Rybchenko except two nits below <...> > @@ -753,6 +755,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) > rx_bad_ip_csum += 1; > if ((rx_ol_flags & PKT_RX_L4_CKSUM_MASK) == PKT_RX_L4_CKSUM_BAD) > rx_bad_l4_csum += 1; > + if (rx_ol_flags & PKT_RX_EL4_CKSUM_BAD) > + rx_bad_outer_l4_csum += 1; > + Unnecessary extra empty line. <...> > @@ -1482,6 +1488,12 @@ stop_packet_forwarding(void) > fwd_streams[sm_id]->rx_bad_l4_csum); > ports[fwd_streams[sm_id]->rx_port].rx_bad_l4_csum = > rx_bad_l4_csum; > + rx_bad_outer_l4_csum = > + ports[fwd_streams[sm_id]->rx_port].rx_bad_outer_l4_csum; > + rx_bad_outer_l4_csum = (uint64_t) (rx_bad_outer_l4_csum + > + fwd_streams[sm_id]->rx_bad_outer_l4_csum); > + ports[fwd_streams[sm_id]->rx_port].rx_bad_outer_l4_csum = > + rx_bad_outer_l4_csum; I guess it is copied from about and modified, but I think that so long magic is not required and the following simple version should do the job: ports[fwd_streams[sm_id]->rx_port].rx_bad_outer_l4_csum += fwd_streams[sm_id]->rx_bad_outer_l4_csum; rx_bad_outer_l4_csum is uint64_t and usual arithmetic conversions should guarantee the correct result.