VOL-2523: Enhance scale tester app with LLDP flow for DT workflow and test provisioning 512 subscribers

          512 subscriber provisioning tested with DT workflow enabled, results as below
          1) one tm queue map created as for all subs DT use 1T8G techprofile
          2) 1 ACL for LLDP flow created
          3) 4096 HSIA flows added (upstream & Downstream share same flow ID)
          4) 4096 Gemports created (GemID starts from 1024 to 5119)
          5) 512 ALLOC objects created
          6) (8*512 subs) + (4*16 PON) + 4 NNI = 4164 TM Queues created
          7) (1*512 subs) + (1*16 PON) + 1 NNI = 529 TM Scheds created

Change-Id: I7efa0c30f364866cf51e6930c0d3ab7a40fde0a8
diff --git a/core/workflow_utils.go b/core/workflow_utils.go
index e078e6d..656b8ec 100644
--- a/core/workflow_utils.go
+++ b/core/workflow_utils.go
@@ -19,7 +19,9 @@
 import (
 	"errors"
 
+	"github.com/opencord/openolt-scale-tester/config"
 	"github.com/opencord/voltha-lib-go/v2/pkg/log"
+	"github.com/opencord/voltha-lib-go/v2/pkg/ponresourcemanager"
 	oop "github.com/opencord/voltha-protos/v2/go/openolt"
 	tp_pb "github.com/opencord/voltha-protos/v2/go/tech_profile"
 	"golang.org/x/net/context"
@@ -193,3 +195,40 @@
 
 	return nil
 }
+
+func AddLldpFlow(oo oop.OpenoltClient, config *config.OpenOltScaleTesterConfig, rsrMgr *OpenOltResourceMgr) error {
+	var flowID []uint32
+	var err error
+
+	if flowID, err = rsrMgr.ResourceMgrs[uint32(config.NniIntfID)].GetResourceID(uint32(config.NniIntfID),
+		ponresourcemanager.FLOW_ID, 1); err != nil {
+		return err
+	}
+
+	flowClassifier := &oop.Classifier{EthType: 35020, PktTagType: "untagged"}
+	actionCmd := &oop.ActionCmd{TrapToHost: true}
+	actionInfo := &oop.Action{Cmd: actionCmd}
+
+	flow := oop.Flow{AccessIntfId: -1, OnuId: -1, UniId: -1, FlowId: flowID[0],
+		FlowType: "downstream", AllocId: -1, GemportId: -1,
+		Classifier: flowClassifier, Action: actionInfo,
+		Priority: 1000, PortNo: uint32(config.NniIntfID)}
+
+	_, err = oo.FlowAdd(context.Background(), &flow)
+
+	st, _ := status.FromError(err)
+	if st.Code() == codes.AlreadyExists {
+		log.Debugw("Flow already exists", log.Fields{"err": err, "deviceFlow": flow})
+		return nil
+	}
+
+	if err != nil {
+		log.Errorw("Failed to Add LLDP flow to device", log.Fields{"err": err, "deviceFlow": flow})
+		rsrMgr.ResourceMgrs[uint32(config.NniIntfID)].FreeResourceID(uint32(config.NniIntfID),
+			ponresourcemanager.FLOW_ID, flowID)
+		return err
+	}
+	log.Debugw("LLDP flow added to device successfully ", log.Fields{"flow": flow})
+
+	return nil
+}