git: 34d6b4c3523c - stable/13 - ctld: Disable TCP DDP for connection sockets.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 29 Oct 2021 23:58:46 UTC
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=34d6b4c3523ce5b81d1c4613cef1c307eebc14f5

commit 34d6b4c3523ce5b81d1c4613cef1c307eebc14f5
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2021-09-13 16:57:54 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2021-10-29 23:38:21 +0000

    ctld: Disable TCP DDP for connection sockets.
    
    cxgbei is not able to offload PDU processing for a socket using TCP
    DDP offload.
    
    Sponsored by:   Chelsio Communications
    
    (cherry picked from commit 3b5f95d7bd20e366d720a47a79c451ae037a3ae1)
---
 usr.sbin/ctld/ctld.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c
index 7af1d88da44a..c37181ff00d0 100644
--- a/usr.sbin/ctld/ctld.c
+++ b/usr.sbin/ctld/ctld.c
@@ -2178,6 +2178,10 @@ conf_apply(struct conf *oldconf, struct conf *newconf)
 			    &sockbuf, sizeof(sockbuf)) == -1)
 				log_warn("setsockopt(SO_SNDBUF) failed "
 				    "for %s", newp->p_listen);
+			if (setsockopt(newp->p_socket, SOL_SOCKET, SO_NO_DDP,
+			    &one, sizeof(one)) == -1)
+				log_warn("setsockopt(SO_NO_DDP) failed "
+				    "for %s", newp->p_listen);
 			error = setsockopt(newp->p_socket, SOL_SOCKET,
 			    SO_REUSEADDR, &one, sizeof(one));
 			if (error != 0) {