bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tyler Wear <quic_twear@quicinc.com>
To: netdev@vger.kernel.org, bpf@vger.kernel.org
Cc: kafai@fb.com, maze@google.com, yhs@fb.com,
	Tyler Wear <quic_twear@quicinc.com>
Subject: [PATCH] Add skb_store_bytes() for BPF_PROG_TYPE_CGROUP_SKB
Date: Tue, 21 Dec 2021 18:27:37 -0800	[thread overview]
Message-ID: <20211222022737.7369-1-quic_twear@quicinc.com> (raw)

Need to modify the ds field to support upcoming
Wifi QoS Alliance spec. Instead of adding generic
function for just modifying the ds field, add
skb_store_bytes for BPF_PROG_TYPE_CGROUP_SKB. This
allows other fields in the network and transport header
to be modified in the future.

Signed-off-by: Tyler Wear <quic_twear@quicinc.com>
---
 net/core/filter.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/core/filter.c b/net/core/filter.c
index 6102f093d59a..0c25aa2212a2 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -7289,6 +7289,8 @@ static const struct bpf_func_proto *
 cg_skb_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
 {
 	switch (func_id) {
+	case BPF_FUNC_skb_store_bytes:
+		return &bpf_skb_store_bytes_proto;
 	case BPF_FUNC_get_local_storage:
 		return &bpf_get_local_storage_proto;
 	case BPF_FUNC_sk_fullsock:
-- 
2.17.1


             reply	other threads:[~2021-12-22  2:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22  2:27 Tyler Wear [this message]
2021-12-22  3:43 ` [PATCH] Add skb_store_bytes() for BPF_PROG_TYPE_CGROUP_SKB Yonghong Song
2021-12-22 22:49   ` Tyler Wear
2021-12-22 23:50     ` Martin KaFai Lau
2021-12-29 18:29       ` Tyler Wear
2021-12-29 21:05         ` Martin KaFai Lau
2022-01-05  0:27           ` Tyler Wear (QUIC)
2022-01-06  7:50             ` Yonghong Song
2022-01-06 17:18               ` Tyler Wear (QUIC)
2022-01-06 22:35                 ` Yonghong Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211222022737.7369-1-quic_twear@quicinc.com \
    --to=quic_twear@quicinc.com \
    --cc=bpf@vger.kernel.org \
    --cc=kafai@fb.com \
    --cc=maze@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).