-
Notifications
You must be signed in to change notification settings - Fork 45
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
some workload mode bugfix and waypoint optimization #361
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 |
---|---|---|
|
@@ -20,13 +20,24 @@ import ( | |
"github.com/cilium/ebpf" | ||
) | ||
|
||
const ( | ||
MaxPortNum = 10 | ||
) | ||
|
||
type ServiceKey struct { | ||
ServiceId uint32 // service id | ||
} | ||
|
||
type ServicePorts [MaxPortNum]uint32 | ||
type TargetPorts [MaxPortNum]uint32 | ||
|
||
type ServiceValue struct { | ||
EndpointCount uint32 // endpoint count of current service | ||
LbPolicy uint32 // load balancing algorithm, currently only supports random algorithm | ||
EndpointCount uint32 // endpoint count of current service | ||
LbPolicy uint32 // load balancing algorithm, currently only supports random algorithm | ||
ServicePort ServicePorts // ServicePort[i] and TargetPort[i] are a pair, i starts from 0 and max value is MaxPortNum-1 | ||
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. FYI, it's better to define a 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. currently,we use cilium bpf interface to operate the map, and the interface cannot support self defined data struct. |
||
TargetPort TargetPorts | ||
WaypointAddr uint32 | ||
WaypointPort uint32 | ||
} | ||
|
||
func (c *Cache) ServiceUpdate(key *ServiceKey, value *ServiceValue) error { | ||
|
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.
rm \n
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.
It seems that all logs have been added with ‘\n’. Do we need to delete them all together in this PR.