Skip to contentSkip to conversation

ss: Shorter display format for TLS zerocopy sendfile

PATCH Superseded Maxim Mikityanskiy 1 participant 1 message Jun 8, 2022

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ss: Shorter display format for TLS zerocopy sendfile

Commit 21c07b45688f ("ss: Show zerocopy sendfile status of TLS sockets") started displaying the activation status of zerocopy sendfile on TLS sockets, exposed via sock_diag. This commit makes the format more
compact: the flag's name is shorter and is printed only when the feature is active, similar to other flag options.

The flag's name is also generalized ("sendfile" -> "tx") to embrace possible future optimizations, and includes an explicit indication that the underlying data must not be modified during transfer ("ro").

---
 include/uapi/linux/tls.h | 2 +-
 misc/ss.c                | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)
include/uapi/linux/tls.h +1 -1
index 83a3cea4..e9eeccd2 100644
@@ -161,7 +161,7 @@ enum {
 	TLS_INFO_CIPHER,
 	TLS_INFO_TXCONF,
 	TLS_INFO_RXCONF,
-	TLS_INFO_ZC_SENDFILE,
+	TLS_INFO_ZC_TX,
 	__TLS_INFO_MAX,
 };
 #define TLS_INFO_MAX (__TLS_INFO_MAX - 1)
misc/ss.c +3 -2
index c4434a20..78e52ba2 100644
@@ -2988,7 +2988,8 @@ static void tcp_tls_conf(const char *name, struct rtattr *attr)
 
 static void tcp_tls_zc_sendfile(struct rtattr *attr)
 {
-	out(" zerocopy_sendfile: %s", attr ? "active" : "inactive");
+	if (attr)
+		out(" zc_ro_tx");
 }
 
 static void mptcp_subflow_info(struct rtattr *tb[])
@@ -3221,7 +3222,7 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
 			tcp_tls_cipher(tlsinfo[TLS_INFO_CIPHER]);
 			tcp_tls_conf("rxconf", tlsinfo[TLS_INFO_RXCONF]);
 			tcp_tls_conf("txconf", tlsinfo[TLS_INFO_TXCONF]);
-			tcp_tls_zc_sendfile(tlsinfo[TLS_INFO_ZC_SENDFILE]);
+			tcp_tls_zc_sendfile(tlsinfo[TLS_INFO_ZC_TX]);
 		}
 		if (ulpinfo[INET_ULP_INFO_MPTCP]) {
 			struct rtattr *sfinfo[MPTCP_SUBFLOW_ATTR_MAX + 1] =
Signature · 1 line
2.25.1