All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@google.com>
To: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	 Willem de Bruijn <willemb@google.com>
Cc: Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	 Kuniyuki Iwashima <kuni1840@gmail.com>,
	netdev@vger.kernel.org
Subject: [PATCH v1 net-next] net: Shrink skc_reuse:4 to 2 bits.
Date: Tue,  3 Nov 2026 04:42:06 +0000	[thread overview]
Message-ID: <20261103044213.1336347-1-kuniyu@google.com> (raw)

skc_reuse now consumes 4 bits.

However, SK_NO_REUSE, SK_CAN_REUSE, and SK_FORCE_REUSE
are mutually exclusive and fit in 2 bits.

Let's reclaim 2 bits.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
---
This is to give a bit to SO_NO_RFS instead of sk_flags.
https://lore.kernel.org/netdev/20261031113330.45704-2-vitaly.zuevsky@gcore.com/
---
 include/net/sock.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 173b37b2b8bb..4c831eec2045 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -125,6 +125,7 @@ typedef __u64 __bitwise __addrpair;
  *	@skc_net_refcnt: socket is using net ref counting
  *	@skc_bypass_prot_mem: bypass the per-protocol memory accounting for skb
  *	@skc_bound_dev_if: bound device index if != 0
+ *	@skc_unused: unused bits
  *	@skc_bind_node: bind hash linkage for various protocol lookup tables
  *	@skc_portaddr_node: second hash linkage for UDP
  *	@skc_prot: protocol handlers inside a network family
@@ -176,11 +177,12 @@ struct sock_common {
 
 	unsigned short		skc_family;
 	volatile unsigned char	skc_state;
-	unsigned char		skc_reuse:4;
+	unsigned char		skc_reuse:2;
 	unsigned char		skc_reuseport:1;
 	unsigned char		skc_ipv6only:1;
 	unsigned char		skc_net_refcnt:1;
 	unsigned char		skc_bypass_prot_mem:1;
+	unsigned char		skc_unused:2;
 	int			skc_bound_dev_if;
 	union {
 		struct hlist_node	skc_bind_node;
-- 
2.56.0.385.gac671c819a-goog


             reply	other threads:[~2026-11-03  4:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  4:42 Kuniyuki Iwashima [this message]
2026-11-06  9:59 ` [PATCH v1 net-next] net: Shrink skc_reuse:4 to 2 bits Simon Horman
2026-11-06 19:40 ` patchwork-bot+netdevbpf

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=20261103044213.1336347-1-kuniyu@google.com \
    --to=kuniyu@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.