From patchwork Thu May 30 13:26:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13680415 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2118.outbound.protection.outlook.com [40.107.7.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AB4017D8B9; Thu, 30 May 2024 13:26:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.118 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717075619; cv=fail; b=O1jTBt2pSGasVrVl6bSoGvMmARY2Gwazx2Lku9pa4c98YBF7Vot0fhXkqg5DQ6dGRAvgjzlsXG8z2+g0Z2yRmCdSpsvYewzMvGPelmp8r7Hh4+CFTepxube4MCIZ+nJ1PYvIp2FqVt01Z2+EqTbDQ0//teuI5AizGpEPxpFH46E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717075619; c=relaxed/simple; bh=QSGoCRYFgQrJg6IAMM2bbx8tqw5acj3fKG9auEmVDHE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=q/gFnJ4EtdwPNuRUevXkri2612E3k/hCqfM4gNYn4GMLFqupAmgoQQp+Fh/3eeF8WZ+a0EKkUsTB4mxpoR6uhqhiRZHAhGCjWinT7FdBVh/E2O+vNmqh0jUWHOYsBSIX5skUffw+psuk8D+7ZQFbBnz1NPHbXMOCA7dhwQH6Rfs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com; spf=pass smtp.mailfrom=volumez.com; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b=VW/h5ZwZ; arc=fail smtp.client-ip=40.107.7.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=volumez.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b="VW/h5ZwZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DSavrcyaD3FwTKJ9w10+v1BSm4oqZ0dW4idNJDeyw+smt0FaAzLK1LNyR5m4vAmY9tCHkFOEKW0w5+z0jOm4cdQOD9o6T5baYtq5X/LAIDt9udEyqXi+ifnFNTKe68764CDTXimPXafoOkpmLtST6cvojYeRdkT6f+Zq5naN5NiPut0/80DKSLmcA2Nk5Pdva0InqQ4UPoxmagu5usV5jnKpJi7PtK5Nfc9a81c1d4RM5VAk4uR+EwetcFmh/tQUVMd273vwjMV4Er+ttVNyLC2j99hnS2T3kKR69g+0RadlWkLczc42eZU7xRC7PLF86ZRI1iXb+NDOTlo7MPNJfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hVkNhCbaBeqVcXtN8qAwX3C9rNtmax2JJ1CKS4eYr7E=; b=TeC2+QFDVKwYm5id54PiSYLDww+vxqVtIJIVe6gSK6AgpCVMhyB8eDf3PY1zs0jtrX32QMQkHqRXNg8CTMw5G53U78fOJJrpGUZddz1SzGwGp5WhTqYaCP45eUd5XG/QDjUMMiuZ9Hah3dfRPal9o0R/3x1PX88ae0/iNJRn5qVeMAaq4VmaexLkxh+KqYP+fj1zvX6FuKkOoA8litc21cumEnvwlmkp3ovmCt5IFoZLvYI0TknzHEDM8tyfOqb23j8JiWqAoMhXuC1/2fePkvt0sD6vj6Z/nQGrSLKtnqX0z1E3kD8GqycdTZ2KJHirYmlr8ONgFCCyrjqsP8R7AQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=volumez.com; dmarc=pass action=none header.from=volumez.com; dkim=pass header.d=volumez.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=storingio.onmicrosoft.com; s=selector1-storingio-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hVkNhCbaBeqVcXtN8qAwX3C9rNtmax2JJ1CKS4eYr7E=; b=VW/h5ZwZHOOU6z0w6csaz7Rz16A5Mv2dcgSqnJ8/84R8sa++bA6Bvw0a6NbOb3nqQXXdiSqo62Blto/0d4ypa8jNn5/jPO4Uwd/RkgLrtfs39fjCCOj7DEd6PhcDaXyBxwjSIGFRe55FbNN5H2Gl+rrwETP7Dq4OaQyOObjCZxa8Xsur/nKW2HdDOE55O7PKvbvhO7pleVAgMKhSWSCFdy5kEZE1fyaFA/SMwn7WqBV4k3LMoqteYZUhdVkLjhakYXd0tJ8r+ZbQ47ypAlT77y7D3z1RpUV5GpxO89puSJ2845tPCEOIQHm49/RXcV02t/rp5KhAYbNo4O2g4ZhsvA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) by PAXPR04MB8814.eurprd04.prod.outlook.com (2603:10a6:102:20d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Thu, 30 May 2024 13:26:54 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%3]) with mapi id 15.20.7611.030; Thu, 30 May 2024 13:26:54 +0000 From: Ofir Gal To: davem@davemloft.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, ceph-devel@vger.kernel.org Cc: dhowells@redhat.com, edumazet@google.com, pabeni@redhat.com, kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, christoph.boehmwalder@linbit.com, idryomov@gmail.com, xiubli@redhat.com Subject: [PATCH 1/4] net: introduce helper sendpages_ok() Date: Thu, 30 May 2024 16:26:23 +0300 Message-ID: <20240530132629.4180932-2-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240530132629.4180932-1-ofir.gal@volumez.com> References: <20240530132629.4180932-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0005.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:2::15) To AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB5107:EE_|PAXPR04MB8814:EE_ X-MS-Office365-Filtering-Correlation-Id: 039a2b5b-8882-46bc-c721-08dc80ac2c5a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|7416005|1800799015|366007|52116005|38350700005; X-Microsoft-Antispam-Message-Info: swQtvtdekMQTTcj11CrkYkEw3cSQTMR/IYXIZo4BcM5CyajsTJnbX/+BFhavnK/h7lZ8oMYutQw1CQ6fr2zIAYSRLt3+jCd6LOBVSsLOhGdxgJkRmLYByZFf6GJNVMqtDcwvBiaW01UWGQctJdcFIi3fFx/O5ZVCfx7aGjKcXq1VXZb6CYb6l4kzvRxWAjmGyi4PCdoVpQYzAjNksaBFknTG/OYhUE58OOZWqLVSF7d2Sj/6WC5DatQ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taLthHR+3iBz23cgGprrTw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB5107.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(7416005)(1800799015)(366007)(52116005)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3nzIss3r3wKn97ZdVvNelLJBDBgwKfItRPlnNyKl/eTst43HvTOccOsq6tPK9vE5mfgLe/UGQ9nBHepxYLO9u98N+srsHIcdr1/lvfIPt7S5yN4mrjqLhMLVoRhWL8maozKsG+5LOjQJS5WnBCps+zbcPQ9gQxJlm/MK3diLiRwWExa7aZmwK+rxmrce2+rBct60ueTz1JT/AZhVDbzgZqj4iq1jZweGVvBWanUB3ZhKLIUPM1KVglBdI46OsWGS1eyvsWK3N0EB6epEj/2rnaEG/i22nV6jiEK3ztVoGTaW/dPlMVpMcw0ilSho/ioZzPyY8nSocOHvzcPetV78tBqYy3acHeOM7f/LgOFTLAxe4SZvGH+AeGaCOojXnXrnYU+rnKkD0eiatBbQQMJv7IDngGceuGMmdc6yPdASyr9eC44WQaz4hJOMcGflyXhyxnKcFYBSRIjCkO1YDbbpnX3DuWLbZE8w5Dgm497qc7gixLAmiGND0/rhgqZ/HIFH0X1feaGGzq7DmUPObLKOEVGeoYQ8loxjrORc54CVseKrCe3mH3PcKBkIMvAQIF70F7W34iL4Zncb6RKh20akrB5QklNc21HmHTKZJnWHBmkEBG4xFJms3vovJGvTRrEqsUfr1awcLTzrH1OzEBy4pUiUhja+fbpgcIwRpH+F+7s8GheGGATgug2jWtf3iNqBUuAvzyHwYALHUY2YMsanieQyJXXY8Nd1x3gvSCOtnnlJwMjqXhYNjVfUX83PHI7gERZQyjqfl2P7SnOqAZlXEIe86yxymBqo/g27mOaNHVYoPLNBTaqZkQ5vEUxpeq5f5OGKfkplu6oYwNhUuTh/7Qq6mIO9B+H86BAtE3EGZ5OfvvnxtHjYGgA7h4BFfmkgcdrdpzvECngQOgN1b5G4NZ3sHk3X7YPhlnTv5Y2D3GEFkbO50T/9gIjBDrL9yqg1uck1W6i0PrP2t4B1QF/D8nFrq5NMUuOE6GSQqa3lHdB1Io1GT3HdCipDro+OJLeOllx6KM9+v9X8DLMkGMkJKqzl55CZTW6v4kpq9bcgudnS9tO4VO7P55QZgWsKI9Q4pe/a6TTl2uxTzl4mO2h6XDj/FJaji9zmAajspVTfHarcZB9KAnr0k+pVyFEy4JIpvh53BeCqqoI6kogne7M9xDmRAKPOOO0ogM+RXChMCxULV7XiO6mo0x9/+XuJCpNSqlVODWMSsgZOA+IlHVWmKHPxIyrPRTqmjm6Iv1a54SWO0DziN0Nev8oRg0zyv/I3XAVj1fltQNzSScdC8IJEUJP6Qv8X8twNW3TTqE/5S8OIJEo5zBrP1W4l/2v3afu8IslT6gkl89NtKLfdtoybcsxyBfz6Y5v4E4CZUPdnYvI42BDJ1eEQqxjJz0tV15J+cCBlfmY/k4xF6zd2Ls8bh7aolAFRzMv8Lh2BD/4rCtdNzcl11LmYvd9cNBc8zbdfwS18/JozmXvTBMyxVL9rN+CN9uC4eY9rJB+o2ANwSxNMhxtdSKpbgwUxe0OTeFrHE6hKYIgGGYEqNuPJg5TKqKHLFRvfym1ldTM2ij0kXeNKy6/eEjHNKrJeanSqqIKd X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 039a2b5b-8882-46bc-c721-08dc80ac2c5a X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 13:26:54.7451 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b1841924-914b-4377-bb23-9f1fac784a1d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zj7MRMDngnb7I8EHaG981r9nUzpAcqZbVeDH1gqsfZZ5Mg+S8b+yb2gYAPpTWeWdCJTDKFVZGgyMJ+cD13MeGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8814 Network drivers are using sendpage_ok() to check the first page of an iterator in order to disable MSG_SPLICE_PAGES. The iterator can represent list of contiguous pages. When MSG_SPLICE_PAGES is enabled skb_splice_from_iter() is being used, it requires all pages in the iterator to be sendable. Therefore it needs to check that each page is sendable. The patch introduces a helper sendpages_ok(), it returns true if all the contiguous pages are sendable. Drivers who want to send contiguous pages with MSG_SPLICE_PAGES may use this helper to check whether the page list is OK. If the helper does not return true, the driver should remove MSG_SPLICE_PAGES flag. Signed-off-by: Ofir Gal --- include/linux/net.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/linux/net.h b/include/linux/net.h index 688320b79fcc..b33bdc3e2031 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -322,6 +322,26 @@ static inline bool sendpage_ok(struct page *page) return !PageSlab(page) && page_count(page) >= 1; } +/* + * Check sendpage_ok on contiguous pages. + */ +static inline bool sendpages_ok(struct page *page, size_t len, size_t offset) +{ + unsigned int pagecount; + size_t page_offset; + int k; + + page = page + offset / PAGE_SIZE; + page_offset = offset % PAGE_SIZE; + pagecount = DIV_ROUND_UP(len + page_offset, PAGE_SIZE); + + for (k = 0; k < pagecount; k++) + if (!sendpage_ok(page + k)) + return false; + + return true; +} + int kernel_sendmsg(struct socket *sock, struct msghdr *msg, struct kvec *vec, size_t num, size_t len); int kernel_sendmsg_locked(struct sock *sk, struct msghdr *msg, From patchwork Thu May 30 13:26:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13680416 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2118.outbound.protection.outlook.com [40.107.7.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 604CC183996; Thu, 30 May 2024 13:26:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.118 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717075620; cv=fail; b=j1bV1Dwc9sz6kyk2KjvcUD7Wyqe1Vrh7pPIPc6P7mlrNRIaA2Sgxx958HB8xgwXHqJQMZQlt5EbrqrxeQZ9opDMaTCIHbgI2sdSsrxt3YrXkGFYDfTjt20cRuv7D7v8/3O2RQa//QOQVzi+9IZOItZgBx9DoOY0xSYOOr8Ir2/w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717075620; c=relaxed/simple; bh=YJD+FPKgbmJBQczz7F0n2W7TR14NqRIo6Xol2gzLjeo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=F/Do818NYfJFm81FO6zHVv/rUDI8X5Md80aLjqM4xP7s9IW13Dkax05nwmYIQ0sbQt7wJXhsATRLQbGn+HbstGsEen1sOj7RWmi+vkDMEzetW8rfxWyX082sVbfBLpR9ojVCh73VeziN5aD3kOOgCsP+mFKpyUZbSa4McMOcSCk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com; spf=pass smtp.mailfrom=volumez.com; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b=X+SCcUG1; arc=fail smtp.client-ip=40.107.7.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=volumez.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b="X+SCcUG1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iGje6C/NKvWSrZF2am7UnlK2nNtDAfvxfkOByM+EN9m6pl0Cf128mMj2eg1lGlzGK3wWhiGmqhi06V4512hWIjc75KmMyLZgI2GfXU+qTf+nEffbAS0drrilIJH+gsxUOHUBUPJBXJAroaGtlkf2OXWCgrX1NwWSW5+R6GEQPoegzGRo2m5bu6Zbyeo59mmkOLwwG+N7CmxYxos6DSyQX1M01aPfbcXLZQgUogYeaoCbG53wRwTPKAEtR6C03hqEEiokCQUd419IEhN3XrbaPf82zYySJwPDHKBBZdP1FBDUbvXGPH063e18DzHbWwpy70S7N7eNrS9o6Z0iHq/gKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u6CD2Ca2T75xtBaR82rnXRMIKFDHu6ZHcG7APYtvi+I=; b=IZWLcg4PppxgtIT8Uj2AD/slUVzLDXXcgxoC2td2QsaGu3EFF0l7FDJ3TiXO90gGdJb56+8GEksn4WI5tcD1Emd3CIZWVtMnknXubkno5YB9RWdl6JicbSE0/fGoM1FQV5S9HwjyqhLvRJgS4wx3GXHgYIr1nVKSbGMMvaGDQgKQYZ3YXOLiqp4Mq8Lh/q/PK13shWQi0f6T5MgMXha2t8sv0TiOZt3tvPwdESgmjKExDPDH8oojsxW2elwZzpvmhjkxhGPjJKOeWkqO/18/1fagWLexbXh73iCDR3RW3bOnC/TYps9LCApF6d+UF3Lrz5LQeqpXXeQtvqkfiCUU3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=volumez.com; dmarc=pass action=none header.from=volumez.com; dkim=pass header.d=volumez.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=storingio.onmicrosoft.com; s=selector1-storingio-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u6CD2Ca2T75xtBaR82rnXRMIKFDHu6ZHcG7APYtvi+I=; b=X+SCcUG1Tenv3FuXjbOJSfgZdduTdS95ZXJy+kMZxDh5rEOLiMm1HJnIHUewu96p7kh919f3mH28xEGlwFZx6yYbt5/Yy/0JAnu/QAqZJgZEZg9g9DM2iOoJzaLa3nrA34QF4UvtdE28sLby17/om7r7duqx8AYjEUz/vdoZ2WfNFF9ocgSUj+k66wdTgxIiMXXnpLNa5j7VJa+ynK/JAHC3IATdd6ErKYUqpazndrkWw2Za/ZjExQGX4LGoQjSooEIm/rBKZ3yhQLTtCv7XuaClYjHpTXj8HOqHNonS6lnJu99lZ9dTvsOxNC9k46gURXHgIMUz+em0rmVJp3cz+w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) by PAXPR04MB8814.eurprd04.prod.outlook.com (2603:10a6:102:20d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Thu, 30 May 2024 13:26:58 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%3]) with mapi id 15.20.7611.030; Thu, 30 May 2024 13:26:58 +0000 From: Ofir Gal To: davem@davemloft.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, ceph-devel@vger.kernel.org Cc: dhowells@redhat.com, edumazet@google.com, pabeni@redhat.com, kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me Subject: [PATCH 2/4] nvme-tcp: use sendpages_ok() instead of sendpage_ok() Date: Thu, 30 May 2024 16:26:24 +0300 Message-ID: <20240530132629.4180932-3-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240530132629.4180932-1-ofir.gal@volumez.com> References: <20240530132629.4180932-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0005.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:2::15) To AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB5107:EE_|PAXPR04MB8814:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e14c051-7083-4daa-6d11-08dc80ac2e6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|7416005|1800799015|366007|52116005|38350700005; X-Microsoft-Antispam-Message-Info: 5RUiHKm3Cisyj569Zo5cMADn7EN3vLWe7tr0pRtvOWR50fYwbtf/zBsitW0CgUvc5rrGU7GgD2kCPTlzKbzA75ATCVxcaS1wBxyuN4JVOyAG8NUHgIschJHcGdQoc1pkV0lC09G03frE9tSxZ6GJoaszZkZT5qfIAL9pd/7RBiijCE6rmlUS0fH6WEFxOg4CPXmb1yWB5XcCEnwAE2F+I8mcpjycE9R90elEyBR0CpVnAWtn/NA/8Y4vk0gvb8A7hUgZuforFZ6YpVBRJBo8ywvy0w+zKtiiS/44ghzeejA10eN4XNjGecbxrWtnD0PInCpCh3xjFePEsB+OEfs13RjfczxpPRbVslJKoa0WPCFDYUyoQ91b3DgjgzQzO94goEEkdZCXJ9U0kCBJQkmrqzirPyszPxwegFmxvaZaXtIBwbtyqjh4MY6cptrmCFxCGxoLtAKJnN1GgjL91B6JXTyBUOi0yyRwO1v44pNElePShK1vSodwzsUTGrgDBSEkjuUQKa078efv3Q3OJubmfavyzf0U7LsxdshkOoDEa72PwVACv9ErCNDcS2amyxgpcLBSQNfjAJE1Q05rh5BX40JuuwylNOAGaQqX+Rh/h3ZPvJASujF84tK+KQUOCt/FyYuSQYf+3mP19pV1N2XHLaAMpfS8tMIE8/+0W8oqha53xo0eH32Sf7JgOrMs9/dr2bE1AAc13cWk/9noWfTcjIjpOq5rGWZz6tNwkrg8d4LRlzA3v7eANcqvpUfhc3b102JgTQtN6NxZ+v8sAX2MnGBjpAmB0FitXKt94dx11aBBgsl+T0euYZVUJ+GiFZIE5Y5KyNY6KQwSFpFuThxrlRBUCpYApxhrP9uX/c5PsiFvJFBGrQqcLnn0qkmdx0f6AWnzATuX4j/N3AfNlmxLK4mb1aDV4VwnG/CT7EVSzGlRMA8BL7YxZh6iq3k4GKEY4Q2PT7wBhUSHc92n/etffx0iaMhs7ARmlrVrZPTyo1wUWeDb8hH5KlL8HvvWWGslgUw/zMcQ7P/y9YaPNyqtZSFRcrS0Z7wA1qcmlfTesrJB03tFQcWCnCB0QiSW8btNO66+KsCjQaP2jv4Lgxs60HhtiWzbLv9ygqdLiO/rPmfXhtKjbl7UUN+p9YnsDiQIY3YYBTjZWO+oJ7SFRlIMgK8WSBop9SyUnxikh1PO25qkCV25JTop5y4OGHBjfJaxJqF7ZIoSQN8gRqy1yktBzxhJ1c7ljsrNZsUqL8g+nVHxrPiVxKDsorVCGKKqCZr3DQWhjgHJFpyA0O8skbU3qvGl/udkFw4bBTw0r7dnud24ddU86pL15v0bCfBK/UJ6Ad8qXGwknLxYMky6qzU3HQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB5107.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(7416005)(1800799015)(366007)(52116005)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiS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TD7lWqjSTjkH0AzzYcDQ3I6BdxxHBag4gz2vhAzVqViRzrV6Reh2waKB4EFnyvDij92ex2Xr5wNqr9uBwqiyVKQ4/K4C3TjsEGPMJdTe+YjrC4vIY/HCOBwPgBOBzRyrHl2mkO+zn8b8aT8MVAu5jA6MYRWzhYngnInw1gxuad+eeFLkYt/AAj3G07xxoOE/I7Cpu1eIU8I5HUIQ8Jg/WqaY2XQangFwB3ZHSqlA43z7rhpKhKkcwNcxffYRMC5NwfhNTYGw8QYkIuVFMTuQ7yoIwfgru7MThfMypSHRBovEGkxIIxH3qxCbcDBsCVjhaq9fOZRqmOoLVhHh/ucjo+K/ylOY4oGQ3i0vdYlAyRLfXny7X3mMh+ZnkZHglh2kGlCAdRQR3w1OyDVR2C7IQ+X9RSB0pTw+Ab7Xdni0h1DJ3mFkXZx8s2BfYHmlXtKp2Ej8dSmvWqUCzG4DXP24yOMb/8DyBdEgxRe2zyB5MdO2CTw+x5Q/TWqk4t078apj69mq0qNK5q3aq8S X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e14c051-7083-4daa-6d11-08dc80ac2e6a X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 13:26:58.2923 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b1841924-914b-4377-bb23-9f1fac784a1d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: o0xu8W7k5fpDAM4l+a+aDFw9XbM10l8ba2QlotGD8FCi+We+B0WAyTb4ZPAtBZOR4AN1MSRVann2buy+gZdzWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8814 Currently nvme_tcp_try_send_data() use sendpage_ok() in order to disable MSG_SPLICE_PAGES, it check the first page of the iterator, the iterator may represent contiguous pages. MSG_SPLICE_PAGES enables skb_splice_from_iter() which checks all the pages it sends with sendpage_ok(). When nvme_tcp_try_send_data() sends an iterator that the first page is sendable, but one of the other pages isn't skb_splice_from_iter() warns and aborts the data transfer. Using the new helper sendpages_ok() in order to disable MSG_SPLICE_PAGES solves the issue. Signed-off-by: Ofir Gal Reviewed-by: Hannes Reinecke --- drivers/nvme/host/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 8b5e4327fe83..9f0fd14cbcb7 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1051,7 +1051,7 @@ static int nvme_tcp_try_send_data(struct nvme_tcp_request *req) else msg.msg_flags |= MSG_MORE; - if (!sendpage_ok(page)) + if (!sendpages_ok(page, len, offset)) msg.msg_flags &= ~MSG_SPLICE_PAGES; bvec_set_page(&bvec, page, len, offset); From patchwork Thu May 30 13:26:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13680417 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2113.outbound.protection.outlook.com [40.107.7.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41242183996; Thu, 30 May 2024 13:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.113 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717075628; cv=fail; b=TH0V5GLPuwgc1Nr9R9/vg0pncYd6DgwTUgen/TffVJMhyf9Fegz5ovzoKtxMc40HqUCw+fvdN92zFp1al9Yf1jiTvhI6rVznvxb9DYAx09nuJxqZUyo8fdyvAQRWyPFr9OfJAiU54+QVfI1hHvtV1o20gBBAxn07stLfHnw9cj8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717075628; c=relaxed/simple; bh=n+30LPrgh3ECtE4vwoN9GQnQtWDt8J1uBwKgssKCb6A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=W4wgIc3vSwCKmIKKGH/zDlaD++kj5AQoyiMfSuctJtaN/9mb6V0E4RzWcYpSTOzPF7wQIUAWVQlgmED95SmOju1p2km938V9ISxaSrIbke46EaVgKYQBp0e2IqtJsDjcGa+nbTLNwPUUjCy2GK+DQOC0o9sVMSWuGLiS7VrKnPM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com; spf=pass smtp.mailfrom=volumez.com; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b=ORLnKGVO; arc=fail smtp.client-ip=40.107.7.113 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=volumez.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b="ORLnKGVO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cg2lccXUpDlJpbxejW54v7u6XGsnlmiZpULlsNtw2lCAVAqconPPhIzRYIPaWpeK8PKgURS30E2M0FXaSAwoiQUGYMbN7y7P5fYT4PhAyazkNYD2h1jfsJBQbKAv9153AMNxrbMJUoCN/RkwYvosnlkIQ59MM2kzspjh8YCfxJGbnM/JHNJcdTFJagRI1LxA3aFGHErae7vgNaJSCSIr1jXSCwPXnHFAO9c85vSQkQyfvvevVtjf3kHiLNqSAty16wUljX4UYtbOhNZIDWAnH+Oa2FlmzUjT7rpRJNPYRyVrOz5g4ZzJmq3SaSIDKtG+h1mU+STHXkH398oHDYmN2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mXyPTjSX0sG4zzXDMHIlAtzkqrxPxSoExsIIIIGAj/c=; b=HxjLLVlYBE3RALblSQcF1OJcNB1/EiAh1hT2RqfMhHNe0lFNJ6cilok4zT+9KcqBABsQ9QCT3vSXtF/Ko9Db5LKsQ6raNZApqImUH/C+StfN6ZBmCG33vOvhmavtuDSEaKiTd/nWcdE2KVrWQe/ymTGIpJ1uGwp4RuJ0NBhpq6zA66t0OsoFdQGiGjhPiTywSjqXiTrQDSQhogggJC0iO5Ry1XYDLK1MkF8sDQ0NUkQX0z3iso8kNGhYwqe4oU7nnTPmWJHwJ9KFEOD0/eeNBqEH6hQBOgiBFjGxk3rMIuDW0ICIzgTqnvaFIeAcR8RBbYEfLjqUuQ1VjdULmJ/Bpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=volumez.com; dmarc=pass action=none header.from=volumez.com; dkim=pass header.d=volumez.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=storingio.onmicrosoft.com; s=selector1-storingio-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mXyPTjSX0sG4zzXDMHIlAtzkqrxPxSoExsIIIIGAj/c=; b=ORLnKGVO9v4WbHExX/gWFY9cs2nqZcm/nt0NL3ra3m/DEyPa/hKcpzFFalkXpFrrzddpWSwwI9TOAvOIXisMM4n80ZaFwqw2RzPlILbygenIn9zDnz/U9O0S4SJYgbrWpLurpxXZF6fG/hjhipZmeNBcmaps+7guTqfZscdFAxaMgztJp5HM1QzLLNCO2ZE5YNU1ojkldOPaxO0kV+OJQsRXTt4nU1b0anlUmesQA7FLG9GUHayiENgmrefgQ1vS3zOP4cW1hI7PVTDNxytSOGK5gSFaNQ+3gsqjZ67/+KgmTrdKjLDBFY+7UqmiJxQ8jfw6tXRTZy2/K4g0gQi0yA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) by PAXPR04MB8814.eurprd04.prod.outlook.com (2603:10a6:102:20d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Thu, 30 May 2024 13:27:00 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%3]) with mapi id 15.20.7611.030; Thu, 30 May 2024 13:27:00 +0000 From: Ofir Gal To: davem@davemloft.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, ceph-devel@vger.kernel.org Cc: dhowells@redhat.com, edumazet@google.com, pabeni@redhat.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, christoph.boehmwalder@linbit.com Subject: [PATCH 3/4] drbd: use sendpages_ok() to instead of sendpage_ok() Date: Thu, 30 May 2024 16:26:25 +0300 Message-ID: <20240530132629.4180932-4-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240530132629.4180932-1-ofir.gal@volumez.com> References: <20240530132629.4180932-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0005.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:2::15) To AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB5107:EE_|PAXPR04MB8814:EE_ X-MS-Office365-Filtering-Correlation-Id: c72a5bf4-f563-4af2-6311-08dc80ac2feb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|7416005|1800799015|366007|52116005|38350700005; X-Microsoft-Antispam-Message-Info: 0dUSThsx+paOeDmM6vWFAIWw8FYzn/i1UK2So8ziSqnjj6LB+RMyqNPzeuycYfNPZf9D9EfMOgJGhkRPC9lYMdvXnWTKT1l4bPgs2Rc7brkSsuXAbuMhO6ZY858aqeMupTV6WUX3+3NgYsoqFLjhbbFzxYht2qZp3ggSBQvJyxFzkZM2TbIcKiKK7aoDubyykxhU3FOY8C+ogxebNXLkGpqGbcSjHX70ErR/TjzArFDGcw/9HhFupj2J6Tn4ttlnDemVETZZy13ZFlqi2Fu2i6tW98pw2SH2FuMdCFRdhRhKBUAGbycMu7L2EGm487oKtcj773IdsUWRIKi7pwBBSXwl+Gm6oXHq+vIP1WfG7Hk0yVDhH8mO5+A3UqwvRDPxD4edVEWagBrNAeoM/bsirA2hDV4f5SOYbDf3pNgG/mVI1QqES2T2u5YjjR/gysAdAL5EdpDe6H1TUtkZr4dCL2MlwCj8FHUjiPtbuc6Ym4TjyyBV3x60A9qXVw7ea5Ef3s6/06SsrbYpT/nSnI6+LaFN+ehBSmk8Ln4IPvlYvOWWAcldy5PiyfyxxiGbm1pW12VxF0hyHW2ltg3KR9LSuP3LcvGenS9b6Y43aRP1udcHD5vZvinnhzLKDu2yjq9wD7zaA5jBhlCs6XWtNg1Llcdko+7yQTBaz+jvH5w5++6axj4GoZaIILR9Ep6ck5BP/PHX0MUe7bkaxS9rkPAUpGuxlI5YmYSne6Xxyh4dWVWWOASuRUH3jY1iAs2PJTWhCiUSrNBcwRt7ZHbks2PGSdvtYxMuDsa23Kto5Minqf9EMNCbGEkEJQe+jJCtpjmPTtkHU8GX4o/VKloBS1fND5480vah6w+yW+Jq+T74xV/qXIeSC4i57i2tkJnrbbRJgi4Y+aW6J8mJ8MSZHykQCwkiYWYyggFAK68Q2+X2Hfh7XdUO9mZ1gI4T7HUWaEW2/j6uixS8ON9c2YkljdPqxMj11gaTCHjX5qmVDzAJK3K2tOUXWT4CqCr99SMKivD8v66hBtIAod6uTzhgiBWDvQVAz+6J0apbiPtuSPokI0rzwifoI9chil8Ih/U/kySygv7qb59UlaJIwEBRmooQpNqHhe1q4Uma82jENbZj7KEJWtHifO82jmWEMxyby5vrTWtZHpmSpxK2HjOW4lWgVZTkAolyM2+bafHSAVvMXi8/g0s2camc2FtD2+ntQ5JjT1M/GskFw+OH6oHVncrWNesGfYef7tZEZNS+Hgxpeqky0jaaOwFLXTmeE+e6iLfyyjG5Wgw8IxjpiK1aaWyMpm7/Ejzo7mOEnVxXFdYC3idcoe2Vmri2L5wbdnq7UTvHtMp7sNws3XsWXS5npC91SQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB5107.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(7416005)(1800799015)(366007)(52116005)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hK1FQ4r0SWg9mRO6dHBu/N2kaV2QK/JzHdQ49qqXkPN68+Cjugn8zb0Khdo4zhLqEA5luPX6j1F+bVvItQLAYMxn37Dm+XnIgJ2baSSP8om/VS8VVxfhcBTe5rqNcCN6ii7N5lMJpAgpXs+y6u7+QFT8qeGQzvfTbWNMoXQdNPJbLxMM2lUJJXiUDNW7Nbvc1GKCSCqKz/YTnYNaJW2uesmy36e8b4kIGAbnQmluOed3hXg6AN9him1WGJt4mDxhXX2bbpuNMvQzgsp9s45r/8V0rQkYgHekqr+twfInC/K5IzWraRv8urbBjDCvZUl0yddecZPK9VHARhuJeGw1ywdNTz5migCiSgMiDJLyjF9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hjeqMcmOf9/XEeBtsw2THkQUkrTQKjG6W9OZF0hKZJJhUe6lX4Wl6XBMfoRxJ8zffobV1H2/f26DEWSRsF38M4QsvkOZuB1kqW5mFJwaf6c+r9jQxehDUUV7yVxPqibuAHUm+7PvD8zU5m5BHl7xclMRslTZV6kXNdk71jl3cbE2zcN X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: c72a5bf4-f563-4af2-6311-08dc80ac2feb X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 13:27:00.7379 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b1841924-914b-4377-bb23-9f1fac784a1d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: l1gaQRCjkAfJbNzjEqspmGGjjibHX2ML6ytmEfBBgf/4xWRefDgikVIin9rm+Jtl6kgZPknaNgThKyR5w+xQgQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8814 Currently _drbd_send_page() use sendpage_ok() in order to enable MSG_SPLICE_PAGES, it check the first page of the iterator, the iterator may represent contiguous pages. MSG_SPLICE_PAGES enables skb_splice_from_iter() which checks all the pages it sends with sendpage_ok(). When _drbd_send_page() sends an iterator that the first page is sendable, but one of the other pages isn't skb_splice_from_iter() warns and aborts the data transfer. Using the new helper sendpages_ok() in order to enable MSG_SPLICE_PAGES solves the issue. Signed-off-by: Ofir Gal --- drivers/block/drbd/drbd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 113b441d4d36..a5dbbf6cce23 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -1550,7 +1550,7 @@ static int _drbd_send_page(struct drbd_peer_device *peer_device, struct page *pa * put_page(); and would cause either a VM_BUG directly, or * __page_cache_release a page that would actually still be referenced * by someone, leading to some obscure delayed Oops somewhere else. */ - if (!drbd_disable_sendpage && sendpage_ok(page)) + if (!drbd_disable_sendpage && sendpages_ok(page, len, offset)) msg.msg_flags |= MSG_NOSIGNAL | MSG_SPLICE_PAGES; drbd_update_congested(peer_device->connection); From patchwork Thu May 30 13:26:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13680418 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2113.outbound.protection.outlook.com [40.107.7.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D5DC3DABFA; Thu, 30 May 2024 13:27:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.113 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717075629; cv=fail; b=BhThXi9gX/zVk34RWRpby1Gco/1i9Z6jes8LgIoBvA3QT4Zpet9i6phwOdsW6BRAC3j1muqb2iC2/tqhhKIcwrU3HElnAx/C6t6cWhhPSYj0JSVaj2GA0RYKSH2FgaR8qoXN7TPdsOVvyi39NtlRALArmKJzmQAvpWZzsH0v4W8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717075629; c=relaxed/simple; bh=2+Im+2kXu18jMablAeBcJ/QIXTeWmdY+pzCZJV985fo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=duBF+u0zw+dT8yGOMaUAs16jvg5xVRExrC1uv0RtnVvsGJqYgM2XCSDOFCkTbgIcsXekYW3IFZPCk31hWxD4nRcSz1SyXFh1NzK3Bgmrrpaxq1k5uPmnWc5DgcE4qSOqydhhRYxx2coi5mUoOQt16iCYz+U3/8FEARDlNyXq9R4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com; spf=pass smtp.mailfrom=volumez.com; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b=SMvB1pzv; arc=fail smtp.client-ip=40.107.7.113 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=volumez.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b="SMvB1pzv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lmPIwbROBTxSIPMmghlMEuwcVL72Er60KUpbj0fWLK5Xxvl3Y15JQ4hCJje87kMUNyPB+tTpwEUm2jEmn0Pz8bhYE9o37ckOby3prV4H0jPPTRBaLw1j7hh4mK9QTBeecoqnyM8g8iR4FJKLaxJdb2SRcju4eO+kifl0N84V7tIrfn67LD+aOgtxxChXw/t95Nu67zrFV/5s1F3I9Zbu3d4tTtl0j4LYIzXcQ0Vqec27uCesbfe8sadZAGBGwVYW10utt9ixm24DmNN0uo4lJVLJ5GSjNdVDCa7MqXXHx7FLX+y867W6VVI419y4dLYCp8d2K4ZcBdbN19cc707koA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1Rfv8LDVgRTz9jiC1OhOxn9YPDgrbU5FKBlQ7Avcww4=; b=Dyt7FUbMYucu1v9QwRKh2V96s41bGNXWfkGoPHKF88AQn53SpHreUG5RBtDBESgWVjUgNL2lOHZp8X+kdST/vkdEjSaWY5yKGEtiMpQe1z5y/tueN+GnZrDyzs7ns279ztVwGIV6v4IkGXRHcDNbmHrrIPCdBykjWkKdZnDa90/chb27W0eYB3ij7fSKu5rtWVj/x+8g/jhcHI8hSMDEe5b9Soe1LmcmjBLz53usX4YnqIpwZeCxTJIeFFg64VrHKIjt+BwAaavnhq7RfacxltPSMqmvMPq15imYQ2YK+hH8giYlivquGIIvSBJ9vB6Gc1eiGb2qoL+07LO/hIDTWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=volumez.com; dmarc=pass action=none header.from=volumez.com; dkim=pass header.d=volumez.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=storingio.onmicrosoft.com; s=selector1-storingio-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1Rfv8LDVgRTz9jiC1OhOxn9YPDgrbU5FKBlQ7Avcww4=; b=SMvB1pzvgoCZLOAndGZOzmxlbngaTuUljF9e3pMTIX2RXVBba92jLeQ6sH3B/DsM/BAqbobWmxOny1ADBxM1x6aMNdumdLe4ATtWI7mCeH5uX++LpDWKPlLIHUBwu7FEgtQyeCe7nGaAGl6iHs03DXQ7krvxyda18bCtc/79tyr4zcSArzmfMMBn0fLgZAWS6eDVSfzURmDcAsJbJ6EfAFmqv1XQ+XwVIqWpIlby4QIQ8VQQf71RDNWu2ywE+1i0ZJ4qU4eDHe1TBP9awaKHmN2/ldm+ZmIYPG3OCMlxRqgB/4GFtTxqpZlz3X4nG9f7H2z3YiiNdVN9PxSOvJWhMQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) by PAXPR04MB8814.eurprd04.prod.outlook.com (2603:10a6:102:20d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Thu, 30 May 2024 13:27:05 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%3]) with mapi id 15.20.7611.030; Thu, 30 May 2024 13:27:03 +0000 From: Ofir Gal To: davem@davemloft.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, ceph-devel@vger.kernel.org Cc: dhowells@redhat.com, edumazet@google.com, pabeni@redhat.com, idryomov@gmail.com, xiubli@redhat.com Subject: [PATCH 4/4] libceph: use sendpages_ok() to instead of sendpage_ok() Date: Thu, 30 May 2024 16:26:26 +0300 Message-ID: <20240530132629.4180932-5-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240530132629.4180932-1-ofir.gal@volumez.com> References: <20240530132629.4180932-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0005.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:2::15) To AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB5107:EE_|PAXPR04MB8814:EE_ X-MS-Office365-Filtering-Correlation-Id: 654021b9-d290-492d-f2de-08dc80ac3175 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|7416005|1800799015|366007|52116005|38350700005; X-Microsoft-Antispam-Message-Info: 9WNn5jGJY3XrebvUfzk+GkzaBraANVyOuxWKP7pesIwO2iD9b4QjIrnyDkigzu/cpAWqpwW7yFQ9OgOTX8RhAb5RjFi2o1qyy336b/RLIHHAuaR8FfJzjSpOxBbYgQcUsnBuWri0vNGLfV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8n2MZuukvT+OJJSujX6JZJj0SFkewIcxfvjToIWsnVbX0bHtrdBKIwOaUTjePTmhGyowTCxhAj/Ut8ASCz2Yb8R55GirXXiaYYaanc+yt68qphsDPsiTgvf3/lpCx/XsKMTz2ON0lxWjqv4Xr4NgnGVGSSAylgwG+g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB5107.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(7416005)(1800799015)(366007)(52116005)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3zMc9eBd+FCYDZF0RT71icHZWhJSl3Yfzlt+2sB5/VKBN1nKYGDkPm1XKtxalAF5ruyAlqgI+xpSLsnacfEYPTtSHcjixkjZd8s6wrAi1d/2uU7j/Xcxe4ZnIzZ8CfTBakxXuud5V4yJRy7PvoofapnSLXJ1/8yc2Ksk6Tjk9MxSOpH3PjSP1FY4Do6sXSB6b7AJ67tN0+goAYLhwnx9ThfoTjkQQmrcoBXWw7IHbO3u3ouE2o/glyf34Uuns9lmheytdM131d51HN3pfddQiW/Rr/rEJDzrtQa4KLbnJfPS/cwJBUwVaI6Ib7Od1GBy8LnOCQOBePV52lsAGkO8n5qf30+PqOFA9cFFmvjYEVePV8ZTuGbQdlYQBEyrkWzq2m5HPipAjrFtq5x9NJh5C5geDaXYISfEVJwBP2ii+XnHOZLbVBSpGmFhUksycc9UGYYK5RYDSblqYMwt0LxLCj/5rXrTRZOkRLUObEcm08DSZA2Wu6FxddmtWmSsS1t0yLQCUh3tXSegQ0nQy50k7XBODDlm9G9bLZB9vOSfC8jDiaZa+LjbtbKTOOOBkWsIosSkFFw/yWOep1g6a6pIkG2b5MblIPg+cNJFVuNXcapaGnq7LcUo5fp/YdUlagrCHh9jzOIhZ1apk5P5/YpwRXXEOuOn4dCS+2EDV7pwMNaesIgg7Ac8t0cJgcWqdRedEMh3Q6rApALY7lxZH+X7zEJfcAl0irWPThj8dZo61UaH+qjT05F5UNXRFkNLI57V4ndRFfhksHPqzoGRr2rfScbrBwmsas0xZj5iJw9dHVrnKokgL648sT/iS5Ls6esJANKJwvDY2dzwrVfZroOWL6oHKaRBxctTET29dnkL2fI3WD6Wur0IQ5ceX01GqXQOYzj8Z+ChN6EzJc+EUzeOvJDnm7tPKyxnRI3xCMQNJTCeiCm7zGd8VM8wELIXVvfsNZJ4YGmsxdbxXqZw2Lb1uAGOPLRJ/4l/N7SRPrnINyxQJkHRwveM3pza3BHHvQPBcg4U+dRbJ1dYfpCYBA5VmqqPZ8mE6VzYdsAmD8nNcrEbveP6Nsskr9s9Y3KNm/4Vi2O2jkO+8DbdSnBPiy8MkqGhSMNBLUKwxQiK4PU6D3HAfCYmN8HqTBXsVwJTqYg2CvR+vp9QdZP8cCj4MMK2RmTrLu5o1rSyo+tJobZjnv+H0Hg3Rpg0q285VbdQVZv1hqygaVXjCdMMGgOHQnGKq49UwqwxT7s1fkt4qLWOAGvYdOQaWdQthyHt05AZCN1PSBP5i9uGbv04eu7Ac6gyfNb8ye0Ns+3G4EA8S73QPLQy2YlfQ60eqGL80mcOGlyjxmysEnDNEczjm+hGmSJ/hShpT8vVQtwvGg+4APesuzwG3SoI0UKqiq3Zi80Fn/4p1APjWnKnfRD78j3AZvXXAl5OY3l3mUofpmnJpa1iHpT7lhXCnKWetCd53d/9ssvich6ONrusJ99jXuukMCE5hN5zxOTO4hZP7yWuaCuV17e8829HLJ+RICGFd4ntd3Fu03Q3yrucCBV1jCagD7Nnz0SwXDsi4fcv36BHFaKJgNgXJPy/vwmgUSh8wdGERbpw X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 654021b9-d290-492d-f2de-08dc80ac3175 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 13:27:03.2864 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b1841924-914b-4377-bb23-9f1fac784a1d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GY3tElxkCWzdJZMYpfzGlyRgE+/A8/7+dMA7lqouX0DGEA+kWPFltKXY9uKgrH1q0n1E3pCk5AQpAl3BbFsk1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8814 Currently ceph_tcp_sendpage() and do_try_sendpage() use sendpage_ok() in order to enable MSG_SPLICE_PAGES, it check the first page of the iterator, the iterator may represent contiguous pages. MSG_SPLICE_PAGES enables skb_splice_from_iter() which checks all the pages it sends with sendpage_ok(). When ceph_tcp_sendpage() or do_try_sendpage() send an iterator that the first page is sendable, but one of the other pages isn't skb_splice_from_iter() warns and aborts the data transfer. Using the new helper sendpages_ok() in order to enable MSG_SPLICE_PAGES solves the issue. Signed-off-by: Ofir Gal --- net/ceph/messenger_v1.c | 2 +- net/ceph/messenger_v2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ceph/messenger_v1.c b/net/ceph/messenger_v1.c index 0cb61c76b9b8..a6788f284cd7 100644 --- a/net/ceph/messenger_v1.c +++ b/net/ceph/messenger_v1.c @@ -94,7 +94,7 @@ static int ceph_tcp_sendpage(struct socket *sock, struct page *page, * coalescing neighboring slab objects into a single frag which * triggers one of hardened usercopy checks. */ - if (sendpage_ok(page)) + if (sendpages_ok(page, size, offset)) msg.msg_flags |= MSG_SPLICE_PAGES; bvec_set_page(&bvec, page, size, offset); diff --git a/net/ceph/messenger_v2.c b/net/ceph/messenger_v2.c index bd608ffa0627..27f8f6c8eb60 100644 --- a/net/ceph/messenger_v2.c +++ b/net/ceph/messenger_v2.c @@ -165,7 +165,7 @@ static int do_try_sendpage(struct socket *sock, struct iov_iter *it) * coalescing neighboring slab objects into a single frag * which triggers one of hardened usercopy checks. */ - if (sendpage_ok(bv.bv_page)) + if (sendpages_ok(bv.bv_page, bv.bv_len, bv.bv_offset)) msg.msg_flags |= MSG_SPLICE_PAGES; else msg.msg_flags &= ~MSG_SPLICE_PAGES;