[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210112194143.1494-4-yuri.benditovich@daynix.com>
Date: Tue, 12 Jan 2021 21:41:39 +0200
From: Yuri Benditovich <yuri.benditovich@...nix.com>
To: davem@...emloft.net, kuba@...nel.org, mst@...hat.com,
jasowang@...hat.com, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, kafai@...com, songliubraving@...com, yhs@...com,
john.fastabend@...il.com, kpsingh@...nel.org,
rdunlap@...radead.org, willemb@...gle.com, gustavoars@...nel.org,
herbert@...dor.apana.org.au, steffen.klassert@...unet.com,
nogikh@...gle.com, pablo@...filter.org, decui@...rosoft.com,
cai@....pw, jakub@...udflare.com, elver@...gle.com,
pabeni@...hat.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
virtualization@...ts.linux-foundation.org, bpf@...r.kernel.org
Cc: yan@...nix.com
Subject: [RFC PATCH 3/7] tun: allow use of BPF_PROG_TYPE_SCHED_CLS program type
This program type can set skb hash value. It will be useful
when the tun will support hash reporting feature if virtio-net.
Signed-off-by: Yuri Benditovich <yuri.benditovich@...nix.com>
---
drivers/net/tun.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 7959b5c2d11f..455f7afc1f36 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -2981,6 +2981,8 @@ static int tun_set_ebpf(struct tun_struct *tun, struct tun_prog __rcu **prog_p,
prog = NULL;
} else {
prog = bpf_prog_get_type(fd, BPF_PROG_TYPE_SOCKET_FILTER);
+ if (IS_ERR(prog))
+ prog = bpf_prog_get_type(fd, BPF_PROG_TYPE_SCHED_CLS);
if (IS_ERR(prog))
return PTR_ERR(prog);
}
--
2.17.1
Powered by blists - more mailing lists