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 <jerin.ja...@caviumnetworks.com>

Reviewed-by: Andrew Rybchenko <arybche...@solarflare.com>

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.

Reply via email to