From e3f53d5eaf2af2271860be67781c59e3fb5332e1 Mon Sep 17 00:00:00 2001 From: Saikrishna Edupuganti Date: Thu, 22 Apr 2021 02:27:09 +0000 Subject: [PATCH] Fix: ice/iavf port stats now work in BESS ``` # HELP upf_bytes_count Shows the number of bytes received by the UPF port # TYPE upf_bytes_count counter upf_bytes_count{dir="rx",iface="Access"} 2.721340866076e+12 upf_bytes_count{dir="rx",iface="Core"} 2.711668992744e+12 upf_bytes_count{dir="tx",iface="Access"} 1.937074248052e+12 upf_bytes_count{dir="tx",iface="Core"} 5.31949604808e+11 # HELP upf_dropped_count Shows the number of packets dropped on receive by the UPF port # TYPE upf_dropped_count counter upf_dropped_count{dir="rx",iface="Access"} 2.084059945e+09 upf_dropped_count{dir="rx",iface="Core"} 7.81396192e+08 upf_dropped_count{dir="tx",iface="Access"} 0 upf_dropped_count{dir="tx",iface="Core"} 0 # HELP upf_packets_count Shows the number of packets received by the UPF port # TYPE upf_packets_count counter upf_packets_count{dir="rx",iface="Access"} 5.24598359e+08 upf_packets_count{dir="rx",iface="Core"} 1.843303614e+09 upf_packets_count{dir="tx",iface="Access"} 1.843260648e+09 upf_packets_count{dir="tx",iface="Core"} 5.24610368e+08 ``` Signed-off-by: Saikrishna Edupuganti --- ...o-list-of-drivers-need-SW-port-stats.patch | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 patches/bess/0014-Add-ice-iavf-to-list-of-drivers-need-SW-port-stats.patch diff --git a/patches/bess/0014-Add-ice-iavf-to-list-of-drivers-need-SW-port-stats.patch b/patches/bess/0014-Add-ice-iavf-to-list-of-drivers-need-SW-port-stats.patch new file mode 100644 index 000000000..6f55d2721 --- /dev/null +++ b/patches/bess/0014-Add-ice-iavf-to-list-of-drivers-need-SW-port-stats.patch @@ -0,0 +1,44 @@ +From d8cb6e1c0fbbc4bb4728c7e379f65b0b8b47cb96 Mon Sep 17 00:00:00 2001 +From: Saikrishna Edupuganti +Date: Thu, 22 Apr 2021 02:15:36 +0000 +Subject: [PATCH] Add ice/iavf to list of drivers need SW port stats + +Now BESS is able to report bytes and packet counts + +``` + 02:10:38.741198 INC Mbps Mpps dropped OUT Mbps Mpps Dropped + ------------------------------------------------------------------------------------------------ + accessFastPMDPort 49237.4 1.201 4671498 35814.6 4.165 0 + accessSlowPMDPort 0.0 0.000 0 0.0 0.000 0 + coreFastPMDPort 49633.4 4.164 1744421 9968.8 1.200 0 + coreSlowPMDPort 0.0 0.000 0 0.0 0.000 0 + ------------------------------------------------------------------------------------------------ + Total 98868.1 5.365 6415826 45782.9 5.366 0 +``` + +Signed-off-by: Saikrishna Edupuganti +--- + core/drivers/pmd.cc | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/core/drivers/pmd.cc b/core/drivers/pmd.cc +index 003bf7ff..db7b170e 100644 +--- a/core/drivers/pmd.cc ++++ b/core/drivers/pmd.cc +@@ -599,9 +599,10 @@ void PMDPort::CollectStats(bool reset) { + + port_stats_.inc.dropped = stats.imissed; + +- // i40e/net_e1000_igb PMD drivers, ixgbevf and net_bonding vdevs don't support +- // per-queue stats +- if (driver_ == "net_i40e" || driver_ == "net_i40e_vf" || ++ // ice/i40e/net_e1000_igb PMD drivers, ixgbevf and net_bonding vdevs don't ++ // support per-queue stats ++ if (driver_ == "net_ice" || driver_ == "net_iavf" || ++ driver_ == "net_i40e" || driver_ == "net_i40e_vf" || + driver_ == "net_ixgbe_vf" || driver_ == "net_bonding" || + driver_ == "net_e1000_igb") { + // NOTE: +-- +2.25.1 +