Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp694151rwd; Wed, 31 May 2023 04:15:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4T28rbqmzW64LnGq7HiYChQBQLRrq5pY1kKOJFEScYwEv2HpXZMAJ553C9AoDrtz3xHW2H X-Received: by 2002:a05:6830:328a:b0:6af:9f77:54c7 with SMTP id m10-20020a056830328a00b006af9f7754c7mr2144864ott.9.1685531737204; Wed, 31 May 2023 04:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685531737; cv=none; d=google.com; s=arc-20160816; b=P+LrVT4ouG6QiCfj5ZZBqPRwz3Lx6i3FWE2Hx2hAAxJJpz9g9JXakOsmlChCJlHdMv H59NwstNOsm7ojzLBfC/590+YW9GahkmlFM//nO/BRIAPLXlg47fxCHRJNStxIiQACk6 Gy0N2hQMhL1RABOXWn9a0drYkaD905wbKCtJu8OawkpOhp0mC6Rd4x6e2cx3fCZNsRf8 WruJjfC7x7XB3mxB3AAJqnOlFxQPz0qf4TSVPbgwQ0dstLphPbvTmP4SBugvSIOTIbRX uEZBe63J87bGxKGo4DNBNOBAYHT7okwtzSjX3ApCB1sGk53EKuo6uOMQ5Wc8bUrU4zHc +RUw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Bz65D2xx0gb4qdpRkIQI3YTwLtyS701r/8WE2ftqUAI=; b=l6wv4peqJ2/SsdKc1nCULiAY0ZBfPi7Ge7nBFm7sPrrfSaC2WkKAAbqFmsXZY5pRH0 kVyFQaIOSKGxCM6q1f/r6dkaXJSuPWeHwnfI9XdzQ0YcRrjMp++IlBeIo79pwFe64jkV /lyZdZrS703m2h1WDxcQnFmQhc3+U+BIOgpwF4KKzwHNdGpg+VobOQu/YpDEhBsWB2d5 vdKhXSsi3mfwwRizHCeSvFQzJOr+zprSIz1nRcHnaDF99yE2mIMYJkSjqe8Lmu3B4qJd aU3vwJbiG0nZW33GFb8rqg0lqqZJtR1RgLuZMZ52HlrurXxAbB9/+l2naFUruEMbJBSE 39cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PaneWmNa; 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 h184-20020a636cc1000000b00530743695d1si792471pgc.665.2023.05.31.04.15.24; Wed, 31 May 2023 04:15:37 -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=PaneWmNa; 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 S235256AbjEaLGI (ORCPT + 99 others); Wed, 31 May 2023 07:06:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232671AbjEaLGE (ORCPT ); Wed, 31 May 2023 07:06:04 -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 62A2AE4F for ; Wed, 31 May 2023 04:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685531072; 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; bh=Bz65D2xx0gb4qdpRkIQI3YTwLtyS701r/8WE2ftqUAI=; b=PaneWmNamdT3Pqo9G6nuY6ysQTT8pZhnOCoIC/DIJlVOow/WqY9a/g2c3qhi6IZ5sPi0/E IQQdzsPIM8CRvtXHF82O7HHVQj3YxH2aLHzHGerlGfcFZig7I86L6AB8EWm2QpJ5TB/r4o yMgQVPmJ3VjQ/+aMLlDfj8m3sF95y54= 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-572-YLiSyU6kP3mOCadzX03i4g-1; Wed, 31 May 2023 07:04:29 -0400 X-MC-Unique: YLiSyU6kP3mOCadzX03i4g-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 640EB1019C87; Wed, 31 May 2023 11:04:28 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A90CC154D7; Wed, 31 May 2023 11:04:25 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , Tom Herbert , Tom Herbert , Cong Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Jens Axboe , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 0/2] splice, net: Handle MSG_SPLICE_PAGES in AF_KCM Date: Wed, 31 May 2023 12:04:20 +0100 Message-ID: <20230531110423.643196-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.3 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=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 Here are patches to make AF_KCM handle the MSG_SPLICE_PAGES internal sendmsg flag. MSG_SPLICE_PAGES is an internal hint that tells the protocol that it should splice the pages supplied if it can. Its sendpage implementation is then turned into a wrapper around that. Does anyone actually use AF_KCM? Upstream it has some issues. It doesn't seem able to handle a "message" longer than 113920 bytes without jamming and doesn't handle the client termination once it is jammed. I've pushed the patches here also: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=sendpage-2-kcm David ver #2) - In kcm_sendpage(), only account the amount actually copied. - Wrap at 80 chars. Link: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=51c78a4d532efe9543a4df019ff405f05c6157f6 # part 1 Link: https://lore.kernel.org/r/20230524144923.3623536-1-dhowells@redhat.com/ # v1 David Howells (2): kcm: Support MSG_SPLICE_PAGES kcm: Convert kcm_sendpage() to use MSG_SPLICE_PAGES net/kcm/kcmsock.c | 218 ++++++++++++---------------------------------- 1 file changed, 58 insertions(+), 160 deletions(-)