]> git.droids-corp.org - dpdk.git/commitdiff
fm10k/base: add mailbox counters
authorWang Xiao W <xiao.w.wang@intel.com>
Thu, 10 Sep 2015 04:38:26 +0000 (12:38 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 7 Oct 2015 11:25:07 +0000 (13:25 +0200)
A previous bug was uncovered by addition of a debug stat to indicate the
actual number of DWORDS we pulled from the mbmem. It turned out this was
not the same as the tx_dwords counter. While the previous bug fix should
have corrected this in all cases, add some debug stats that count the
number of DWORDs pushed or pulled from the mbmem. Base drivers can use
this in debug builds to help detect this problem in the future.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
drivers/net/fm10k/base/fm10k_mbx.c
drivers/net/fm10k/base/fm10k_mbx.h

index 40c12d3bc1a8a0bc5980b7ea95ce94054e8361bc..3c9ab3a535e27c9aa4aac6f0cbfc4611f76808ee 100644 (file)
@@ -394,6 +394,8 @@ STATIC void fm10k_mbx_write_copy(struct fm10k_hw *hw,
                        if (!tail)
                                tail++;
 
+                       mbx->tx_mbmem_pulled++;
+
                        /* write message to hardware FIFO */
                        FM10K_WRITE_MBX(hw, mbmem + tail++, *(head++));
                } while (--len && --end);
@@ -480,6 +482,8 @@ STATIC void fm10k_mbx_read_copy(struct fm10k_hw *hw,
                        if (!head)
                                head++;
 
+                       mbx->rx_mbmem_pushed++;
+
                        /* read message from hardware FIFO */
                        *(tail++) = FM10K_READ_MBX(hw, mbmem + head++);
                } while (--len && --end);
index 63325845d2ff16932c208c84912b234006407413..4b22f0efdbc0b5948f8d95b30e7b8583c8651c31 100644 (file)
@@ -313,8 +313,10 @@ struct fm10k_mbx_info {
        u64 tx_dropped;
        u64 tx_messages;
        u64 tx_dwords;
+       u64 tx_mbmem_pulled;
        u64 rx_messages;
        u64 rx_dwords;
+       u64 rx_mbmem_pushed;
        u64 rx_parse_err;
 
        /* Buffer to store messages */