VOL-4656: Missing PIR field in TrafficShapingInfo for TCONT Type 1
results in TCONT creation failure at openolt agent.
Change-Id: Ic692f7e90fa57cf487cfd9d6324849e22ce49b9a
diff --git a/vendor/github.com/opencord/voltha-lib-go/v7/pkg/meters/meter_utils.go b/vendor/github.com/opencord/voltha-lib-go/v7/pkg/meters/meter_utils.go
index 56e8ecc..ed3db8b 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v7/pkg/meters/meter_utils.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v7/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