Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp828871rwd; Thu, 18 May 2023 04:42:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4zTgNjgSzPtD1WMphOmJa44+K1RbxAVcCx18xOhlC/xX5MSvuzH9zp8yz5aaSQOlfnbpUA X-Received: by 2002:a05:6a00:138b:b0:64c:ecf7:f4a4 with SMTP id t11-20020a056a00138b00b0064cecf7f4a4mr4833973pfg.24.1684410119892; Thu, 18 May 2023 04:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684410119; cv=none; d=google.com; s=arc-20160816; b=dYX0STufhCQr8MN/fpr67hfp0rJ7h0jxVXRj3avrtXv6lumtCI7jAxstM6orjZvt/m yh2QFk3wmvrg+amsoZeAcDtHml+fsMsE1LXYue01zgq2w1QrvxX8jLmTxAK+ij846lND x5gh4WBJgTtnGKr+B9SnLYE/ASyykmswn8Hh6i5MVOx5T+06p+sWY9Pi/gEd2R4MC8Sj PfI27KNQcorTBvO3YgyroWwc7rOBjGYu6x+hsMtS+nvuJMkxTMlTkWcW1GBMCV6bNEJ8 KQZI/EoeNHpS+bmqJrd1+V2GpxlyId/n18BgNrUWyFqzYkgAGaHXCMw1dOjzBQt6LhFr MIqg== 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=enBN5jT1muKlfAJKNsWEtZoec3VPKG1S27Z+IZtkOMs=; b=oJy0dXPT8ARNmVtsW05NfMgdnxJUEyxPvi25UkHlYGLG9Sf2+P9zh6lQc2XBZ24T1I 7b2OF/VzHaGkTgFG2CKlTabr7ZXUz3KciqJpD60S88BqQ1oUQrFtirqA+ivKj55k2jSX FFzrPxsFe7W3fE41/u3AgLv+eRgVjDbHlIxOwnjOQ7pDQTHEOLFKAKFefKM4b+4p6pN/ 0OZvB9C5O5MKd8q5uO7k1NqiRXkJYdW/RjKnO3Eovo/TFqtZts4DGxziRQNzS3Np+fQo j1xeCx9cJ27dqS8nKDH/mBaA54nicAx/NfUwHz6mC0Mn+NjAl5j0xRIS6omh2770fS7d ueUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=C+fVtVmO; 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 k82-20020a628455000000b0064cce1b7e11si1534570pfd.251.2023.05.18.04.41.44; Thu, 18 May 2023 04:41:59 -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=C+fVtVmO; 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 S231445AbjERLhd (ORCPT + 99 others); Thu, 18 May 2023 07:37:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231437AbjERLgq (ORCPT ); Thu, 18 May 2023 07:36:46 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC68019B4 for ; Thu, 18 May 2023 04:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684409755; 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=enBN5jT1muKlfAJKNsWEtZoec3VPKG1S27Z+IZtkOMs=; b=C+fVtVmOFxo1nHGvgoXlMjwJvKN9Lyb8vDqBijHVjGjGMCdyC6pdG4AjW3hoy0hj0Twayn ySk9De/CjxZEPhZ1wC2xTCBYC1q2DOoPxlt6Y8RHpI4Qw9BeBTwlQOUMa2MCOhOyDeJdOD /8enmPdUjgFMxuzm4t48fzRp+cB5N3I= 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-669-zHr-wG-8MFKIw9HgrsEr2A-1; Thu, 18 May 2023 07:35:47 -0400 X-MC-Unique: zHr-wG-8MFKIw9HgrsEr2A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EAFF61014702; Thu, 18 May 2023 11:35:46 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id DADA640C2063; Thu, 18 May 2023 11:35:43 +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 v8 10/16] tcp: Fold do_tcp_sendpages() into tcp_sendpage_locked() Date: Thu, 18 May 2023 12:34:47 +0100 Message-Id: <20230518113453.1350757-11-dhowells@redhat.com> In-Reply-To: <20230518113453.1350757-1-dhowells@redhat.com> References: <20230518113453.1350757-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 04a31643cda3..02a6cff1827e 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 28231e503af9..5e4752131583 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -974,12 +974,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); @@ -988,18 +993,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,