Thread (11 messages) flat view 11 messages, 6 authors, 15d ago

Re: [PATCH v4 1/4] nvmet-tcp: unify sockopt with do_sock_setsockopt

From: Christoph Hellwig <hch@lst.de>
Date: 2026-08-19 09:04:48
Also in: linux-nvme, mptcp

On Tue, Aug 18, 2026 at 02:03:00PM +0800, Geliang Tang wrote:
From: Geliang Tang <redacted>

This patch consolidates socket option settings in nvmet-tcp by utilizing
the generic do_sock_setsockopt() helper for options including SO_LINGER,
SO_PRIORITY, SO_REUSEADDR, TCP_NODELAY, and IP_TOS. This change eliminates
the need to export and use specialized helpers for each individual socket
option.
Hmm.  I see that do_sock_setsockopt is exported, but it really should
not be.  It's really just an internal helper exposed for io_uring
and no modular code should be using it (never mind the non-GPL export).
A key benefit of this refactoring is that it decouples the socket option
configuration from the underlying transport protocol. This makes it
easier to extend nvmet-tcp to support other protocols, such as MPTCP, in
the future, as do_sock_setsockopt() abstracts away protocol-specific
differences without requiring per-option protocol-specific wrappers.
We really should have generic helpers in the networking code for this
and not duplicate them in driver using socket options.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help