From patchwork Tue Jul 23 06:56:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13739606 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11023076.outbound.protection.outlook.com [52.101.67.76]) (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 97DB7632; Tue, 23 Jul 2024 06:56:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721717785; cv=fail; b=oyUaNBrQvIGD9m8jpHCIJC/Tkn8eqZBSpI8p8XD/of5EXw1GYNQY21AI2c4JEJ8KqnxTJyA16nKBLRidFmxwN3ygIbDnLT1zTTF1x4AnF3nUCtBeI6od+Ug7nSpThGWWBNwjFEVL581hsOAULfK0TztsO6b9Y34ht4J9AzhLWic= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721717785; c=relaxed/simple; bh=/ljYFGkkREzXyzcI4ekPYCaVzFq41T8mboSrcQLGIe4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=P2nuNnbEuea/fMI/ggdiRPUoWgZL/jsf269RY26kFNZVfanFamNY4BME5Gj3Yf+qh2BhS9w+859ep2ifRKnr+z6LDSntcM4wRk6So2Y5MFeF3GS0ysQm+i1KWdYHwQUNuS3QqH8tz8vDKcVFsYL/ayv5mq3o7O9xuwoBPZAyzbw= 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=PBD5U4lK; arc=fail smtp.client-ip=52.101.67.76 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="PBD5U4lK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=niQIOCWh4jeLKmo5wMGwMB2AQJJdU3HFnQgf7zcpGsqptX6NEHZ4HNItEzhRcSFXCMGDJnCOOEIa2Z2afJbfaMvRvxeFeR491QuZIzSZZfCo3mp52OjLXOsqCg5FvyM2+EXXGyyyJHYCks4VKuLE1QYecTar4Jr7EaK9XJ9Kh9YC8ZoZMJ4Rdr26SSNMGV/4198vj6b3VNtkr4nPQ/sE/Cz/f2roayCrgXVV3dUD2UlsEh9xdvaDJcKgQAmGlwN6VIB9AgU2fZ2LPdA6P21PFY4vjJ3E+xzljrSQPlP/auBeldMjkA5fBE1V3GKEGTwHg7M+coB8w7vC/i/QCQ40LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=KNG97TuOAGpfO0lEV0dlgvvbLwlFxs35j0ufNuZ6alE=; b=LIlyyzGHuOxx19X+MRsFHE5cGXig9XdqSxVRsbcs9Ml39NvPAGPln/iGZyzysjn/nT6eoypWTyFQnqrKbmWfVIskp82C1aKzVX4GlO/+jlfhB0txGTfPhDc+k7yKfXWdgq8CB7BX/RtrVonDBvHyUvYbVxum2fDZWEYN7ONFiT2gnycehvBb1mfUMBR+4vMIuXxvuIuWIR/SVlGjDUiLO2IO4Vk9+b+gvTRsJrMWkPViN4PIIINW+qv9NTv2AkXmAGi3TZTEoPKB8anpJ7FuAgrSoM88cFC6wgst3CZMLKCbz7Ztq3ig/oYHCODcwiwCHo8/kWuirNKP8mwWQaBs2w== 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=KNG97TuOAGpfO0lEV0dlgvvbLwlFxs35j0ufNuZ6alE=; b=PBD5U4lKRSaenctfRCXNsB3WaEFuS2HFXjRgqspkhnQc09c7H5ZA5ZK90gRF3N6MsASMKoRso9jZlrTtqkSZa625hB/BTpPdRY93SE9jLGG8X4lgM89gicFh75UTm9SCiyQJrrE8OwgdccgpP/dg8oxeJy2SbV7/HN3oTA30Qtao3GZv2qzFjIF2hnvRK81/T3aSrEnohL9cvgP6Xd1Q5tFcrytpa4VZGMajBYY0iJvrdnD0TyZImrHxADGR8bsCbLe6eQhIFrD8oxTEhXeuAaPIfxtbPLYqtfxkcD7wUepETYMNpZZOcPVoofnQzg/oDcENWpQV/fyO9CIJiUYDJA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AS8PR04MB8344.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::20) by DBBPR04MB8044.eurprd04.prod.outlook.com (2603:10a6:10:1e5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Tue, 23 Jul 2024 06:56:21 +0000 Received: from AS8PR04MB8344.eurprd04.prod.outlook.com ([fe80::d3e7:36d9:18b3:3bc7]) by AS8PR04MB8344.eurprd04.prod.outlook.com ([fe80::d3e7:36d9:18b3:3bc7%5]) with mapi id 15.20.7784.016; Tue, 23 Jul 2024 06:56:21 +0000 From: Ofir Gal To: davem@davemloft.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org Cc: dhowells@redhat.com, edumazet@google.com, kuba@kernel.org, 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 Subject: [PATCH v6 1/3] net: introduce helper sendpages_ok() Date: Tue, 23 Jul 2024 09:56:05 +0300 Message-ID: <20240723065608.338883-2-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240723065608.338883-1-ofir.gal@volumez.com> References: <20240723065608.338883-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0021.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:3::15) To AS8PR04MB8344.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::20) Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8344:EE_|DBBPR04MB8044:EE_ X-MS-Office365-Filtering-Correlation-Id: b2de60a6-bef5-424c-bdd0-08dcaae48f0a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: nwbp5Nhp6kL+FwSqKv2jYc/UicEgHR2BsXmj9L45Wcb6hXWBqGgngcyuow7OpWBfASpQluqlb6nni0gRPnDCQb5UHkxRimhOIDDEWSgS1rPJhnfa2DjtlyWJGCU2TdohT6Je+dgEyweTPV9bIiHTZ217jUM/6P8mmkgwrskNY8c6+EFn7zzqSawyTNP5vxT2exxQE2joIGgY/FmybGNq/CjQ35xtMHm6/3v8jBarobTUt7MhxREM3wEbz0GdVOiyJ+SREovQbZ9R77wdpONxcCkpyo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G8HSkbMqY5DVWgYGxaj6/szown4oSRdVGuMI+xJAlYMwcCdJo9YBcrMhhY6S2WSl9Xj2+A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8344.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sqRLBV3zHBR/L5TqjaWMk07CyyxYfw5F65UMsQWkmvPlX0VbyxuNedf4i8fjpCLtKVFz4RbcazWimxbdGIkzbjA3G9bCHkBwAOXj1xEj2QBobg7O/IvKotI8YNC7BmoS8GxWbOd4AJr/imOR+uLneUZ9S5SIBXDKjHS0lDL6X/owWJlv+aQi0diPrtiCgtuSIWHDoSAKsLx7X1ZKj/IPqEEjvTBctTraVUChwYELmHiZhge/OSEQX5LhUbmKOPPaoMjENLtd4p4mcuEM2xr87dH9IGZKeoWXZJrzaImORncGB50QHIRt9euL8O5HbL2Ivvdu1OBsRZzeIXKAzVYd9xaumF90fM3ADoNhDGM4+HuZpW0DHpjAvGwq2u4f53ZwrDa0kZWjq5mq2vQA7aekykHMGHJb291QJXRhibSl9Z25OmnbFn3Aqo9aXc4dZVBST1ClK8TrTBRSSpp3tcgkzX3gp3Kd/ZIHN8scqm03JI2C3A1VPjn8IMXct4TFiwEnPYbwGh35KJ8GHTBDWIYrFgqfscZOCJsS9c84KFPgZnLuggw9yUw38PNoaJHXd0RbqKOLctOvt6jx7jJLBKAJ+FKT4Ob1EnGmiu4CLRvq/MLeogcD0guQ1Y0JjMLV/jYVXhLzlpcJQ45nSZ2LNSw9pTtLe3MHJ4+K8Cc+38pIxFsDdAKcN4PfkFt/VdLdZjDveo0N4m+SN7Y1V9ItSqZP0iy20XGK+BW/tsXQixvidoovWgCVrWvVuBmmSV/EbMlQADs0wgQ99pTxzdZW8sT04f8cUZRHuCM+wmAojAz4s+HrEOugvnnBaDU+rYyABQYi0MR1sciUYvBwblO+8pi3/5zIeYgjc+/nSz0cZu2LuwJVanimMcK/ZdKVw48uMSTFGnHaavIrKmA0jt/r46uB68PogID5K/uZciIn45Z5V/U1kWmeF0PZDxpuF2OTtWOnqI8/cNrGtBZFTUpAmouHaQCNBcDd2BSnlOjotdczsmqUXKon1VJm4oJV0G23EZowgnssm2dQKJciZF2MjhPlHCdmOXxdxoWwVvF25r2IRyOk3NBphdJv3zx70DSJT6+WdbozauXjv5XMjqHFCIN5Hi/WMWxUpXkPkt4QRO6uD20EvIQ/u9CjshJu9eoo/ZrId3EHVzpzOaQ/alfTzO+LpoAMJmMzX+aAmb7EqIjRbNJ7smr2tsu/qww45SM1q4scq7DiP9HMvHTnW81Wa3TLGNdEzR+iMbxnc3N+X+6436HtYbRxvxUfRNTeKH2bpvXFYjmM0JtS1/mZQN64FfvNbQL1EVOhL+LCl5alhy6TktnRb+jFeXPZ07/jHqjvO8yQKKEYw8/BLsRPm87YKoK+4z9cfk6ylWLnRYzydpj5/jaDNAeZl2uBYgSnFQPVBAcIZ9yl7/1iceASlPg8wfPjrrg5g755sa0AZWVtV4U50YnVEqVoOeR6cRMb/NowzE9ciL6CKzC3+IGemx4AmDQAoZiXyCNFkWV2m9rCmuUQ+7lDtpdH0Kb4EobITMSRa3nYSY6Zol43dTkHj2IFisuNuUwOpfRo/JV4MQODBq/FWFXXlJqggcL3G9J9QIptUWQC X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: b2de60a6-bef5-424c-bdd0-08dcaae48f0a X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8344.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 06:56:21.0099 (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: nn7QlA+iC8yz/pBCV/mm0RR8FrMgEtldX3VsfdOuYqZDxykukNRYR66vLgSJPuWERBdySmWeFGqEg+8VLJl1qA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8044 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. Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Acked-by: Jakub Kicinski Signed-off-by: Ofir Gal --- include/linux/net.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/linux/net.h b/include/linux/net.h index 688320b79fcc..b75bc534c1b3 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -322,6 +322,25 @@ 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) +{ + struct page *p = page + (offset >> PAGE_SHIFT); + size_t count = 0; + + while (count < len) { + if (!sendpage_ok(p)) + return false; + + p++; + count += PAGE_SIZE; + } + + 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 Tue Jul 23 06:56:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13739608 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11023076.outbound.protection.outlook.com [52.101.67.76]) (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 EB8E614A4DB; Tue, 23 Jul 2024 06:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721717789; cv=fail; b=glJ1L6U+I6boWO7ZfwYyPvU+GFrIgED9PjOKi1HcJmSx2Ddr2rSZC2zIqNKjcST026nQQhvIvygVgFV4pqpbujrnlWOw4CutIXNrqwlcHFsiFxro+3HyjyF3k29WtTxxAedOXnqLJHvWdVYUvKhO9q+f2mUZigqsNWe1i42j0Ao= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721717789; c=relaxed/simple; bh=QGUg4dKL0WicheHlUHSl6HgAJX7MBqUHSbiJdNDTuaY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=dh++k4g0UMmLBnabvvXd25jXgIa/I8BwsryFz9n0ZfM40QEZeC2NXDwRwxMqdapOGZQjDHq/8gWz+VYZDADsKLGlnL6bd+YPW+2nfcdUdSBc2BjuLhQTM09xReJ3cFk+9xfVyhmP6txnJtsSIAnxzUaNAaitME4c9iUE+pLRBh0= 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=WBq4oT1h; arc=fail smtp.client-ip=52.101.67.76 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="WBq4oT1h" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QqargcI+DTibqlulPoTfpSZ7HVoHjk83s4DL3Qy9WtbxftokdAdFB85b6FEwzw2WaBLK6aC6ZXuIa2CEEGCMrrXZTvo4UbDSn2sfFQm/+as/C5qdoyLxlnmHe2OeTrbvvqaElYWiGn2i4lEwSl8qs1xibEQkcRjVT3df0S7BgA9k8/1lSg2oBkozY+6Zr+VCe3/3/fGneerNIW8i4RbIisGa8a4Ldl56lebAiQUrefiAeNxeWybBxV5jIGeVOPH4tZ5paBTCJVgzTcEUay6uIY66N8P3OWGn5MjMECmz26yCYu5BVw1ystRnMoiBpMJvE+NcFsygRA9uNLyK5iUGlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=7h66DTQRqNJcB+hJcxsgw6qlvmi9huvV9y54VL+AoxM=; b=QFk/OZjpI6+XGfU8GGNmICVviM7HPnF5VcMFbrxqvB9F/BoO6xKXvQq8wdFrewdcAUrWRPLFAXGOpthJoNSNoi/Hpz/wsv1VDfLTIZKb/yAxA7Em+2UTKzxB+Gq9O5mBg39k0dPFJ55Fa8/UXJGxmuC9lNI1s1sYbiDS8X3T6VMGD/qfVZHmVp4yfktvBfzYULf04MgolXPJjs6uOSS3I3hYzZRdTMDP2fcLBF7CUeCyEDqQRLKBUDhQogTn92kbyugXy4GegMnrjgMH4ZxhVXGseP+r9IFASls0mELHYVE9yjj31q1azuPm7kz69HzJv1AVAfvn8iO+3TcZXrh3Iw== 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=7h66DTQRqNJcB+hJcxsgw6qlvmi9huvV9y54VL+AoxM=; b=WBq4oT1h5mv9soiEBPX+bZIeHhcz4DR+08XuF2cOw+TVl654wvmeHzvVywccXri/WgEUGBk0SbsOlcop4yFYhFuoAK237HtKcDww/z/WVS6saRnSRF5rE3YUgdsGwDcsSjSrf7DcKlf2CGb5x3ykdLFxPoqM8qSDbruJvFb7m6l3JlJtIYX6PNlsjBv/CblIhddRiaZqlUODIk03J8hoFsiH+FnHbrMTYK65VK3lCI9hhVLchd8g8CP/Bk5zSIWYSbOXwlgqKRHib7f4VeYylyIBVZf1zmBMI9ZYG4upAO9jnPkyIyANy5qH/6Zi0CeZUY/O2pfy6aANwdQaFU76Hw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AS8PR04MB8344.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::20) by DBBPR04MB8044.eurprd04.prod.outlook.com (2603:10a6:10:1e5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Tue, 23 Jul 2024 06:56:22 +0000 Received: from AS8PR04MB8344.eurprd04.prod.outlook.com ([fe80::d3e7:36d9:18b3:3bc7]) by AS8PR04MB8344.eurprd04.prod.outlook.com ([fe80::d3e7:36d9:18b3:3bc7%5]) with mapi id 15.20.7784.016; Tue, 23 Jul 2024 06:56:22 +0000 From: Ofir Gal To: davem@davemloft.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org Cc: dhowells@redhat.com, edumazet@google.com, kuba@kernel.org, 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, Hannes Reinecke Subject: [PATCH v6 2/3] nvme-tcp: use sendpages_ok() instead of sendpage_ok() Date: Tue, 23 Jul 2024 09:56:06 +0300 Message-ID: <20240723065608.338883-3-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240723065608.338883-1-ofir.gal@volumez.com> References: <20240723065608.338883-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0021.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:3::15) To AS8PR04MB8344.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::20) Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8344:EE_|DBBPR04MB8044:EE_ X-MS-Office365-Filtering-Correlation-Id: a9a07f8f-8b68-46c7-875a-08dcaae48feb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: vkNLp526umA9Y1OxhVLT8gWxPi0M1o+VIACbZWeWJg56hlI0ZwRe+UxHAX+qWArW/My/kDfM1ZHM2IiCxn6hDKkZW2lKK5jjPyFy05+UsE8dcw0dgJSPVQuV9gUluLNctiqxsZC2+DLpLAqiloUDgUaqxo5NyIzyTU2AzPBpOLXkLLPZhX3uKCpRvZmSO5t8oWZ6UvGj1dif+ZtQhiUNucbtehIXTQiBiqqXyMp0LGHK/0LDbGpBT88pFei+TWAU6mPVwBEp9YM1VkQfwMPimfB+a8tsWL4oCfY+oMp6BXJYqYR/xHgenngRRSdGhRsc7xgTNDdoh0oO1G6PVe5HMHx5nmZCcU9j+6PtqfO4I9U8IBZmYgTYWoZhsngBcZVyvudmY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IPV:NLI;SFV:NSPM;H:AS8PR04MB8344.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GY6BwbkifSzL8MaoE1jq5ZHlrPhvQhcA2I0vGwslcutVAAcEUfchxq8r6JPFPGy5avZh8simr+stjixX+XmFVbMi8GispbyJHVW5shVXdrPGpS7tyzEfpVHxnZwj00enMKeswnfxLucoNaaaLMml3OI6wnmXjXMlf5GaS0lGVX6KBegbn3zTT3DhguFRBy6+TnUEJ6zhVllyfYEhy/Yyj432SklKoxx+Tzw+0Z9G8aaj8U7LT29+gxjIMHjYX4wF6gn/MvFgW6YNh9FLLDCyBjo+jrIRBQDzaeXYx2bekzYWgv6uJHrC/+FbuFlcIZlY8gFyALpIGIdy2p3IndtOdGUHhUWmI63jYO4SIt9ownjrVKfM+5Vo7RUsfwA514p11eFcmyjFclfXLkk6mBwF9MZ4mw15Ve5dJnfrjI2fVzo/HNEvKjeIW22tlQIOBtA6VaGVOi5j/WbsqjXuV9PiMwP02Aurb5ZwpejlaYs9ia93MDR19XuaASBKgXDDLcJs/NFPhDmwYMWMLesakfoWaWmz/FJ972zZzxDjEgsccVp4tYUG2iGBe42migKHH3iDo5M65N59ByyoWohQ/3bD3Qpg2gX1gF34/1OdrLoEAnNNS5CxsgRoZLSdQaKLb8xvivLwu8TVZgPjUkEFzH8d0TSrq8zmhqsK4JXnFX4h3cM/p3XVV2PdZUgBjSzBjMOlPO0P80Vyl2Z5tWVs8j6EEImmPgVkyeqwkwB+QbQCZDByvD52TtVIgfjLmsD62Xb+4ic2S/XcmJV/d/Si8Zosa3p5miDOpoFHmLc54Ud2PNI+e0AEIcIlRXI8kQAIiSLvONx4RGhBr1M/8yjGtZsDQZiBHf53m6b4jF1ZQZNKIO2Lol0q+8CfOR7VcbjyOGR3j98eo8mopk9GgbOdSNgyqg1GCaltfDoCnVjXRb2miHrrFYc2v7NlDsNDXne/riFv5Ejn6IS6bWAXLZcPhBLpykd5A/3yoY8DRxDJfFeLnCFTOJDxmyR4MnD7Ka+F52e+UhIQT8JzFPYdCTMNzc0heRKfKteX9ufKLizaVtHnz1MIQojfBNO/KO6X2smYzdtmyW/tZJApk0i34S4ZAalXQTgNjMh9FCD+JxA0c7PFewst0sFtCvX/M4mxCivR5kVoqEWEtNpksX9K3BOH2z+P7HVhvFkoZvjGIyD2cTtJbVvR+nZ/yeGKQLBWw5iJ4EfdKUjbF+PBWegT5HxAS3HmP0V03bAVLsrVBE6lTwvX9xj5KHhmPP5lM51gUoiEsvyX/LUslmv9Qw9uj/l0TQRuJ4ShVx0L4WNg4ThOtW5dNx8LbvoMg1nku6GGfhS/DzeKi9rXX1j5rkJONgn/OeNWx+iZj3SG/QSuNIXMDrFEe1cK2sLnnLSd9rCEtM120WHP5xbWRlbUvLKPXsVb+GBjVA9x5MhQoWb0ky1IlutF24n3K5ZaEqALdssIoO54mKmp2zhZlU4RsZqznu7b9rlQtmaPGs+t4uugJj0xg8Dj8NbvwU3mfYrLq7RMiLUD4ISFRrTtTB9PpEOvvAAsfUd91hWXCqcFKs7yeJctn/EorhMuF5G4mE8xCKpVzuVfgpOh X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9a07f8f-8b68-46c7-875a-08dcaae48feb X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8344.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 06:56:22.5553 (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: l5Pi4IGp435bA/Qn/e41xeXMJYHY8OwHouCpjnZewhQi5AR8WvSQhrEwMqU4vvPeHl+tEQzNOrt+AASgwhHlWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8044 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. Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Ofir Gal --- 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 a2a47d3ab99f..9ea6be0b0392 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 Tue Jul 23 06:56:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13739609 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11023076.outbound.protection.outlook.com [52.101.67.76]) (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 CF85E14A616; Tue, 23 Jul 2024 06:56:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721717791; cv=fail; b=nS2rX8TpH366g/DYRXBOPXaqzSPZQpeC6UbybtzZMdJnKPtTPQqzgXel0o2CLoWGArCy3kVSdn/PTkHfHgATsqHmh9/eClY7fqmIoKiiCJHEn/LJOjDWLi+T4XVQyx4it65JXE+s5aGIKtcpf6gdgtsbW+ZWk8XPhCfts6UjeUs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721717791; c=relaxed/simple; bh=q/4FhTcQw8Ct3qXSg64D5CY8N29ave52dAbM4g5K8+8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=SR0x2DLjo4brm0PAP5o5aXulg/kDraMXhcjwYFh7zSlOBeGY/K9FST832eJrEBjIHKTSmUCtBVMqhSvFPxtnFXMX+aoGPp1+OCZm+mnIwR2BFZpbjNCnAVjg68jSeSA7SeV1G3a2uKzoMiTcSNUg4urnvO12byB6v2+LY5eHdgk= 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=jQqDI2ZA; arc=fail smtp.client-ip=52.101.67.76 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="jQqDI2ZA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hpaw+9uMWMZPF8Y38R9Se+n2e2caxD1eTNgiNwG0MyZnd/Hhek6l+cLs5GrfSH/gKCogB6UgQQq4M0TEi6CcKbf3qL/S2KqWiO10vslho9JrlNIgvBYBFjz66RxVJr0AWUEBbgIjW3JhC21di3gdz/gWdfeaAxEyppg20rTchm8cKt62Vdl0GzCOd277jj9di4Fwgpbj9mTcdERhf/Md49cxrQg2R6pK1k7krA8AvPX9sg0ser6Ubm3NO+dSjLO0+tCZGwYGbt+Q0HbokbuuVUCURXEP6knYaZZVNZVTLG6MdNRp2hxR3ckwuQYqBULyFth1Hg4sHFIxwMpTj7lPgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=YZ0tWBiQ2iqQ8K+UeCzLmCv2laXrL4ME8WggNX5AW9w=; b=VW/onWWPBEUyysGXhsYtzpg5OQclUWaMxrPp/ov/iyPLSWoAwU/YfWctg9wEB8Q9LN1tMVU07RppSBQAdZvSS4erTYJJ0euJrG+0JxbKcWxiTwf+mCcxhsBX6lkE0eNYV8VkvJe+9ASGLRTtJy328TpF73+TvPdVEpF9mRMu82G3yL4b4wQaNELGnbREZTkkL1v5K46NmO0o8fQvRKCeSUzU6bMklzvBxKi+UdAQKuiwrkRGHveDHsvd9A/JEmBZvcTMw4HVLDFY/yJU+DWaIt1Wk/eaALwADA6tVS8T3KIwCENgiLYHKn6TxYkzC9l+28owrRHZl7JXW/ECmUNHug== 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=YZ0tWBiQ2iqQ8K+UeCzLmCv2laXrL4ME8WggNX5AW9w=; b=jQqDI2ZAbicn8JxnRl0z0v0EgwB/XtvmmimVbNEBCuexs0i5N08MWndQIvxjml7zyRBxhx7KuVT2d61M9DY36Qey9T6vSFPOLu5S3dkmEpEj1M5cZUyodeBoU1lceNQbHOaLTjQKorD38OyHrJGt9E36M25CQtgdOqgvVlmfmL5TVS6dd4H8JDc9anCSWDpvAB50zNfwzykIeMSbgSIpYfEVHLaiO1w1mzvVVPOb5CbKkNl3GO4huO9rFYR5MN2lvJL1C+bPMoc90QtfJrhxfr/OrD7k/ypFVQTy/OuX1uSncv69BELNGvyBAaAlHzxSLwVbB+BLIPo7j6DProYpoQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AS8PR04MB8344.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::20) by DBBPR04MB8044.eurprd04.prod.outlook.com (2603:10a6:10:1e5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Tue, 23 Jul 2024 06:56:24 +0000 Received: from AS8PR04MB8344.eurprd04.prod.outlook.com ([fe80::d3e7:36d9:18b3:3bc7]) by AS8PR04MB8344.eurprd04.prod.outlook.com ([fe80::d3e7:36d9:18b3:3bc7%5]) with mapi id 15.20.7784.016; Tue, 23 Jul 2024 06:56:23 +0000 From: Ofir Gal To: davem@davemloft.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org Cc: dhowells@redhat.com, edumazet@google.com, kuba@kernel.org, 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 Subject: [PATCH v6 3/3] drbd: use sendpages_ok() instead of sendpage_ok() Date: Tue, 23 Jul 2024 09:56:07 +0300 Message-ID: <20240723065608.338883-4-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240723065608.338883-1-ofir.gal@volumez.com> References: <20240723065608.338883-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0021.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:3::15) To AS8PR04MB8344.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::20) Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8344:EE_|DBBPR04MB8044:EE_ X-MS-Office365-Filtering-Correlation-Id: c4a455ec-78f4-4893-3656-08dcaae490c8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?8hRMNBeZHXgaygicF3I/rCJgzrYzSzd?= =?utf-8?q?uWA593Fx7a4fwOsVmvqTiakzUEBNSpu2+lloPnT3aKa3YmrMZp8bXYFNFrs7GVwlL?= =?utf-8?q?7C+EhM40ugtQEPq4m1OkoNCN/mmgdd1qI9vMq3bzeqj3hEGb7kwM4/W9/46MGcW+E?= =?utf-8?q?o+leHRC4hTKA/zbicKeHdvbBuGNoUaVQ/f5NZGkmVk3lUoTVzormWSkcRZzfjJVCC?= =?utf-8?q?dQ48PHEis16Oz+powEdWJ9Q509PfdO5U/lkLgeQ461OFAkY/DDmeLtw0M3Mq/5vTE?= =?utf-8?q?MmhuUKEHQo6PF6DqM0XSqyD7ifDPE5cw4PD8Ob+f8PIbiOQAsnsfUhMgfRNLoKUCg?= =?utf-8?q?UnHb0JC8c2LnMv7IOKRWrGhTkDENEHmtL3no+ARXZEqv7WW34fCTtSAZrJ5wA8snI?= =?utf-8?q?Q5JKy5KT1O/4+rt5mXXCcK6HxP+i/tua0wOL5ZVjVnU4KW3/EdBKZIlZlpOB7luHK?= =?utf-8?q?WqhoHWipFQlQxw/dybv3JSYjX9QPghZ+6xjijOIwWMpukUuOuD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Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8344.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?DpvXVEBuDoP6Gsl3ca0/cqktl3Id?= =?utf-8?q?OFjJq4e+Et5+gOPrjibWxMJbPrnfPuRqjsqwqBUC0V/OGngmuYUmjW+uwzxBROqtl?= =?utf-8?q?WQ8a+W+K1t04ugTvelQHiyv0gmfvCQXVDTqn1xd+0kA5dLsJXFp7HT3RAygXCaYdj?= =?utf-8?q?uAPPz4h2pbJUm9pypoYUcOkTdiYRm5IPz26Ff18it191mA/AiMQHl++2wpto+gEql?= =?utf-8?q?m3SCkRlFGXg7ovFhXSpD246yFWyPaObOMACvj/V5ur2YUAMJL7REfwzls81D+ag/P?= =?utf-8?q?1IeZxKocT5qB/RsSOYll8NUFq2PQ1KuJVA7eKT9Avp9XcmRa2AtlYsLD6Y7ThlAH8?= =?utf-8?q?OZlRgh4DxJsa5FLa5MfQ6jMW8BLZ9JZwu2oiGPce6SK3xH2Rh6v/sKV28a3SODEX2?= =?utf-8?q?QTTVlIeIsCtXWEk4ISodd1fcO0wfIyXI1uOD8hwOqN/wYAujzlYEVRNnX8Io6+yYx?= =?utf-8?q?hqiq2xhBRyto/x+34EaErZjnUJy6rr93jnoX5cvnX2kShKAkSMUNPHuOjwnzS5Urh?= =?utf-8?q?c8HTat7mCJ+ybKluTgQadYT9htb9d+Z7Hhlzbl3JkL5bvyvdTaFNtZL6sKpScmQCj?= =?utf-8?q?4Wx4ZN6oJrLCrz+JveAlBSMQfeZyL1mASRuxHPueNLdh/3nGImFBabUJUIlQFiALi?= =?utf-8?q?SPo4ZRN9hJf4QbI2II5Q7YAbAZcjDCsnxNMz6JgWh47ai8T+XKfTgCg+K4G/EXuk5?= =?utf-8?q?uRFEL+uE69WlH6mkFK1erUQhsu9d1VveHMorp2fVW4e32QXbt3zW/kGoOoJphhJTT?= =?utf-8?q?bjkiRxpNua39/4QDjk860WJ9TyKNNmEmMJ4wWs24wHWCvYWngznp4bNDjuLq1KMEe?= =?utf-8?q?/hvgAuGGHAUCtyHpmcSssgP0/nuR30/NJ0x5XG3+hSQ9aGmPDkH6T309FI6XIWj76?= =?utf-8?q?F4BU6cUFnpkvG93CFBQHJIdNmmmjXjOT8IB5pceXBvs1nojjTSirqmv+4Ghk3DH7Z?= =?utf-8?q?aruqxQwrGiZqkB0EQ10KES9ed7dCRJrrjPFlN6eNJSqaSthH3cPnTYKvL/0luEhKi?= =?utf-8?q?lcnCRaF1YNSo/a+cIwCbcUpJGevSJRt4vjlAezqe7BWLofIZ98FN5T0cClnEKvRgX?= =?utf-8?q?m7HDmDUpXPtRMOkHtJ7SXLUBNYW31Da4AodoFnrstJuX0Bq5a2zGBMEa39X5BVMBP?= =?utf-8?q?j410+0rLw4kL9Y1iY/SMdRGzEp1iovM9QPJkdeKy/155BgtXbcAZcFL+eykSAeOpi?= =?utf-8?q?UJ/UvxKqCMFbjCNm0NTR+8yaRIw1l0wmUoF6HD5xdPnBg1O1o04vcD3WUZWWIpASO?= =?utf-8?q?Jc13liIUOk82tyE4CqutPeI7mthmrsP0/h0Md0hzbRNIsDTvKbVySpacXuISoYSbx?= =?utf-8?q?qBC6+m53BTlZL0Ne5uwLW8ado/bzxE9kL0CWbRx4SUbu1dBRXoWj7ZsRz4hWaZUCy?= =?utf-8?q?pZlMAUmHSEMzaSQlsQ7md1faHaqw571D0tMroME1rds3qJvVo80CYXWK9u4TCrVPQ?= =?utf-8?q?kJIJHNPjr0L4mM5XKE3ivM574h96AzWAdlGJAZXBIHdkI1NAIqJpXgrVsr+7jwsNC?= =?utf-8?q?jtZL9OE6lu3u?= X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4a455ec-78f4-4893-3656-08dcaae490c8 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8344.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 06:56:23.9036 (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: bbnasO5W25erGYPS2lkUb8g92aHINibf4xZjIJfUyj0Mjkxs9L75Fq8pJ+YUeSoPF+va7vyciB6JIdRd63AhbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8044 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. Acked-by: Christoph Böhmwalder 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 f92673f05c7a..3d02015c1ddc 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);