[VOL-4887] openonuAdapterGo - inconsistent assignment of DS Priority Queue Pointers in Gem Port Network CTPs

Change-Id: Ifc90ecf0c6e141019a0f91dbe2c3a2baa9418389
diff --git a/VERSION b/VERSION
index a4cc557..4ea8ad8 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.14.2
+1.14.3
diff --git a/internal/common/omci/onu_mib_db.go b/internal/common/omci/onu_mib_db.go
index 1ba1b6e..8678245 100644
--- a/internal/common/omci/onu_mib_db.go
+++ b/internal/common/omci/onu_mib_db.go
@@ -96,9 +96,9 @@
 	tcontSlotId       byte = 0x80 // why is this not the same as the cardHolderSlotID, it does not point to anything
 	aniGId            byte = 0x01
 
-	upstreamPriorityQueues   = 16 // Number of queues for each T-CONT
-	downstreamPriorityQueues = 16 // Number of queues for each PPTP
-	tconts                   = 8  // NOTE will we ever need to configure this?
+	upstreamPriorityQueues   = 8 // Number of queues for each T-CONT
+	downstreamPriorityQueues = 8 // Number of queues for each PPTP
+	tconts                   = 8 // NOTE will we ever need to configure this?
 	// trafficSchedulers        = 8  // NOTE will we ever need to configure this?
 )
 
@@ -377,10 +377,10 @@
 		})
 
 		// Downstream Queues (related to PPTP)
-		// 16 priorities queues for each UNI Ports
-		// EntityID = cardHolderSlotID + Uni EntityID (0101)
-		for j := 1; j <= downstreamPriorityQueues; j++ {
-			queueEntityId := EntityID{cardHolderSlotID, byte(j)}
+		// downstreamPriorityQueues for each UNI Port
+		// EntityID = MSB: cardHolderSlotID, LSB: uniPortNo<<4 + prio
+		for j := 0; j < downstreamPriorityQueues; j++ {
+			queueEntityId := EntityID{cardHolderSlotID, byte(i<<4 + j)}
 
 			// we first report the PriorityQueue without any attribute
 			mibDb.baselineItems = append(mibDb.baselineItems, MibDbEntry{
@@ -441,11 +441,11 @@
 			nil,
 		})
 
-		for j := 1; j <= upstreamPriorityQueues; j++ {
-			queueEntityId := EntityID{tcontSlotId, byte(j)}
+		for j := 0; j < upstreamPriorityQueues; j++ {
+			queueEntityId := EntityID{tcontSlotId, byte(i<<4 + j)}
 			// Upstream Queues (related to traffic schedulers)
-			// 8 priorities queues per TCONT
-			// EntityID = tcontSlotId + Uni EntityID (8001)
+			// upstreamPriorityQueues per TCONT
+			// EntityID = MSB: tcontSlotId, LSB: tcontNo<<4 + prio
 
 			// we first report the PriorityQueue without any attribute
 			mibDb.baselineItems = append(mibDb.baselineItems, MibDbEntry{
diff --git a/internal/common/omci/onu_mib_db_test.go b/internal/common/omci/onu_mib_db_test.go
index d66a157..be733ce 100644
--- a/internal/common/omci/onu_mib_db_test.go
+++ b/internal/common/omci/onu_mib_db_test.go
@@ -152,7 +152,7 @@
 	}
 
 	const uniPortCount = 4
-	const baseMibEntries = 419                    // see Test_GenerateMibDatabase for breakdown
+	const baseMibEntries = 227                    // see Test_GenerateMibDatabase for breakdown
 	const expectedMibEntries = baseMibEntries + 1 // expecting one hardcoded packet
 	mibDb, err := GenerateMibDatabase(uniPortCount, 0, common.XGSPON)