RFC Change sock->sk_protocol to a 16-bit value
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest3 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | net: Make sock protocol value checks more specificinclude/ net/ net/ | +2 | 0 replies | |
| 2/3 | sock: Make sk_protocol a 16-bit valueinclude/ include/ | +3 | 0 replies | |
| 3/3 | net: Add IPPROTO_MPTCP to inet_sock_set_state tracepoint outputinclude/ | +2 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [MPTCP] [RFC PATCH 0/3] Change sock->sk_protocol to a 16-bit value
While debugging socket state transitions in MPTCP sockets, I found that MPTCP sockets were listing IPPROTO_TCP as their protocol in /sys/kernel/debug/tracing/trace. sock->sk_protocol was only 8 bits wide, truncating the new value of IPPROTO_MPTCP (0x0106) to IPPROTO_TCP (0x06).
The networking code has varying integer widths for 'protocol' at different layers:
* POSIX socket API: 32 bits
* sk_buff->protocol: 16 bits
* IP header (on the wire): 8 bits
MPTCP shows a use for protocol values outside those that fit in an IP header. The change to struct sock fills an 8-bit hole, so there is no change in the size of the structure.
Given that we are currently discussing the appropriate value for IPPROTO_MPTCP, I'm sending this as an RFC to inform those discussions. I had previously thought that the 16-bit value for IPPROTO_MPTCP was compatible with the existing code base.
Mat Martineau (3):
net: Make sock protocol value checks more specific
sock: Make sk_protocol a 16-bit value
net: Add IPPROTO_MPTCP to inet_sock_set_state tracepoint output
include/net/sock.h | 5 ++--- include/trace/events/sock.h | 5 +++-- net/ax25/af_ax25.c | 2 +- net/decnet/af_decnet.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.22.0