VOL-4656: Missing PIR field in TrafficShapingInfo for TCONT Type 1
results in TCONT creation failure at openolt agent.
Change-Id: Icec1085cad06ed5f2353c089f487690f2047cf35
diff --git a/pkg/meters/meter_utils.go b/pkg/meters/meter_utils.go
index 56e8ecc..ed3db8b 100644
--- a/pkg/meters/meter_utils.go
+++ b/pkg/meters/meter_utils.go
@@ -29,14 +29,14 @@
switch meterBandSize := len(meterConfig.Bands); {
case meterBandSize == 1:
band := meterConfig.Bands[0]
- if band.BurstSize == 0 { // GIR, tcont type 1
- return &tp_pb.TrafficShapingInfo{Gir: band.Rate}, nil
+ if band.BurstSize == 0 { // GIR = PIR, Burst Size = 0, tcont type 1
+ return &tp_pb.TrafficShapingInfo{Pir: band.Rate, Gir: band.Rate}, nil
}
return &tp_pb.TrafficShapingInfo{Pir: band.Rate, Pbs: band.BurstSize}, nil // PIR, tcont type 4
case meterBandSize == 2:
firstBand, secondBand := meterConfig.Bands[0], meterConfig.Bands[1]
if firstBand.BurstSize == 0 && secondBand.BurstSize == 0 &&
- firstBand.Rate == secondBand.Rate { // PIR == GIR, tcont type 1
+ firstBand.Rate == secondBand.Rate { // PIR = GIR, tcont type 1
return &tp_pb.TrafficShapingInfo{Pir: firstBand.Rate, Gir: secondBand.Rate}, nil
}
if firstBand.BurstSize > 0 && secondBand.BurstSize > 0 { // PIR, CIR, tcont type 2 or 3