[VOL-3069]Pass Context down the execution call hierarchy across voltha codebase

Change-Id: I97a2630d9a4fe5dc3161113539edda476534f186
diff --git a/rw_core/coreif/adapter_manager_if.go b/rw_core/coreif/adapter_manager_if.go
index 7f661cf..6baa446 100644
--- a/rw_core/coreif/adapter_manager_if.go
+++ b/rw_core/coreif/adapter_manager_if.go
@@ -25,7 +25,7 @@
 // AdapterManager represent adapter manager related methods
 type AdapterManager interface {
 	ListAdapters(ctx context.Context) (*voltha.Adapters, error)
-	GetAdapterName(deviceType string) (string, error)
-	GetDeviceType(deviceType string) *voltha.DeviceType
-	RegisterAdapter(adapter *voltha.Adapter, deviceTypes *voltha.DeviceTypes) *voltha.CoreInstance
+	GetAdapterName(ctx context.Context, deviceType string) (string, error)
+	GetDeviceType(ctx context.Context, deviceType string) *voltha.DeviceType
+	RegisterAdapter(ctx context.Context, adapter *voltha.Adapter, deviceTypes *voltha.DeviceTypes) *voltha.CoreInstance
 }
diff --git a/rw_core/coreif/core_if.go b/rw_core/coreif/core_if.go
index 6454135..ba0ebab 100644
--- a/rw_core/coreif/core_if.go
+++ b/rw_core/coreif/core_if.go
@@ -32,12 +32,12 @@
 type Core interface {
 	Start(ctx context.Context)
 	Stop(ctx context.Context)
-	GetKafkaInterContainerProxy() *kafka.InterContainerProxy
-	GetConfig() *config.RWCoreFlags
-	GetInstanceId() string
-	GetClusterDataProxy() *model.Proxy
-	GetAdapterManager() AdapterManager
+	GetKafkaInterContainerProxy(ctx context.Context) *kafka.InterContainerProxy
+	GetConfig(ctx context.Context) *config.RWCoreFlags
+	GetInstanceId(ctx context.Context) string
+	GetClusterDataProxy(ctx context.Context) *model.Proxy
+	GetAdapterManager(ctx context.Context) AdapterManager
 	StartGRPCService(ctx context.Context)
-	GetDeviceManager() DeviceManager
-	GetLogicalDeviceManager() LogicalDeviceManager
+	GetDeviceManager(ctx context.Context) DeviceManager
+	GetLogicalDeviceManager(ctx context.Context) LogicalDeviceManager
 }
diff --git a/rw_core/coreif/device_manager_if.go b/rw_core/coreif/device_manager_if.go
index 4d23e5c..2e02b9b 100644
--- a/rw_core/coreif/device_manager_if.go
+++ b/rw_core/coreif/device_manager_if.go
@@ -28,7 +28,7 @@
 // DeviceManager represents a generic device manager
 type DeviceManager interface {
 	GetDevice(context.Context, *voltha.ID) (*voltha.Device, error)
-	IsRootDevice(string) (bool, error)
+	IsRootDevice(context.Context, string) (bool, error)
 	NotifyInvalidTransition(ctx context.Context, curr *voltha.Device) error
 	CreateLogicalDevice(ctx context.Context, curr *voltha.Device) error
 	SetupUNILogicalPorts(ctx context.Context, curr *voltha.Device) error
diff --git a/rw_core/coreif/logical_device_agent_if.go b/rw_core/coreif/logical_device_agent_if.go
index ac4201a..8932148 100644
--- a/rw_core/coreif/logical_device_agent_if.go
+++ b/rw_core/coreif/logical_device_agent_if.go
@@ -28,9 +28,9 @@
 
 // LogicalDeviceAgent represents a generic agent
 type LogicalDeviceAgent interface {
-	GetDeviceRoutes() *route.DeviceRoutes
+	GetDeviceRoutes(ctx context.Context) *route.DeviceRoutes
 	GetLogicalDevice(ctx context.Context) (*voltha.LogicalDevice, error)
-	GetWildcardInputPorts(excludePort ...uint32) []uint32
+	GetWildcardInputPorts(ctx context.Context, excludePort ...uint32) []uint32
 	GetRoute(ctx context.Context, ingressPortNo uint32, egressPortNo uint32) ([]route.Hop, error)
-	GetNNIPorts() []uint32
+	GetNNIPorts(ctx context.Context) []uint32
 }
diff --git a/rw_core/coreif/logical_device_manager_if.go b/rw_core/coreif/logical_device_manager_if.go
index 02068eb..33bb1d1 100644
--- a/rw_core/coreif/logical_device_manager_if.go
+++ b/rw_core/coreif/logical_device_manager_if.go
@@ -29,18 +29,18 @@
 
 // LogicalDeviceManager represent logical device manager related methods
 type LogicalDeviceManager interface {
-	GetLogicalPort(lPortID *voltha.LogicalPortId) (*voltha.LogicalPort, error)
+	GetLogicalPort(ctx context.Context, lPortID *voltha.LogicalPortId) (*voltha.LogicalPort, error)
 	EnableLogicalPort(ctx context.Context, id *voltha.LogicalPortId, ch chan interface{})
 	DisableLogicalPort(ctx context.Context, id *voltha.LogicalPortId, ch chan interface{})
 	UpdateFlowTable(ctx context.Context, id string, flow *openflow_13.OfpFlowMod, ch chan interface{})
 	UpdateMeterTable(ctx context.Context, id string, meter *openflow_13.OfpMeterMod, ch chan interface{})
 	UpdateGroupTable(ctx context.Context, id string, groupMod *openflow_13.OfpGroupMod, ch chan interface{})
-	GetLogicalDevice(id string) (*voltha.LogicalDevice, error)
-	ListManagedLogicalDevices() (*voltha.LogicalDevices, error)
-	ListLogicalDevices() (*voltha.LogicalDevices, error)
+	GetLogicalDevice(ctx context.Context, id string) (*voltha.LogicalDevice, error)
+	ListManagedLogicalDevices(ctx context.Context) (*voltha.LogicalDevices, error)
+	ListLogicalDevices(ctx context.Context) (*voltha.LogicalDevices, error)
 	ListLogicalDeviceFlows(ctx context.Context, id string) (*openflow_13.Flows, error)
 	ListLogicalDeviceFlowGroups(ctx context.Context, id string) (*openflow_13.FlowGroups, error)
 	ListLogicalDevicePorts(ctx context.Context, id string) (*voltha.LogicalPorts, error)
 	ListLogicalDeviceMeters(ctx context.Context, id string) (*openflow_13.Meters, error)
-	PacketOut(packet *openflow_13.PacketOut) error
+	PacketOut(ctx context.Context, packet *openflow_13.PacketOut) error
 }