git: 3d0a736796a9 - main - tcp: Add a new kernel-only TCP_USE_DDP socket option

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 20 Mar 2024 22:34:37 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=3d0a736796a99fe70be9de97beec8f10970c6905

commit 3d0a736796a99fe70be9de97beec8f10970c6905
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-03-20 22:29:02 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-03-20 22:29:02 +0000

    tcp: Add a new kernel-only TCP_USE_DDP socket option
    
    This socket option can be used by in-kernel consumers (like NFS) to
    request a NIC to use optimized receive of large buffers for a
    connection.  The current use case is to support DDP by the TOE on
    Chelsio NICs.
    
    Reviewed by:    rscheff, tuexen, glebius
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D44000
---
 sys/netinet/tcp.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h
index a8259fa30a3a..c97a3e04d9b6 100644
--- a/sys/netinet/tcp.h
+++ b/sys/netinet/tcp.h
@@ -202,6 +202,9 @@ __tcp_set_flags(struct tcphdr *th, uint16_t flags)
 #define	TCP_RXTLS_MODE	42	/* Receive TLS mode */
 #define	TCP_IWND_NB	43	/* Override initial window (units: bytes) */
 #define	TCP_IWND_NSEG	44	/* Override initial window (units: MSS segs) */
+#ifdef _KERNEL
+#define	TCP_USE_DDP	45	/* Use direct data placement for so_rcvbuf */
+#endif
 #define	TCP_LOGID_CNT	46	/* get number of connections with the same ID */
 #define	TCP_LOG_TAG	47	/* configure tag for grouping logs */
 #define	TCP_USER_LOG	48	/* userspace log event */