Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp835539rwd; Thu, 18 May 2023 04:48:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pKQefdlCqHpsWOva4TKPqGGbapeZMMbrqOBp47KRGulf9yZ1bUsbz1sspDZ186M4fghGj X-Received: by 2002:a05:6a00:190e:b0:643:558d:9ce2 with SMTP id y14-20020a056a00190e00b00643558d9ce2mr4088063pfi.21.1684410509116; Thu, 18 May 2023 04:48:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684410509; cv=none; d=google.com; s=arc-20160816; b=ABdndSdPPf8ZPZD9YOLR+EQSuy8I3UkDxsDd8KqRNh4r40wQkcv/VLw7v1zmGUgSL7 /1zfqeJDSPrAYGqI7bnWOstm2tas2AvBtafYHTkwXpMhfygo0n9Bi097dczWMkjesi9R tIxItMQPRwpVeJG2kKnXMcBYxKI/ILOrIQLHOhqJ8ezhAkv4ougdD/fW7X03APxbX5es 4rNF2UbdEdaPXeCZ3KqS+w13N58IB6sPw3ymouV5UJNdZ3v8YAH+XcsQWAjrz3cxqJ6h m8OA/97dmrhUKR7FIQeN1ZlRCfwgMPQgNy4LuYP2ppH+6hdiGrjJOkwKUEJwk5Aan2WI rbAw== 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=BE+SuEY+mLyGcSXbjApmWoOVKnEyxWSaci3Pt6N280mO7k1WdusrNjp7fct80RuGZ9 ktbVGxjUK302Wp4tI3NpeDgkGDUk1xoZkdWrFG/66E18l96RMwzEpxSN8Uovura8HXTm U5hPdMLo3ajg2FBfqEzAZiJRchDDs4SwSBc24DS1zpBpioAPljUDgQaauMBEypJ2xJ/K DSc0fmMqbgDiIYfXB1pnrWdvL4Oa0IiJvJqj06feEo/UzGMxmaxHQ8PLj2RQk0fMJCX7 VM88/LCJS/d0KdhHI1sreauDmVYJQWq/sWQnAZFGGMyCE2kkQst/1rb9q20FG/5ukEAg Dn6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IkpdP4dY; 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 a16-20020aa78e90000000b0064140b05b6dsi1443551pfr.228.2023.05.18.04.48.13; Thu, 18 May 2023 04:48:29 -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=IkpdP4dY; 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 S231460AbjERLg4 (ORCPT + 99 others); Thu, 18 May 2023 07:36:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231392AbjERLga (ORCPT ); Thu, 18 May 2023 07:36:30 -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 6167C1A7 for ; Thu, 18 May 2023 04:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684409738; 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=IkpdP4dYySEBDFP3NmdBkEPmbop7YFSufs50b6Qepgd+hJPxvCq+tGwbuNQE4iOxh9EVCa bXY1c9ycz85dxWDOBmiM6095FIj+gSbXevzZ0ve70uCFDgO6NRnekG/zDtxwu0FPVEmMkD JLe/EpN4CqtEYN7a8QT9VIE+C0yhU4A= 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-214-HshzOJ6CNxe9-YY1obDoFw-1; Thu, 18 May 2023 07:35:35 -0400 X-MC-Unique: HshzOJ6CNxe9-YY1obDoFw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 724DA1C09512; Thu, 18 May 2023 11:35:34 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id E91B3492B01; Thu, 18 May 2023 11:35:29 +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 v8 07/16] espintcp: Inline do_tcp_sendpages() Date: Thu, 18 May 2023 12:34:44 +0100 Message-Id: <20230518113453.1350757-8-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.9 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=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;