Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
dfee35f7
Commit
dfee35f7
authored
12 years ago
by
Kanzhe Jiang
Browse files
Options
Downloads
Patches
Plain Diff
clean up log msg
parent
0ae432f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java
+11
-33
11 additions, 33 deletions
...tcontroller/devicemanager/internal/DeviceManagerImpl.java
with
11 additions
and
33 deletions
src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java
+
11
−
33
View file @
dfee35f7
...
@@ -787,7 +787,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -787,7 +787,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
if
(
isPortStatusDelOrModify
(
ps
))
{
if
(
isPortStatusDelOrModify
(
ps
))
{
SwitchPortTuple
id
=
new
SwitchPortTuple
(
sw
,
SwitchPortTuple
id
=
new
SwitchPortTuple
(
sw
,
ps
.
getDesc
().
getPortNumber
());
ps
.
getDesc
().
getPortNumber
());
log
.
debug
(
"PortStatusMessage: {}"
,
id
);
lock
.
writeLock
().
lock
();
lock
.
writeLock
().
lock
();
try
{
try
{
devMgrMaps
.
removeSwPort
(
id
);
devMgrMaps
.
removeSwPort
(
id
);
...
@@ -813,9 +812,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -813,9 +812,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
}
}
writeDeviceToStorage
(
device
,
currentDate
);
writeDeviceToStorage
(
device
,
currentDate
);
updateStatus
(
device
,
true
);
updateStatus
(
device
,
true
);
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"New device learned {}"
,
device
);
}
}
}
private
boolean
isGratArp
(
Ethernet
eth
)
{
private
boolean
isGratArp
(
Ethernet
eth
)
{
...
@@ -882,8 +878,8 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -882,8 +878,8 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
match
.
loadFromPacket
(
pi
.
getPacketData
(),
pi
.
getInPort
(),
sw
.
getId
());
match
.
loadFromPacket
(
pi
.
getPacketData
(),
pi
.
getInPort
(),
sw
.
getId
());
// Add this packet-in to event history
// Add this packet-in to event history
evHistPktIn
(
match
);
evHistPktIn
(
match
);
if
(
log
.
is
Debug
Enabled
())
if
(
log
.
is
Trace
Enabled
())
log
.
debug
(
"Entering packet_in processing sw {}, port {}. {} --> {}, type {}"
,
log
.
trace
(
"Entering packet_in processing sw {}, port {}. {} --> {}, type {}"
,
new
Object
[]
{
sw
.
getStringId
(),
pi
.
getInPort
(),
new
Object
[]
{
sw
.
getStringId
(),
pi
.
getInPort
(),
HexString
.
toHexString
(
match
.
getDataLayerSource
()),
HexString
.
toHexString
(
match
.
getDataLayerSource
()),
HexString
.
toHexString
(
match
.
getDataLayerDestination
()),
HexString
.
toHexString
(
match
.
getDataLayerDestination
()),
...
@@ -895,8 +891,8 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -895,8 +891,8 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
*/
*/
if
((
eth
.
isBroadcast
()
||
eth
.
isMulticast
())
&&
if
((
eth
.
isBroadcast
()
||
eth
.
isMulticast
())
&&
!
topology
.
isIncomingBroadcastAllowed
(
pinSw
,
pinPort
))
{
!
topology
.
isIncomingBroadcastAllowed
(
pinSw
,
pinPort
))
{
if
(
log
.
is
Debug
Enabled
())
{
if
(
log
.
is
Trace
Enabled
())
{
log
.
debug
(
"Drop broadcast/multicast packets with src {} from not-allowed incoming broadcast ports {} {}"
,
log
.
trace
(
"Drop broadcast/multicast packets with src {} from not-allowed incoming broadcast ports {} {}"
,
new
Object
[]
{
HexString
.
toHexString
(
eth
.
getSourceMACAddress
()),
new
Object
[]
{
HexString
.
toHexString
(
eth
.
getSourceMACAddress
()),
HexString
.
toHexString
(
pinSw
),
pinPort
});
HexString
.
toHexString
(
pinSw
),
pinPort
});
}
}
...
@@ -923,7 +919,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -923,7 +919,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
if
(
vlan
<
0
)
vlan
=
null
;
if
(
vlan
<
0
)
vlan
=
null
;
int
nwSrc
=
getSrcNwAddr
(
eth
,
dlAddr
);
int
nwSrc
=
getSrcNwAddr
(
eth
,
dlAddr
);
Device
srcDevice
=
devMgrMaps
.
getDeviceByDataLayerAddr
(
dlAddr
);
Device
srcDevice
=
devMgrMaps
.
getDeviceByDataLayerAddr
(
dlAddr
);
log
.
debug
(
"SRC device {}"
,
srcDevice
);
if
(
log
.
isTraceEnabled
())
{
if
(
log
.
isTraceEnabled
())
{
long
dstAddr
=
Ethernet
.
toLong
(
match
.
getDataLayerDestination
());
long
dstAddr
=
Ethernet
.
toLong
(
match
.
getDataLayerDestination
());
Device
dstDevice
=
devMgrMaps
.
getDeviceByDataLayerAddr
(
dstAddr
);
Device
dstDevice
=
devMgrMaps
.
getDeviceByDataLayerAddr
(
dstAddr
);
...
@@ -1021,7 +1016,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -1021,7 +1016,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
if
(
newAttachmentPoint
||
newNetworkAddress
||
updateDeviceVlan
||
if
(
newAttachmentPoint
||
newNetworkAddress
||
updateDeviceVlan
||
updateNeworkAddressMap
)
{
updateNeworkAddressMap
)
{
Device
nd
=
new
Device
(
srcDevice
);
Device
nd
=
new
Device
(
srcDevice
);
log
.
debug
(
"Copied device {}"
,
nd
);
try
{
try
{
// Check if we have seen this attachmentPoint recently,
// Check if we have seen this attachmentPoint recently,
...
@@ -1308,7 +1302,7 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -1308,7 +1302,7 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
}
}
}
else
{
}
else
{
updateStatus
(
device
,
true
);
updateStatus
(
device
,
true
);
log
.
debug
(
"Device {} added {}"
,
device
,
swPort
);
log
.
debug
(
"Device {} added
AP at
{}"
,
device
,
swPort
);
}
}
writeAttachmentPointToStorage
(
device
,
attachmentPoint
,
currentDate
);
writeAttachmentPointToStorage
(
device
,
attachmentPoint
,
currentDate
);
...
@@ -1331,9 +1325,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -1331,9 +1325,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
devMgrMaps
.
delFromMaps
(
device
);
devMgrMaps
.
delFromMaps
(
device
);
removeDeviceDiscoveredStateFromStorage
(
device
);
removeDeviceDiscoveredStateFromStorage
(
device
);
updateStatus
(
device
,
false
);
updateStatus
(
device
,
false
);
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"Removed device {}"
,
device
);
}
processUpdates
();
processUpdates
();
}
}
...
@@ -1471,7 +1462,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -1471,7 +1462,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
@Override
@Override
public
void
removedSwitch
(
IOFSwitch
sw
)
{
public
void
removedSwitch
(
IOFSwitch
sw
)
{
log
.
debug
(
"RemovedSwitch {}"
,
sw
);
// remove all devices attached to this switch
// remove all devices attached to this switch
if
(!
devMgrMaps
.
isSwitchPresent
(
sw
))
{
if
(!
devMgrMaps
.
isSwitchPresent
(
sw
))
{
// Switch not present
// Switch not present
...
@@ -1495,7 +1485,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -1495,7 +1485,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
// Remove all devices living on this switch:port now that it is
// Remove all devices living on this switch:port now that it is
// internal
// internal
SwitchPortTuple
switchPort
=
new
SwitchPortTuple
(
floodlightProvider
.
getSwitches
().
get
(
dstSw
),
dstPort
);
SwitchPortTuple
switchPort
=
new
SwitchPortTuple
(
floodlightProvider
.
getSwitches
().
get
(
dstSw
),
dstPort
);
log
.
debug
(
"addedOrUpdatedLink: remove internal port {}"
,
switchPort
);
lock
.
writeLock
().
lock
();
lock
.
writeLock
().
lock
();
try
{
try
{
devMgrMaps
.
removeSwPort
(
switchPort
);
devMgrMaps
.
removeSwPort
(
switchPort
);
...
@@ -1513,7 +1502,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -1513,7 +1502,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
synchronized
(
updates
)
{
synchronized
(
updates
)
{
Update
update
=
null
;
Update
update
=
null
;
while
((
update
=
updates
.
poll
())
!=
null
)
{
while
((
update
=
updates
.
poll
())
!=
null
)
{
log
.
debug
(
"processUpdates, update: {}"
,
update
);
if
(
deviceManagerAware
==
null
)
if
(
deviceManagerAware
==
null
)
continue
;
continue
;
for
(
IDeviceManagerAware
dma
:
deviceManagerAware
)
{
for
(
IDeviceManagerAware
dma
:
deviceManagerAware
)
{
...
@@ -1709,9 +1697,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -1709,9 +1697,6 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
*/
*/
d
.
setAttachmentPoints
(
tempAPMap
.
values
());
d
.
setAttachmentPoints
(
tempAPMap
.
values
());
for
(
DeviceAttachmentPoint
dap:
tempAPMap
.
values
())
{
for
(
DeviceAttachmentPoint
dap:
tempAPMap
.
values
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"Reset AP {} for device {}"
,
dap
,
d
);
}
boolean
isblocked
=
dap
.
isBlocked
();
boolean
isblocked
=
dap
.
isBlocked
();
dap
.
resetConflictState
();
dap
.
resetConflictState
();
// only write to DB if the blocking state is reset.
// only write to DB if the blocking state is reset.
...
@@ -1723,16 +1708,11 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -1723,16 +1708,11 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
// Delete from memory after storage,
// Delete from memory after storage,
// otherwise an exception will
// otherwise an exception will
// leave stale attachment points on storage.
// leave stale attachment points on storage.
log
.
debug
(
"Remove AP {} from storage for device {}"
,
dap
,
d
.
getDlAddrString
());
removeAttachmentPointFromStorage
(
d
.
getDlAddrString
(),
removeAttachmentPointFromStorage
(
d
.
getDlAddrString
(),
HexString
.
toHexString
(
dap
.
getSwitchPort
().
getSw
().
getId
()),
HexString
.
toHexString
(
dap
.
getSwitchPort
().
getSw
().
getId
()),
dap
.
getSwitchPort
().
getPort
().
toString
());
dap
.
getSwitchPort
().
getPort
().
toString
());
d
.
removeOldAttachmentPoint
(
dap
);
d
.
removeOldAttachmentPoint
(
dap
);
}
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"After cleanup, device {}"
,
d
);
}
}
}
public
void
clearAllDeviceStateFromMemory
()
{
public
void
clearAllDeviceStateFromMemory
()
{
...
@@ -2077,7 +2057,9 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -2077,7 +2057,9 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
}
}
Date
agedBoundary
=
ageBoundaryDifference
(
currentDate
,
expire
);
Date
agedBoundary
=
ageBoundaryDifference
(
currentDate
,
expire
);
if
(
ap
.
getLastSeen
().
before
(
agedBoundary
))
{
if
(
ap
.
getLastSeen
().
before
(
agedBoundary
))
{
log
.
debug
(
"Remove aged AP {} from device {}"
,
ap
,
HexString
.
toHexString
(
dlAddr
));
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"Remove aged AP {} from device {}"
,
ap
,
HexString
.
toHexString
(
dlAddr
));
}
devMgrMaps
.
delDevAttachmentPoint
(
dlAddr
,
ap
.
getSwitchPort
());
devMgrMaps
.
delDevAttachmentPoint
(
dlAddr
,
ap
.
getSwitchPort
());
evHistAttachmtPt
(
device
.
getDataLayerAddressAsLong
(),
evHistAttachmtPt
(
device
.
getDataLayerAddressAsLong
(),
ap
.
getSwitchPort
(),
EvAction
.
REMOVED
,
ap
.
getSwitchPort
(),
EvAction
.
REMOVED
,
...
@@ -2161,13 +2143,7 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -2161,13 +2143,7 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
// serialize the devMgrMaps updates
// serialize the devMgrMaps updates
synchronized
(
devMgrMaps
)
{
synchronized
(
devMgrMaps
)
{
Collection
<
Device
>
devices
=
devMgrMaps
.
getDevices
();
Collection
<
Device
>
devices
=
devMgrMaps
.
getDevices
();
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"DeviceUpdateWorker: devMgrMaps has {} devices"
,
devices
.
size
());
}
for
(
Device
d
:
devices
)
{
for
(
Device
d
:
devices
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"DeviceUpdateWorker: cleaning up attachment points for device {}"
,
d
);
}
try
{
try
{
Device
dCopy
=
new
Device
(
d
);
Device
dCopy
=
new
Device
(
d
);
cleanupAttachmentPoints
(
dCopy
);
cleanupAttachmentPoints
(
dCopy
);
...
@@ -2181,7 +2157,9 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
...
@@ -2181,7 +2157,9 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
}
}
}
}
lastTopoChangeTime
=
new
Date
();
lastTopoChangeTime
=
new
Date
();
log
.
debug
(
"Set lastTopoChangeTime {}"
,
lastTopoChangeTime
);
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"Set lastTopoChangeTime {}"
,
lastTopoChangeTime
);
}
}
}
}
catch
(
StorageException
e
)
{
}
catch
(
StorageException
e
)
{
log
.
error
(
"DeviceUpdateWorker had a storage exception, "
+
log
.
error
(
"DeviceUpdateWorker had a storage exception, "
+
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment