From 9c907d1f0fd212bce97c2caa16f2b86ae0fc9d85 Mon Sep 17 00:00:00 2001 From: Saikrishna Edupuganti Date: Wed, 24 Mar 2021 15:13:37 +0000 Subject: [PATCH] Fix telemetry - Use json bool parsing properly - Change default prom port in upf.json to 8080 to match prometheus.yml - Remove check for simInfo when querying portStats Signed-off-by: Saikrishna Edupuganti --- conf/parser.py | 8 ++++---- conf/upf.json | 6 +++--- pfcpiface/bess.go | 5 ----- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/conf/parser.py b/conf/parser.py index b4e3d8776..1bb792dc8 100644 --- a/conf/parser.py +++ b/conf/parser.py @@ -68,13 +68,13 @@ def parse(self, ifaces): # Enable hardware checksum try: - self.hwcksum = bool(self.conf["hwcksum"] == 'True' or self.conf["hwcksum"] == 'true') + self.hwcksum = bool(self.conf["hwcksum"]) except KeyError: print('hwcksum not set, using default software fallback') # Enable DDP try: - self.ddp = bool(self.conf["ddp"] == 'True' or self.conf["ddp"] == 'true') + self.ddp = bool(self.conf["ddp"]) except KeyError: print('ddp not set, using default software fallback') @@ -82,7 +82,7 @@ def parse(self, ifaces): # See this link for details: # https://github.com/NetSys/bess/blob/master/bessctl/module_tests/timestamp.py try: - self.measure = bool(self.conf["measure"] == 'True' or self.conf["measure"] == 'true') + self.measure = self.conf["measure"] except KeyError: print('measure value not set. Not installing Measure module.') @@ -142,6 +142,6 @@ def parse(self, ifaces): # Network Token Function try: - self.enable_ntf = bool(self.conf['enable_ntf'] == 'True' or self.conf['enable_ntf'] == 'true') + self.enable_ntf = bool(self.conf['enable_ntf']) except KeyError: print('Network Token Function disabled') diff --git a/conf/upf.json b/conf/upf.json index 28fe0a81f..40ac32080 100644 --- a/conf/upf.json +++ b/conf/upf.json @@ -29,10 +29,10 @@ "": "ip_frag_with_eth_mtu: 1518", "": "Enable hardware offload of checksum. Might disable vector PMD", - "": "hwcksum: True", + "hwcksum": false, "": "Enable Intel Dynamic Device Personalization (DDP)", - "": "ddp: True", + "ddp": true, "": "Telemetrics-See this link for details: https://github.com/NetSys/bess/blob/master/bessctl/module_tests/timestamp.py", "measure": true, @@ -64,7 +64,7 @@ "nb_dst_ip": "172.17.0.1", "" : "nb_dst_ip: CPHostname", "hostname": "spgwc", - "prom_port": "8089" + "prom_port": "8080" }, "": "p4rtc interface settings", diff --git a/pfcpiface/bess.go b/pfcpiface/bess.go index 1e1144f1c..b5a344ea2 100644 --- a/pfcpiface/bess.go +++ b/pfcpiface/bess.go @@ -153,11 +153,6 @@ func (b *bess) getPortStats(ifname string) *pb.GetPortStatsResponse { } func (b *bess) portStats(uc *upfCollector, ch chan<- prometheus.Metric) { - // When operating in sim mode there are no BESS ports - if uc.upf.simInfo != nil { - return - } - portstats := func(ifaceLabel, ifaceName string) { packets := func(packets uint64, direction string) { p := prometheus.MustNewConstMetric(