diff --git a/internal/forwarder/gtp5g.go b/internal/forwarder/gtp5g.go index 13038b9..dec592e 100644 --- a/internal/forwarder/gtp5g.go +++ b/internal/forwarder/gtp5g.go @@ -1433,7 +1433,20 @@ func (g *Gtp5g) QueryURR(lSeid uint64, urrid uint32) ([]report.USAReport, error) } func (g *Gtp5g) psQueryURR(lSeidUrridsMap map[uint64][]uint32) (map[uint64][]report.USAReport, error) { - return g.queryMultiURR(lSeidUrridsMap, true) + seidUsars := make(map[uint64][]report.USAReport) + + for lSeid, urrids := range lSeidUrridsMap { + for _, urrid := range urrids { + usars, err := g.queryURR(lSeid, urrid, true) + if err != nil { + return nil, err + } + if len(usars) > 0 { + seidUsars[lSeid] = append(seidUsars[lSeid], usars...) + } + } + } + return seidUsars, nil } func (g *Gtp5g) queryURR(lSeid uint64, urrid uint32, ps bool) ([]report.USAReport, error) { @@ -1478,6 +1491,13 @@ func (g *Gtp5g) queryURR(lSeid uint64, urrid uint32, ps bool) ([]report.USARepor return usars, err } +// Note: the max size of netlink msg is 16k, +// the number of reports from gtp5g is limited +// depending on the size of report +func (g *Gtp5g) QueryMultiURR(lSeidUrridsMap map[uint64][]uint32) (map[uint64][]report.USAReport, error) { + return g.queryMultiURR(lSeidUrridsMap, false) +} + func (g *Gtp5g) queryMultiURR(lSeidUrridsMap map[uint64][]uint32, ps bool) (map[uint64][]report.USAReport, error) { var oids []gtp5gnl.OID for seid, urrIds := range lSeidUrridsMap {