Skip to content
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

Cleanup cilium-calls map #732

Merged
merged 2 commits into from
May 16, 2017
Merged

Cleanup cilium-calls map #732

merged 2 commits into from
May 16, 2017

Conversation

borkmann
Copy link
Member

No description provided.

@borkmann borkmann requested review from tgraf and aanm May 16, 2017 15:29
return bpf.MapPath(CallsMapName + strconv.Itoa(id))
}

// CallsMapPath returns the path to cilium tail calls map of an endpoint.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment on exported method Endpoint.CallsMapPathLocked should be of the form "CallsMapPathLocked ..."

@@ -674,6 +677,15 @@ func (e *Endpoint) PolicyMapPathLocked() string {
return PolicyMapPath(int(e.ID))
}

func CallsMapPath(id int) string {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported function CallsMapPath should have comment or be unexported

@@ -158,6 +158,9 @@ const (
StateReady = string(models.EndpointStateReady)
// StateRegenerating specifies when the endpoint is being regenerated.
StateRegenerating = string(models.EndpointStateRegenerating)

// Base prefix for EP specific call map.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment on exported const CallsMapName should be of the form "CallsMapName ..."

Copy link
Member

@tgraf tgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, only a couple of minor issues with comment formatting for godoc.

@borkmann
Copy link
Member Author

Ok, I fix these two comments up in the process.

cilium_calls map is the only map in cilium that is currently marked
as PIN_OBJECT_NS. Issue is that cilium daemon currently does not
clean this up during EP removal. Over time, this consumes a bit of
memory since the tail call map holds programs that hold maps itself,
so f.e. even if we removed the CT maps from the BPF fs, they can
still hold a ref in the kernel by one of the tail called programs
and as such cannot be cleaned. Move them into PIN_GLOBAL_NS with
the EP id appended in the name, and trigger removal once EP is
deleted.

Signed-off-by: Daniel Borkmann <daniel@cilium.io>
Signed-off-by: Daniel Borkmann <daniel@cilium.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants