Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2839767rwd; Mon, 22 May 2023 05:15:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7LDnz+qHn9DQ95Nw0mtWtkPbDEEqe9KO1gMROH2D2hWyyE0ExL1rOxWPRPgD0HU//iBjGv X-Received: by 2002:a17:903:1c3:b0:1af:bd10:4045 with SMTP id e3-20020a17090301c300b001afbd104045mr1548786plh.6.1684757731832; Mon, 22 May 2023 05:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684757731; cv=none; d=google.com; s=arc-20160816; b=PTlrMf+X6rKzK5s/7j3oflatDVm99RFZ+1N6sQ6jen/X9UUbOU/YAgyietibwuxLbJ fE/9h1GAQtoM9iIcffJ6GkHqXcFD+VXmAeVrpvN/Vl4e9rRhnu854tLxl2elihW/1dcJ P3cNkvMBHt1DkZTvfjbzpq1UR3VZDoWs+LF6fuJ7kqAMmY5oHE1/fZrwgA3znI11WHtx u4Z6ZwPURzyZzgIf17TRbzwzUJhnJfmrYQZmrwStLDExe+feHJswAdN2lgXBhcekJkb/ Ihl5PCCRg0v63vOtIOtjgNVdKsL6pWbcDSQKalHJ+RLWiE/qychyMpYT8voEY0cntP35 a4VQ== 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=tYeoTX9B8dad49qWPHePVLYzX6oyR1jBlVymL6Q5Zsc=; b=aW/KVhcbr2/YYs851lKZ/esWZLjs+QgYL7O/pMSjI2wIB7Sbj2PCTscqpKU5vgVVxi DDnhDny1foOKa64ny/F23eK+Yj3yOIzD0pevvvyVEOATc5Wt5hZ1zRvxhioQuG6dJNv9 2W7k4iTmeUTBmDzn1z7Jx+7acRk5Mo/2L2XEhQ4l9UXL7IeltUF6Oouf7qbzXks2swMG 0WuqF+5KnpOFVjIL1no0nOccyG+MlNGFUqDvlDdeTSahuopjF3wNTDwnefuTzXn+Utia fiLPCAB1ZHBt+hrygvCBzIWUWL8e/t+a0oJFry4uSz9WLavGy9jPT/Kq/V3h8ChtZP8g ekGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U+3QQm+v; 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 v4-20020a170902b7c400b001ae4c3bbb0dsi837861plz.145.2023.05.22.05.15.16; Mon, 22 May 2023 05:15:31 -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=U+3QQm+v; 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 S233778AbjEVMNk (ORCPT + 99 others); Mon, 22 May 2023 08:13:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233469AbjEVMNO (ORCPT ); Mon, 22 May 2023 08:13:14 -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 BD55FDC for ; Mon, 22 May 2023 05:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684757519; 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=tYeoTX9B8dad49qWPHePVLYzX6oyR1jBlVymL6Q5Zsc=; b=U+3QQm+v312ByLRBWyREcfENqCS583v+cFK+oa83ifmyvdb62SuqMx9uS3/FaejO7F+PKC eFTyVYJ2SZsIEG/YYiFZ6Ie1iKYGz/fb/x7EzL75GbQn6O3wgPbit16hd/VUMmXgM3bkZ0 rIMqJw2CoVrCBUoa8bqhKXrhWZBbJSM= 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-329-z_k6b1dFNWyCPfMJlHKjGw-1; Mon, 22 May 2023 08:11:55 -0400 X-MC-Unique: z_k6b1dFNWyCPfMJlHKjGw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 096DF811E8F; Mon, 22 May 2023 12:11:54 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.39.192.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9261C54F80; Mon, 22 May 2023 12:11:50 +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, Steffen Klassert , Herbert Xu Subject: [PATCH net-next v10 07/16] espintcp: Inline do_tcp_sendpages() Date: Mon, 22 May 2023 13:11:16 +0100 Message-Id: <20230522121125.2595254-8-dhowells@redhat.com> In-Reply-To: <20230522121125.2595254-1-dhowells@redhat.com> References: <20230522121125.2595254-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 do_tcp_sendpages() is now just a small wrapper around tcp_sendmsg_locked(), so inline it, allowing do_tcp_sendpages() to be removed. This is part of replacing ->sendpage() with a call to sendmsg() with MSG_SPLICE_PAGES set. Signed-off-by: David Howells cc: Steffen Klassert cc: Herbert Xu cc: Eric Dumazet cc: "David S. Miller" cc: David Ahern cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: netdev@vger.kernel.org --- net/xfrm/espintcp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/net/xfrm/espintcp.c b/net/xfrm/espintcp.c index 872b80188e83..3504925babdb 100644 --- a/net/xfrm/espintcp.c +++ b/net/xfrm/espintcp.c @@ -205,14 +205,16 @@ static int espintcp_sendskb_locked(struct sock *sk, struct espintcp_msg *emsg, static int espintcp_sendskmsg_locked(struct sock *sk, struct espintcp_msg *emsg, int flags) { + struct msghdr msghdr = { .msg_flags = flags | MSG_SPLICE_PAGES, }; struct sk_msg *skmsg = &emsg->skmsg; struct scatterlist *sg; int done = 0; int ret; - flags |= MSG_SENDPAGE_NOTLAST; + msghdr.msg_flags |= MSG_SENDPAGE_NOTLAST; sg = &skmsg->sg.data[skmsg->sg.start]; do { + struct bio_vec bvec; size_t size = sg->length - emsg->offset; int offset = sg->offset + emsg->offset; struct page *p; @@ -220,11 +222,13 @@ static int espintcp_sendskmsg_locked(struct sock *sk, emsg->offset = 0; if (sg_is_last(sg)) - flags &= ~MSG_SENDPAGE_NOTLAST; + msghdr.msg_flags &= ~MSG_SENDPAGE_NOTLAST; p = sg_page(sg); retry: - ret = do_tcp_sendpages(sk, p, offset, size, flags); + bvec_set_page(&bvec, p, size, offset); + iov_iter_bvec(&msghdr.msg_iter, ITER_SOURCE, &bvec, 1, size); + ret = tcp_sendmsg_locked(sk, &msghdr, size); if (ret < 0) { emsg->offset = offset - sg->offset; skmsg->sg.start += done;