@@ -56,6 +56,7 @@ type OvsSFlowProbesHandler struct {
5656 probes map [string ]OvsSFlowProbe
5757 probesLock common.RWMutex
5858 Graph * graph.Graph
59+ Node * graph.Node
5960 fpta * FlowProbeTableAllocator
6061 ovsClient * ovsdb.OvsClient
6162 allocator * sflow.AgentAllocator
@@ -178,7 +179,7 @@ func (o *OvsSFlowProbesHandler) UnregisterSFlowProbeFromBridge(bridgeUUID string
178179}
179180
180181// RegisterProbeOnBridge registers a new probe on the OVS bridge
181- func (o * OvsSFlowProbesHandler ) RegisterProbeOnBridge (bridgeUUID string , tid string , capture * types.Capture ) error {
182+ func (o * OvsSFlowProbesHandler ) RegisterProbeOnBridge (bridgeUUID string , tid string , capture * types.Capture , n * graph. Node ) error {
182183 headerSize := flow .DefaultCaptureLength
183184 if capture .HeaderSize != 0 {
184185 headerSize = uint32 (capture .HeaderSize )
@@ -192,7 +193,7 @@ func (o *OvsSFlowProbesHandler) RegisterProbeOnBridge(bridgeUUID string, tid str
192193 Interface : "lo" ,
193194 HeaderSize : headerSize ,
194195 Sampling : 1 ,
195- Polling : 0 ,
196+ Polling : 10 ,
196197 flowTable : ft ,
197198 }
198199
@@ -202,7 +203,7 @@ func (o *OvsSFlowProbesHandler) RegisterProbeOnBridge(bridgeUUID string, tid str
202203 }
203204
204205 addr := common.ServiceAddress {Addr : address , Port : 0 }
205- agent , err := o .allocator .Alloc (bridgeUUID , probe .flowTable , capture .BPFFilter , headerSize , & addr )
206+ agent , err := o .allocator .Alloc (bridgeUUID , probe .flowTable , capture .BPFFilter , headerSize , & addr , n , o . Graph )
206207 if err != nil && err != sflow .ErrAgentAlreadyAllocated {
207208 return err
208209 }
@@ -231,7 +232,7 @@ func (o *OvsSFlowProbesHandler) registerProbe(n *graph.Node, capture *types.Capt
231232
232233 if isOvsBridge (n ) {
233234 if uuid , _ := n .GetFieldString ("UUID" ); uuid != "" {
234- if err := o .RegisterProbeOnBridge (uuid , tid , capture ); err != nil {
235+ if err := o .RegisterProbeOnBridge (uuid , tid , capture , n ); err != nil {
235236 return err
236237 }
237238 go e .OnStarted ()
0 commit comments