-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for REMOVE_BUCKET operation in group #45
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ | |
|
||
.idea/ | ||
.vscode/ | ||
vendor | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.6.7 | ||
v0.6.9 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//go:build linux || darwin | ||
// +build linux darwin | ||
|
||
package ofctrl | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,13 +109,23 @@ func (self *Group) getGroupModMessage(command int) *openflow15.GroupMod { | |
groupMod.Type = openflow15.GT_FF | ||
} | ||
|
||
for _, bkt := range self.Buckets { | ||
// Add the bucket to group | ||
groupMod.AddBucket(*bkt) | ||
// In a request of type OFPGC_REMOVE_BUCKET, bucket list should be empty. | ||
if command != openflow15.OFPGC_REMOVE_BUCKET { | ||
for _, bkt := range self.Buckets { | ||
// Add the bucket to group | ||
groupMod.AddBucket(*bkt) | ||
} | ||
} | ||
|
||
if command == openflow15.OFPGC_INSERT_BUCKET { | ||
// In a request of type OFPGC_INSERT_BUCKET, the command_bucket_id field is used to specify the position in the | ||
// current installed bucket list to insert new buckets. Here place the buckets to the end of the current installed | ||
// bucket list. | ||
groupMod.CommandBucketId = openflow15.OFPG_BUCKET_LAST | ||
} else if command == openflow15.OFPGC_REMOVE_BUCKET { | ||
// In a request of type OFPGC_REMOVE_BUCKET, the CommandBucketId field is used to specify the identifier of the | ||
// bucket to remove from current installed bucket list. | ||
groupMod.CommandBucketId = self.Buckets[0].BucketId | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it mean a single bucket can be removed in one OFPGC_REMOVE_BUCKET request? Is it possible to remove multiple buckets in a request? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the document of Openflow 1.5, it cannot. |
||
groupMod.Buckets = nil | ||
hongliangl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
groupMod.Command = uint16(command) | ||
return groupMod | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why adds this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I run command
go mod vendor
in this project by accident and found that this project doesn't ignore this directory.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But no directory named as "vendor" exists in this repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Antrea, we also ignore this directory.