lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250530171530.lqnim5gh3egiddkc@gmail.com>
Date: Fri, 30 May 2025 10:15:30 -0700
From: John Fastabend <john.fastabend@...il.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org, zhoufeng.zf@...edance.com,
	jakub@...udflare.com, zijianzhang@...edance.com,
	Cong Wang <cong.wang@...edance.com>
Subject: Re: [Patch bpf-next v3 3/4] skmsg: save some space in struct sk_psock

On 2025-05-19 13:36:27, Cong Wang wrote:
> From: Cong Wang <cong.wang@...edance.com>
> 
> This patch aims to save some space in struct sk_psock and prepares for
> the next patch which will add more fields.
> 
> 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..7620f170c4b1 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 */
> +	u8				eval;
> +	u8 				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
> 

Reviewed-by: John Fastabend <john.fastabend@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ