From patchwork Sat Jun 17 12:11:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13283556 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 374E5EB64DD for ; Sat, 17 Jun 2023 12:13:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA7596B0092; Sat, 17 Jun 2023 08:13:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C58FB8E0005; Sat, 17 Jun 2023 08:13:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B47288E0003; Sat, 17 Jun 2023 08:13:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A33C16B0092 for ; Sat, 17 Jun 2023 08:13:13 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7C2191601D0 for ; Sat, 17 Jun 2023 12:13:13 +0000 (UTC) X-FDA: 80912129466.18.618F445 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf14.hostedemail.com (Postfix) with ESMTP id CA115100015 for ; Sat, 17 Jun 2023 12:13:10 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=K8nDBzg2; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf14.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687003990; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MKaOCCzXJedIVdLsu0rWphyHTQRA+RfNYbfx/yO3kzQ=; b=0IuzMmZg4pOXEfA86rvVR/nPWofRipw72J0bCzkRkGZ1UyeZDgCKdR9CGjMILXhVpc1nuQ +UIbGGwmLUNCGWhu2YsDbbFEJnnU6Qh3+hqW2BLEQAIdOsFEAv2cEpJOdWi/jS9qkPD5LF Icki8pRiwgT4PVnJd8XhAr4DqfmH6hw= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=K8nDBzg2; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf14.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687003990; a=rsa-sha256; cv=none; b=onlitGAy+qxFR4Aba4AX1w6nUSUaD8IQDk5x3pbwfqs55w21UQOU6Yy+w0rPAsEod11sd5 xy7DRi7567hkp3AwQM6ono+rYWbLgElzsMWoMGncyXp85IFdnIzaXvp5uGRC1Hdy7qHPM6 bmdgJ0Lop796WwxM0Fd78HfOVjvWTqE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687003990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MKaOCCzXJedIVdLsu0rWphyHTQRA+RfNYbfx/yO3kzQ=; b=K8nDBzg20KRBLH5UC6LSP2LZf5p/X2GPAyQXq/knxVSAVzRZqyHr9/q4O14X7KnHaOIdos BMQ57ChdUQwOqhTGSIzhITbw708eUxl1LpEvxs939ygGfgxtAYubDRHqRcF7l5/kbcG6S6 sYySFbUC2QZ8Svkq0l6r9lm2sK4bnaA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-557-0frgcycTO9ec3FXSZq0ViQ-1; Sat, 17 Jun 2023 08:13:03 -0400 X-MC-Unique: 0frgcycTO9ec3FXSZq0ViQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 687B780006E; Sat, 17 Jun 2023 12:13:02 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id 422AD1415102; Sat, 17 Jun 2023 12:12:59 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , Alexander Duyck , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Jens Axboe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, dccp@vger.kernel.org, linux-afs@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-can@vger.kernel.org, linux-crypto@vger.kernel.org, linux-doc@vger.kernel.org, linux-hams@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-rdma@vger.kernel.org, linux-sctp@vger.kernel.org, linux-wpan@vger.kernel.org, linux-x25@vger.kernel.org, mptcp@lists.linux.dev, rds-devel@oss.oracle.com, tipc-discussion@lists.sourceforge.net, virtualization@lists.linux-foundation.org Subject: [PATCH net-next v2 17/17] net: Kill MSG_SENDPAGE_NOTLAST Date: Sat, 17 Jun 2023 13:11:46 +0100 Message-ID: <20230617121146.716077-18-dhowells@redhat.com> In-Reply-To: <20230617121146.716077-1-dhowells@redhat.com> References: <20230617121146.716077-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Rspam-User: X-Stat-Signature: fbmekseo9yb5ixsshubpxipmhkep7w9t X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: CA115100015 X-HE-Tag: 1687003990-881885 X-HE-Meta: U2FsdGVkX18enjhB4ykcP7wdmndu4DFE5AznL19Og/j/iiZRePhAGAsmbd2KMxpbKJ5ojItua0+68cbREecEWrCwV2D/zko50SCHOkE50gY0zZWThf1tmTj3pwf4GDe/f3G4mjUuMn+SiwdIEyHT3xju0opNq5hG3Jr272rX7Y1tJdAKTRh+xlz6sSP6NjgE5KcnK0/mzqGBk+o7rlxdalpT7xDn+k3NKR6Hy8RNRb+bsT4gn9eERyAk1YydSCCjlF8/96U3ZgbWL6bM5e1iKsUN9xMPCJni2uzQRlOMyCcAWFZNncAmZRGy3XUs8RevFDSMsNbTqhh7czGO4McplcJ3gSZmalNxH3imoJ7sYUgUHIcFg0MzuogO/BXHAJ4aufT+KaCa0xrqsrq2FytMg94K+LT3BfP3GUq+qTNIpnBd8u3Ww9u9yAKq+aS8L8VaVSylD4xSxLnJFIIUjK7Wm22pydOJtBi/eKbP/xHBOAAG+xNtHASY2SAtNvPmxHQP2Rs8/T8nBYVCJHO5sMCohTyY6L7YEKVApETJqJNqqqiOkUpojh/WJPG7AjWR/AKPvyjcE3wnBf5msnGzq7uybnKhNjwMatGrPTv+/QuY2TKNOi25n7roslAyXM8Z7i5D0UxXHp+gGIIBU+Iv/DK5af5Ep3eumIoYBPnGL/OUOjf13c4l3IQm7kBF59WKLoQOhAMH7uFsapH4T4I5Ao+W1x9vNNFWLRw58B3Qd+0N579XEgC8zdq5ah2QHC8jc97cUKYAkJvjVKgJdu5zNa4Iax9MGMA4UGsWlCsat2kplzCyHzovX0Stlj/wilnmLCoKMoCrABGumUj1CSBUiDqM3u3qdrt8twXGrONdPnMxzvIYlRzM4FTVMEhSR+4kXoMhV0uVxSatHmBwiSAhdDb0e4XCWH/Hfnwxb+g9IFGgCnxUk9LCZY82ZaWym0bAEkT/81e2oO3gCtB0LWhqRIp LX1Ei5nb /x1a2WunftsKAaYsbuEGQw6ywR6ZxUqJGGGcqCERoes2Xfu6YSG6f700jwxPIKTY6CUayLcHRtZTvqEdUDkQtmMOMRENql3TQNiUAUllpcRl3WNZRsbCCK8zluf0t1Au8WfSSG9TYkt2jDp+6XLbyttkrGrBJan576GtW0t/+00RYh2HOOKw7ZYcjjPoo612OBwfDG5Kr+WVC+vPXusA23L6YLG5Sv6OlCON9IGxtEYjSKHJmr+pmwCnsikEydsZ+Egz+sayGiyy1J9rCdvooe9g83dzQDyNTcXWG7NDCSl3k/K86g+dfpNpjPHaqucrfOQv+l+AopNfrVp1+579eNrdcsoiYZJSqQZAdVoe5PxuGsEIxzJZTDhvmMBWW74TP3WqMlHpXDarBZD4tmW2LM6A8EYmT/YHJac9oRjGqjcqwiPLXFFCrKNgPk6ytvzmUIg/WK6PaEu3ZAwdoyTc9p9jE2LZ/s0PwGXRC5p++DFoJfhsFZ67mRT6RkgQ3ucB7SwQ+SBjVBaQDdqsgXZWTM8+hlaabxBJnXqfQgD0jLRYPu7wJcfVLFRFceHwXXY0vQScKeRKxcgV+zX3McJyIQTQJaotEm6A6N8lV X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Now that ->sendpage() has been removed, MSG_SENDPAGE_NOTLAST can be cleaned up. Things were converted to use MSG_MORE instead, but the protocol sendpage stubs still convert MSG_SENDPAGE_NOTLAST to MSG_MORE, which is now unnecessary. Signed-off-by: David Howells cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: bpf@vger.kernel.org cc: dccp@vger.kernel.org cc: linux-afs@lists.infradead.org cc: linux-arm-msm@vger.kernel.org cc: linux-can@vger.kernel.org cc: linux-crypto@vger.kernel.org cc: linux-doc@vger.kernel.org cc: linux-hams@vger.kernel.org cc: linux-perf-users@vger.kernel.org cc: linux-rdma@vger.kernel.org cc: linux-sctp@vger.kernel.org cc: linux-wpan@vger.kernel.org cc: linux-x25@vger.kernel.org cc: mptcp@lists.linux.dev cc: netdev@vger.kernel.org cc: rds-devel@oss.oracle.com cc: tipc-discussion@lists.sourceforge.net cc: virtualization@lists.linux-foundation.org --- include/linux/socket.h | 4 +--- net/ipv4/tcp_bpf.c | 4 +++- net/tls/tls_device.c | 3 +-- net/tls/tls_main.c | 2 +- net/tls/tls_sw.c | 2 +- tools/perf/trace/beauty/include/linux/socket.h | 1 - tools/perf/trace/beauty/msg_flags.c | 3 --- 7 files changed, 7 insertions(+), 12 deletions(-) diff --git a/include/linux/socket.h b/include/linux/socket.h index 58204700018a..39b74d83c7c4 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -319,7 +319,6 @@ struct ucred { #define MSG_MORE 0x8000 /* Sender will send more */ #define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */ #define MSG_SENDPAGE_NOPOLICY 0x10000 /* sendpage() internal : do no apply policy */ -#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */ #define MSG_BATCH 0x40000 /* sendmmsg(): more messages coming */ #define MSG_EOF MSG_FIN #define MSG_NO_SHARED_FRAGS 0x80000 /* sendpage() internal : page frags are not shared */ @@ -341,8 +340,7 @@ struct ucred { /* Flags to be cleared on entry by sendmsg and sendmmsg syscalls */ #define MSG_INTERNAL_SENDMSG_FLAGS \ - (MSG_SPLICE_PAGES | MSG_SENDPAGE_NOPOLICY | MSG_SENDPAGE_NOTLAST | \ - MSG_SENDPAGE_DECRYPTED) + (MSG_SPLICE_PAGES | MSG_SENDPAGE_NOPOLICY | MSG_SENDPAGE_DECRYPTED) /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */ #define SOL_IP 0 diff --git a/net/ipv4/tcp_bpf.c b/net/ipv4/tcp_bpf.c index 870c1cde4010..8f535e436ea3 100644 --- a/net/ipv4/tcp_bpf.c +++ b/net/ipv4/tcp_bpf.c @@ -90,7 +90,9 @@ static int tcp_bpf_push(struct sock *sk, struct sk_msg *msg, u32 apply_bytes, { bool apply = apply_bytes; struct scatterlist *sge; - struct msghdr msghdr = { .msg_flags = flags | MSG_SPLICE_PAGES, }; + struct msghdr msghdr = { + .msg_flags = flags | MSG_SPLICE_PAGES | MSG_MORE, + }; struct page *page; int size, ret = 0; u32 off; diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index 840ee06f1708..2021fe557e50 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -441,8 +441,7 @@ static int tls_push_data(struct sock *sk, long timeo; if (flags & - ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_SENDPAGE_NOTLAST | - MSG_SPLICE_PAGES)) + ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_SPLICE_PAGES)) return -EOPNOTSUPP; if (unlikely(sk->sk_err)) diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index d5ed4d47b16e..b6896126bb92 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -127,7 +127,7 @@ int tls_push_sg(struct sock *sk, { struct bio_vec bvec; struct msghdr msg = { - .msg_flags = MSG_SENDPAGE_NOTLAST | MSG_SPLICE_PAGES | flags, + .msg_flags = MSG_SPLICE_PAGES | flags, }; int ret = 0; struct page *p; diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 9b3aa89a4292..53f944e6d8ef 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -1194,7 +1194,7 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_CMSG_COMPAT | MSG_SPLICE_PAGES | - MSG_SENDPAGE_NOTLAST | MSG_SENDPAGE_NOPOLICY)) + MSG_SENDPAGE_NOPOLICY)) return -EOPNOTSUPP; ret = mutex_lock_interruptible(&tls_ctx->tx_lock); diff --git a/tools/perf/trace/beauty/include/linux/socket.h b/tools/perf/trace/beauty/include/linux/socket.h index 13c3a237b9c9..3bef212a24d7 100644 --- a/tools/perf/trace/beauty/include/linux/socket.h +++ b/tools/perf/trace/beauty/include/linux/socket.h @@ -318,7 +318,6 @@ struct ucred { #define MSG_MORE 0x8000 /* Sender will send more */ #define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */ #define MSG_SENDPAGE_NOPOLICY 0x10000 /* sendpage() internal : do no apply policy */ -#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */ #define MSG_BATCH 0x40000 /* sendmmsg(): more messages coming */ #define MSG_EOF MSG_FIN #define MSG_NO_SHARED_FRAGS 0x80000 /* sendpage() internal : page frags are not shared */ diff --git a/tools/perf/trace/beauty/msg_flags.c b/tools/perf/trace/beauty/msg_flags.c index ea68db08b8e7..b5b580e5a77e 100644 --- a/tools/perf/trace/beauty/msg_flags.c +++ b/tools/perf/trace/beauty/msg_flags.c @@ -8,9 +8,6 @@ #ifndef MSG_WAITFORONE #define MSG_WAITFORONE 0x10000 #endif -#ifndef MSG_SENDPAGE_NOTLAST -#define MSG_SENDPAGE_NOTLAST 0x20000 -#endif #ifndef MSG_FASTOPEN #define MSG_FASTOPEN 0x20000000 #endif