[dpdk-dev] [PATCH] net/ixgbe: add query rule stats support for FDIR

Wei Zhao wei.zhao1 at intel.com
Tue Jun 5 11:12:12 CEST 2018


There are many registeres in x550 support stats of
flow director filters, for example the number of added
or removed rules and the number match or miss match packet
count for this for port, all these important information
can be read form registeres in x550 and display with command
xstats.

Signed-off-by: Wei Zhao <wei.zhao1 at intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 87d2ad0..cb95865 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3122,6 +3122,13 @@ ixgbe_read_stats_registers(struct ixgbe_hw *hw,
 	/* Flow Director Stats registers */
 	hw_stats->fdirmatch += IXGBE_READ_REG(hw, IXGBE_FDIRMATCH);
 	hw_stats->fdirmiss += IXGBE_READ_REG(hw, IXGBE_FDIRMISS);
+	hw_stats->fdirustat_add += IXGBE_READ_REG(hw, IXGBE_FDIRUSTAT) & 0xFFFF;
+	hw_stats->fdirustat_remove += (IXGBE_READ_REG(hw, IXGBE_FDIRUSTAT) >>
+							16) & 0xFFFF;
+	hw_stats->fdirfstat_fadd += IXGBE_READ_REG(hw, IXGBE_FDIRFSTAT) &
+							0xFFFF;
+	hw_stats->fdirfstat_fremove += (IXGBE_READ_REG(hw, IXGBE_FDIRFSTAT) >>
+							16) & 0xFFFF;
 
 	/* MACsec Stats registers */
 	macsec_stats->out_pkts_untagged += IXGBE_READ_REG(hw, IXGBE_LSECTXUT);
-- 
2.7.5



More information about the dev mailing list