From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2247DA09E4; Fri, 29 Jan 2021 23:36:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 99B3D4067B; Fri, 29 Jan 2021 23:36:04 +0100 (CET) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 9DA9B40395 for ; Fri, 29 Jan 2021 23:36:03 +0100 (CET) Received: by mail-pl1-f180.google.com with SMTP id b8so6115204plh.12 for ; Fri, 29 Jan 2021 14:36:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=OWmKbIEnZUCzqQpKHWUIJJM3EPPfvQDYVhacbyqgYPQ=; b=YxZfrieYxHkuu1AYV54auEj4bVmSLpBSESbLQDWjcZi3Dn63+okzdcS9BRbTKWqhYI CZoSnWiI2f9LQNSnRUw8S6vYgxVSCOHemZOBLIcIboYDbw79BRXLFYsQCODRilfDQXSN uQjDEaK1z9GQd/irtbMW821p2MuTX5wwPBDRI= 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:mime-version; bh=OWmKbIEnZUCzqQpKHWUIJJM3EPPfvQDYVhacbyqgYPQ=; b=WjMnrNgFGREysOn7jsLDit8UGoPHSHr2fyTCSRLpyN23Om5ICARWYh5DEbL/jai40W 69R1i7Mtf+4TgZNXbm0e9tEjOfoj4rWTLkpVRKbbPUWZY0urLYEUkNpVr2v3493wIbIg FBiecjv/m27VDOMblKxxh+3GyJhTx7SOcmf1dENPcHMbwDQ2FuN/bHW5FcIxopO7FbPT vHqd7kabSzOX0tZxp317eN57fD8yuvyoWgqxh94byBWXObjGTnm2TRJB+y/RRFUfgj3Q 5OLBsZDTz0nur68Opr5JCIrdQ+bupfGZpPsKq1nOuI+h17Ii8rd1t+LNptvjKROEoKdg w4ZQ== X-Gm-Message-State: AOAM533kMCcuGASt8YAxpl06bw6DJFUIxqFMblf+oGkRYevXmBfhR2i1 xwW710ufWRw4v5JRoz/M1txOjA== X-Google-Smtp-Source: ABdhPJxUeNVt3oBfoSOnNlUQtPjsweX2/3fJvY2uXS9gD7neJF/1krA7Lcr4wWIpf2xRx74vVFS3Jw== X-Received: by 2002:a17:90a:ce97:: with SMTP id g23mr6534197pju.224.1611959762780; Fri, 29 Jan 2021 14:36:02 -0800 (PST) Received: from localhost.localdomain ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id a21sm10446177pgd.57.2021.01.29.14.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 14:36:01 -0800 (PST) From: Lance Richardson To: Wenzhuo Lu , Xiaoyun Li , Bernard Iremonger Cc: dev@dpdk.org, Ajit Kumar Khaparde , Kalesh Anakkur Purayil Date: Fri, 29 Jan 2021 17:35:54 -0500 Message-Id: <20210129223554.103012-1-lance.richardson@broadcom.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000001272db05ba11a18d" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] [PATCH 21.05] app/testpmd: count outer IP checksum errors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" --0000000000001272db05ba11a18d Content-Transfer-Encoding: 8bit Count and display outer IP checksum errors in the checksum forwarder. Example forwarder stats output: RX-packets: 158 RX-dropped: 0 RX-total: 158 Bad-ipcsum: 48 Bad-l4csum: 48 Bad-outer-l4csum: 6 Bad-outer-ipcsum: 40 TX-packets: 0 TX-dropped: 0 TX-total: 0 Signed-off-by: Lance Richardson Reviewed-by: Ajit Kumar Khaparde Reviewed-by: Kalesh Anakkur Purayil --- app/test-pmd/csumonly.c | 5 +++++ app/test-pmd/testpmd.c | 11 ++++++++++- app/test-pmd/testpmd.h | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index d813d4fae0..37ed415cee 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -814,6 +814,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) uint32_t rx_bad_ip_csum; uint32_t rx_bad_l4_csum; uint32_t rx_bad_outer_l4_csum; + uint32_t rx_bad_outer_ip_csum; struct testpmd_offload_info info; uint16_t nb_segments = 0; int ret; @@ -833,6 +834,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) rx_bad_ip_csum = 0; rx_bad_l4_csum = 0; rx_bad_outer_l4_csum = 0; + rx_bad_outer_ip_csum = 0; gro_enable = gro_ports[fs->rx_port].enable; txp = &ports[fs->tx_port]; @@ -862,6 +864,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) rx_bad_l4_csum += 1; if (rx_ol_flags & PKT_RX_OUTER_L4_CKSUM_BAD) rx_bad_outer_l4_csum += 1; + if (rx_ol_flags & PKT_RX_EIP_CKSUM_BAD) + rx_bad_outer_ip_csum += 1; /* step 1: dissect packet, parsing optional vlan, ip4/ip6, vxlan * and inner headers */ @@ -1124,6 +1128,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) fs->rx_bad_ip_csum += rx_bad_ip_csum; fs->rx_bad_l4_csum += rx_bad_l4_csum; fs->rx_bad_outer_l4_csum += rx_bad_outer_l4_csum; + fs->rx_bad_outer_ip_csum += rx_bad_outer_ip_csum; inc_tx_burst_stats(fs, nb_tx); if (unlikely(nb_tx < nb_rx)) { diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index c256e719ae..67f60745a0 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1805,6 +1805,8 @@ fwd_stream_stats_display(streamid_t stream_id) " Rx- bad outer L4 checksum: %-14"PRIu64"\n", fs->rx_bad_ip_csum, fs->rx_bad_l4_csum, fs->rx_bad_outer_l4_csum); + printf(" RX- bad outer IP checksum: %-14"PRIu64"\n", + fs->rx_bad_outer_ip_csum); } else { printf("\n"); } @@ -1827,6 +1829,7 @@ fwd_stats_display(void) uint64_t rx_bad_ip_csum; uint64_t rx_bad_l4_csum; uint64_t rx_bad_outer_l4_csum; + uint64_t rx_bad_outer_ip_csum; } ports_stats[RTE_MAX_ETHPORTS]; uint64_t total_rx_dropped = 0; uint64_t total_tx_dropped = 0; @@ -1859,6 +1862,8 @@ fwd_stats_display(void) ports_stats[fs->rx_port].rx_bad_l4_csum += fs->rx_bad_l4_csum; ports_stats[fs->rx_port].rx_bad_outer_l4_csum += fs->rx_bad_outer_l4_csum; + ports_stats[fs->rx_port].rx_bad_outer_ip_csum += + fs->rx_bad_outer_ip_csum; if (record_core_cycles) fwd_cycles += fs->core_cycles; @@ -1890,13 +1895,16 @@ fwd_stats_display(void) "RX-total: %-"PRIu64"\n", stats.ipackets, stats.imissed, stats.ipackets + stats.imissed); - if (cur_fwd_eng == &csum_fwd_engine) + if (cur_fwd_eng == &csum_fwd_engine) { printf(" Bad-ipcsum: %-14"PRIu64 " Bad-l4csum: %-14"PRIu64 "Bad-outer-l4csum: %-14"PRIu64"\n", ports_stats[pt_id].rx_bad_ip_csum, ports_stats[pt_id].rx_bad_l4_csum, ports_stats[pt_id].rx_bad_outer_l4_csum); + printf(" Bad-outer-ipcsum: %-14"PRIu64"\n", + ports_stats[pt_id].rx_bad_outer_ip_csum); + } if (stats.ierrors + stats.rx_nombuf > 0) { printf(" RX-error: %-"PRIu64"\n", stats.ierrors); printf(" RX-nombufs: %-14"PRIu64"\n", stats.rx_nombuf); @@ -1974,6 +1982,7 @@ fwd_stats_reset(void) fs->rx_bad_ip_csum = 0; fs->rx_bad_l4_csum = 0; fs->rx_bad_outer_l4_csum = 0; + fs->rx_bad_outer_ip_csum = 0; memset(&fs->rx_burst_stats, 0, sizeof(fs->rx_burst_stats)); memset(&fs->tx_burst_stats, 0, sizeof(fs->tx_burst_stats)); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 5f23162107..a034dae227 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -137,6 +137,8 @@ struct fwd_stream { uint64_t rx_bad_l4_csum ; /**< received packets has bad l4 checksum */ uint64_t rx_bad_outer_l4_csum; /**< received packets has bad outer l4 checksum */ + uint64_t rx_bad_outer_ip_csum; + /**< received packets having bad outer ip checksum */ unsigned int gro_times; /**< GRO operation times */ uint64_t core_cycles; /**< used for RX and TX processing */ struct pkt_burst_stats rx_burst_stats; -- 2.25.1 --0000000000001272db05ba11a18d--