net: Shrink skc_reuse:4 to 2 bits.
Subsystems (3)
Kuniyuki Iwashima
maintainerPATCH 1/1 net: Shrink skc_reuse:4 to 2 bits.
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.
---
This is to give a bit to SO_NO_RFS instead of sk_flags.
https://lore.kernel.org/netdev/[email protected]/
--- include/net/sock.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
include/net/sock.h +3 -1
@@ -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;
Signature · 1 line
2.56.0.385.gac671c819a-goog
Quoted 8 lines · Kuniyuki Iwashima
skc_reusenow consumes 4 bits.However,
SK_NO_REUSE,SK_CAN_REUSE, andSK_FORCE_REUSEare mutually exclusive and fit in 2 bits.Let's reclaim 2 bits.
Signed-off-by Kuniyuki Iwashima <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Tue, 3 Nov 2026 04:42:06 +0000 you wrote:
skc_reusenow consumes 4 bits.However,
SK_NO_REUSE,SK_CAN_REUSE, andSK_FORCE_REUSEare mutually exclusive and fit in 2 bits.Let's reclaim 2 bits.
[...]
Here is the summary with links:
- [v1,net-next] net: Shrink skc_reuse:4 to 2 bits.
https://git.kernel.org/netdev/net-next/c/13df9cc6fc0b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html