Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.77 KB

bpf_sk_ancestor_cgroup_id.md

File metadata and controls

47 lines (30 loc) · 1.77 KB
title description
Helper Function 'bpf_sk_ancestor_cgroup_id'
This page documents the 'bpf_sk_ancestor_cgroup_id' eBPF helper function, including its defintion, usage, program types that can use it, and examples.

Helper function bpf_sk_ancestor_cgroup_id

:octicons-tag-24: v5.8

Definition

Copyright (c) 2015 The Libbpf Authors. All rights reserved.

Return id of cgroup v2 that is ancestor of cgroup associated with the sk at the ancestor_level. The root cgroup is at ancestor_level zero and each step down the hierarchy increments the level. If ancestor_level == level of cgroup associated with sk, then return value will be same as that of bpf_sk_cgroup_id().

The helper is useful to implement policies based on cgroups that are upper in hierarchy than immediate cgroup associated with sk.

The format of returned id and helper limitations are same as in bpf_sk_cgroup_id().

Returns

The id is returned or 0 in case the id could not be retrieved.

#!c static __u64 (* const bpf_sk_ancestor_cgroup_id)(void *sk, int ancestor_level) = (void *) 129;

Usage

!!! example "Docs could be improved" This part of the docs is incomplete, contributions are very welcome

Program types

This helper call can be used in the following program types:

Example

!!! example "Docs could be improved" This part of the docs is incomplete, contributions are very welcome