SEC("tc") int exception_throw_always_1(struct __sk_buff *ctx)
{
bpf_throw(64); return0;
}
/* In this case, the global func will never be seen executing after call to * static subprog, hence verifier will DCE the remaining instructions. Ensure we * are resilient to that.
*/
SEC("tc") int exception_throw_always_2(struct __sk_buff *ctx)
{ return global2static_simple(ctx->protocol);
}
SEC("tc") int exception_throw_unwind_1(struct __sk_buff *ctx)
{ return static2global(bpf_ntohs(ctx->protocol));
}
SEC("tc") int exception_tail_call(struct __sk_buff *ctx) { volatileint ret = 0;
ret = exception_tail_call_subprog(ctx); return ret + 8;
}
__noinline int exception_ext_global(struct __sk_buff *ctx)
{ volatileint ret = 0;
return ret;
}
static __noinline int exception_ext_static(struct __sk_buff *ctx)
{ return exception_ext_global(ctx);
}
SEC("tc") int exception_ext(struct __sk_buff *ctx)
{ return exception_ext_static(ctx);
}
__noinline int exception_cb_mod_global(u64 cookie)
{ volatileint ret = 0;
return ret;
}
/* Example of how the exception callback supplied during verification can still * introduce extensions by calling to dummy global functions, and alter runtime * behavior. * * Right now we don't allow freplace attachment to exception callback itself, * but if the need arises this restriction is technically feasible to relax in * the future.
*/
__noinline int exception_cb_mod(u64 cookie)
{ return exception_cb_mod_global(cookie) + cookie + 10;
}
SEC("tc")
__exception_cb(exception_cb_mod) int exception_ext_mod_cb_runtime(struct __sk_buff *ctx)
{
bpf_throw(25); return0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.