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
1aefb0db
Commit
1aefb0db
authored
11 years ago
by
Shudong Zhou
Browse files
Options
Downloads
Patches
Plain Diff
IN-166 Do not wipe flows on a quick switch reconnect
parent
17a92f2f
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/core/internal/Controller.java
+12
-3
12 additions, 3 deletions
...va/net/floodlightcontroller/core/internal/Controller.java
with
12 additions
and
3 deletions
src/main/java/net/floodlightcontroller/core/internal/Controller.java
+
12
−
3
View file @
1aefb0db
...
...
@@ -95,6 +95,8 @@ import net.floodlightcontroller.threadpool.IThreadPoolService;
import
net.floodlightcontroller.util.EventHistory
;
import
net.floodlightcontroller.util.LoadMonitor
;
import
net.floodlightcontroller.util.EventHistory.EvAction
;
import
net.floodlightcontroller.util.TimedCache
;
import
org.jboss.netty.bootstrap.ServerBootstrap
;
import
org.jboss.netty.channel.ChannelPipelineFactory
;
import
org.jboss.netty.channel.group.ChannelGroup
;
...
...
@@ -191,6 +193,7 @@ public class Controller implements IFloodlightProviderService,
// Flag to always flush flow table on switch reconnect (HA or otherwise)
private
boolean
alwaysClearFlowsOnSwActivate
=
false
;
private
TimedCache
<
Long
>
swConnectCache
;
// Storage table names
protected
static
final
String
CONTROLLER_TABLE_NAME
=
"controller_controller"
;
...
...
@@ -1065,7 +1068,8 @@ public class Controller implements IFloodlightProviderService,
// flows.
// TODO: if we switch was recently (seconds) connected we
// might decide to not wipe the flow table.
sw
.
clearAllFlowMods
();
if
(!
swConnectCache
.
update
(
sw
.
getId
()))
sw
.
clearAllFlowMods
();
addUpdateToQueue
(
new
SwitchUpdate
(
dpid
,
SwitchUpdateType
.
ADDED
));
addUpdateToQueue
(
new
SwitchUpdate
(
dpid
,
...
...
@@ -1074,8 +1078,10 @@ public class Controller implements IFloodlightProviderService,
}
else
{
// FIXME: switch was in store. check if ports or anything else
// has changed and send update.
if
(
alwaysClearFlowsOnSwActivate
)
sw
.
clearAllFlowMods
();
if
(
alwaysClearFlowsOnSwActivate
)
{
if
(!
swConnectCache
.
update
(
sw
.
getId
()))
sw
.
clearAllFlowMods
();
}
if
(
sw
.
attributeEquals
(
IOFSwitch
.
SWITCH_SUPPORTS_NX_ROLE
,
true
))
{
// We have a stored switch and the newly activated switch
// supports roles. This indicates that the switch was
...
...
@@ -1208,6 +1214,7 @@ public class Controller implements IFloodlightProviderService,
return
;
}
log
.
debug
(
"removeSwitch {}"
,
sw
);
swConnectCache
.
update
(
sw
.
getId
());
this
.
activeSwitches
.
remove
(
sw
.
getId
());
removeSwitchFromStore
(
sw
.
getId
());
// We cancel all outstanding statistics replies if the switch transition
...
...
@@ -2308,6 +2315,8 @@ public class Controller implements IFloodlightProviderService,
INITIAL_ROLE_CHANGE_DESCRIPTION
);
this
.
switchManager
=
new
SwitchManager
(
this
.
notifiedRole
);
this
.
counters
=
new
Counters
();
this
.
swConnectCache
=
new
TimedCache
<
Long
>(
100
,
10
*
1000
);
// 10 seconds interval
}
/**
...
...
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