[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250222183057.800800-4-xiyou.wangcong@gmail.com>
Date: Sat, 22 Feb 2025 10:30:56 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: netdev@...r.kernel.org
Cc: bpf@...r.kernel.org,
john.fastabend@...il.com,
jakub@...udflare.com,
zhoufeng.zf@...edance.com,
zijianzhang@...edance.com,
Cong Wang <cong.wang@...edance.com>
Subject: [Patch bpf-next 3/4] skmsg: use bitfields for struct sk_psock
From: Cong Wang <cong.wang@...edance.com>
psock->eval can only have 4 possible values, make it 8-bit is
sufficient.
psock->redir_ingress is just a boolean, using 1 bit is enough.
Signed-off-by: Cong Wang <cong.wang@...edance.com>
---
include/linux/skmsg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h
index bf28ce9b5fdb..beaf79b2b68b 100644
--- a/include/linux/skmsg.h
+++ b/include/linux/skmsg.h
@@ -85,8 +85,8 @@ struct sk_psock {
struct sock *sk_redir;
u32 apply_bytes;
u32 cork_bytes;
- u32 eval;
- bool redir_ingress; /* undefined if sk_redir is null */
+ unsigned int eval : 8;
+ unsigned int redir_ingress : 1; /* undefined if sk_redir is null */
struct sk_msg *cork;
struct sk_psock_progs progs;
#if IS_ENABLED(CONFIG_BPF_STREAM_PARSER)
--
2.34.1
Powered by blists - more mailing lists