Thread (26 messages) 26 messages, 5 authors, 2023-12-11

Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH

From: Alexei Starovoitov <hidden>
Date: 2023-10-15 16:08:06
Also in: bpf, kvm, linux-doc, linux-kselftest, lkml, virtualization

On Sun, Oct 15, 2023 at 7:17 AM Akihiko Odaki [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 0448700890f7..298634556fab 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -988,6 +988,7 @@ enum bpf_prog_type {
        BPF_PROG_TYPE_SK_LOOKUP,
        BPF_PROG_TYPE_SYSCALL, /* a program that can execute syscalls */
        BPF_PROG_TYPE_NETFILTER,
+       BPF_PROG_TYPE_VNET_HASH,
Sorry, we do not add new stable program types anymore.
quoted hunk ↗ jump to hunk
@@ -6111,6 +6112,10 @@ struct __sk_buff {
        __u8  tstamp_type;
        __u32 :24;              /* Padding, future use. */
        __u64 hwtstamp;
+
+       __u32 vnet_hash_value;
+       __u16 vnet_hash_report;
+       __u16 vnet_rss_queue;
 };
we also do not add anything to uapi __sk_buff.
+const struct bpf_verifier_ops vnet_hash_verifier_ops = {
+       .get_func_proto         = sk_filter_func_proto,
+       .is_valid_access        = sk_filter_is_valid_access,
+       .convert_ctx_access     = bpf_convert_ctx_access,
+       .gen_ld_abs             = bpf_gen_ld_abs,
+};
and we don't do ctx rewrites like this either.

Please see how hid-bpf and cgroup rstat are hooking up bpf
in _unstable_ way.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help