Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp978177rwd; Thu, 18 May 2023 06:32:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Jv9OXv87+EzI2VJKrTn51s5HMGufdF6CJmnkkupQWnrVBblOyiZMRXC8GXn51LRQaCU3F X-Received: by 2002:a05:6a20:9c97:b0:104:873:c3cc with SMTP id mj23-20020a056a209c9700b001040873c3ccmr2311205pzb.40.1684416730636; Thu, 18 May 2023 06:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684416730; cv=none; d=google.com; s=arc-20160816; b=tZXRVulXny7YDiJTtCBaTihm8CnBR3PeflYEWtGL8SRZ5N2ioY/ULRAa89V92yujJr P3x4CTHOYdqB20z1dNFPkhnWJlUuHEU3kAayvL1S9zTjhDPFciLAxmilPSCzVV57JWVP JugjPz0gst7y/4MZV6naKB37wHb0xwCdBNzYYrfLv3zclQmUS0aB4ilRqcdHCNTRBpof iFag9AjjrZA/f6gcVctwPsbk0vAD0ZgmNFSj97JRT2W0DTYas6QeQEJxXBHeqF3af5Wx tZwEnVz2jJDF07j8yY+bfFruX6U4yFg3kngm6SyWkmYj5ls8n+O8gCw7Ch4mvzLAmXKu DqPw== 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=QHPlrHM/OJ94XeIJ/yX1kIHl8d17f7h0nwxsKLvw4YXc1Pu9ywUTy/0DrwqLDKOPsL M15x1yxmNc1LA71Axnv4RNx8Ui0W5tWIsCiOUgWMmtidIzOLUSZ0SWPkn676Tv2Lw1YP OuGp+sdK9VkKzmrDTWvPR7wxNmoOXdkTzOniufk5BA05/w/AP/0gkh8/ulYjzsYLch+H tkZwVmSkGsMWaVh+YqLAPmhqQ4UwnuxJ1dfPje0txxG+RDp9TwzEq1nn/CHuWttq5/Bz pMXV5PkuRMsO4jRHZs0iDNF2KiFPJBm/Fkm9/NK8+6Ci9hprR75UluH1uAacDY6cQsvi p06Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KMNieTEP; 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 j190-20020a636ec7000000b005023e0f160dsi1468565pgc.489.2023.05.18.06.31.55; Thu, 18 May 2023 06:32:10 -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=KMNieTEP; 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 S231393AbjERNJ3 (ORCPT + 99 others); Thu, 18 May 2023 09:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231265AbjERNJF (ORCPT ); Thu, 18 May 2023 09:09:05 -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 70A25172D for ; Thu, 18 May 2023 06:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684415278; 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=KMNieTEPSx2wiKDuDJljpaXJ601hrQnO096t8JplIZmBf7dE2GxpQ9KsLi/JYRAwsmIoYi OwwY2hAYcnEehDlRy9BZ4MyHtkfqQaK8n5etSwD4+QlKpgJcFCyUaa25woVWfFaHSA/EiT mx/zvn4x21qVtW0Mi7hpn+9i9encr2A= 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-539-6BlD0X51NFmY4rfARQLhyQ-1; Thu, 18 May 2023 09:07:53 -0400 X-MC-Unique: 6BlD0X51NFmY4rfARQLhyQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6BC7328237C1; Thu, 18 May 2023 13:07:52 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14D062026D16; Thu, 18 May 2023 13:07: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, Steffen Klassert , Herbert Xu Subject: [PATCH net-next v9 07/16] espintcp: Inline do_tcp_sendpages() Date: Thu, 18 May 2023 14:07:04 +0100 Message-Id: <20230518130713.1515729-8-dhowells@redhat.com> In-Reply-To: <20230518130713.1515729-1-dhowells@redhat.com> References: <20230518130713.1515729-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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 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;