Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5732918rwl; Tue, 11 Apr 2023 09:13:20 -0700 (PDT) X-Google-Smtp-Source: AKy350a0AwFOjTGqFbtwOJ2QpWmiH1m6IyI91X3rAUprMogG/IDeowyWFPL3s+seojZwr0z19Zd2 X-Received: by 2002:a17:90b:2242:b0:233:f394:d83 with SMTP id hk2-20020a17090b224200b00233f3940d83mr13305249pjb.48.1681229600676; Tue, 11 Apr 2023 09:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681229600; cv=none; d=google.com; s=arc-20160816; b=K9M18FwBhKExfN6v7vO3A5aAHXRiV7yx8tHE11cGqOJLZJ9sS1pluRyPwBOukOgfkl 73YyC8RVXoxRxJsBXiIbMBYXc6d7nrCSuB45bYVL5wCN7jKmn+LIFTYMcD8lwdjHhPME kEHo5yqMtktpyCmYZkLY+51HNxO2VDpyUg3OOqjcSFZ6d+qMEmBlh8UVFqc04B2seM/R oNFFzG6HClDtgEV6jX9bxet0ZoaHY7/7o1o/4kV0Em2BxE0/lvXNdiNxfTWAolQh8IOn zGMyWux2g181U3qxBWf7MTz2bymv0EQSHElnwjuOgWGA7IYtTFmMECphD3/CoK8dOH2W pR3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WkdEEEXdr/3qYwqcKdd5Ao06l5CmC0hih/jlnjAFNWQ=; b=FC+GGFyGIlpDZPslSCl6OdDacMEx7WU6OYsaNws+9m6I7GwFiONtMlJpT2nUQ3YMVa RAUOYA5eBQTtRbCrwTTQZisd27SBrxUXz6njTe8Udk783bcxiuJm0gT8j2mHuJecUmhL K98ao0qLGAymNl8RSPef1Arajn6yhryaRnI4WuTG+pDqFe4O6CL0z4YM5/SVdyQ7nYlw Brb7HqRNa0EWfj5VNaY7sM5HImL515sFoIuz+73Nqv2lqyyBysC07ME/C64PgdZfuFun 72RG67yP/14qiuIhWd3mqkWZeSsbqEwTDlFauHbW+OLOnWbCpI+E9QHPD4vVoZJKydcO vQvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DtlGfg7X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x13-20020a17090ab00d00b002465a26ba49si10664150pjq.149.2023.04.11.09.13.07; Tue, 11 Apr 2023 09:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DtlGfg7X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231124AbjDKQM1 (ORCPT + 99 others); Tue, 11 Apr 2023 12:12:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230493AbjDKQLe (ORCPT ); Tue, 11 Apr 2023 12:11:34 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A80E46AA for ; Tue, 11 Apr 2023 09:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681229402; 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=WkdEEEXdr/3qYwqcKdd5Ao06l5CmC0hih/jlnjAFNWQ=; b=DtlGfg7XGsw07Ep+MUgBIyKBGjyydmMa9Yb+503Yvw6LWre8HdHnC9GlzAm/okY+q5vuQg l/nVSbiLLmwXMPIbTN1f+qM641O7on8MYKUiojcfLCuyQNQz19pcs0Aw8HVlmsBSNa1rov ykin/u+UlfI2Z02Lti3MGPgQiEUDPws= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-74-AxOMgkEwP0O6PEpafr2joA-1; Tue, 11 Apr 2023 12:09:51 -0400 X-MC-Unique: AxOMgkEwP0O6PEpafr2joA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 340FA38149B1; Tue, 11 Apr 2023 16:09:50 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1948C1121320; Tue, 11 Apr 2023 16:09:48 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Al Viro , Christoph Hellwig , Jens Axboe , Jeff Layton , Christian Brauner , Chuck Lever III , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH net-next v6 13/18] tcp: Fold do_tcp_sendpages() into tcp_sendpage_locked() Date: Tue, 11 Apr 2023 17:08:57 +0100 Message-Id: <20230411160902.4134381-14-dhowells@redhat.com> In-Reply-To: <20230411160902.4134381-1-dhowells@redhat.com> References: <20230411160902.4134381-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fold do_tcp_sendpages() into its last remaining caller, tcp_sendpage_locked(). Signed-off-by: David Howells cc: Eric Dumazet cc: David Ahern cc: "David S. Miller" cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: netdev@vger.kernel.org --- include/net/tcp.h | 2 -- net/ipv4/tcp.c | 21 +++++++-------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index a0a91a988272..11c62d37f3d5 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -333,8 +333,6 @@ int tcp_sendpage(struct sock *sk, struct page *page, int offset, size_t size, int flags); int tcp_sendpage_locked(struct sock *sk, struct page *page, int offset, size_t size, int flags); -ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, - size_t size, int flags); int tcp_send_mss(struct sock *sk, int *size_goal, int flags); void tcp_push(struct sock *sk, int flags, int mss_now, int nonagle, int size_goal); diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 0187988514b1..8f39e6024768 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -972,12 +972,17 @@ static int tcp_wmem_schedule(struct sock *sk, int copy) return min(copy, sk->sk_forward_alloc); } -ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, - size_t size, int flags) +int tcp_sendpage_locked(struct sock *sk, struct page *page, int offset, + size_t size, int flags) { struct bio_vec bvec; struct msghdr msg = { .msg_flags = flags | MSG_SPLICE_PAGES, }; + if (!(sk->sk_route_caps & NETIF_F_SG)) + return sock_no_sendpage_locked(sk, page, offset, size, flags); + + tcp_rate_check_app_limited(sk); /* is sending application-limited? */ + bvec_set_page(&bvec, page, size, offset); iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, size); @@ -986,18 +991,6 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, return tcp_sendmsg_locked(sk, &msg, size); } -EXPORT_SYMBOL_GPL(do_tcp_sendpages); - -int tcp_sendpage_locked(struct sock *sk, struct page *page, int offset, - size_t size, int flags) -{ - if (!(sk->sk_route_caps & NETIF_F_SG)) - return sock_no_sendpage_locked(sk, page, offset, size, flags); - - tcp_rate_check_app_limited(sk); /* is sending application-limited? */ - - return do_tcp_sendpages(sk, page, offset, size, flags); -} EXPORT_SYMBOL_GPL(tcp_sendpage_locked); int tcp_sendpage(struct sock *sk, struct page *page, int offset,