From patchwork Thu Jun 6 16:12:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 802030 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2115.outbound.protection.outlook.com [40.107.22.115]) (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 18A82947A; Thu, 6 Jun 2024 16:12:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.115 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717690361; cv=fail; b=B9jNr3A//03QCswQif6yvFeq6uVcPJOenS0sRQRJg52locyTvDQlMZK9Ati/INUvN4gHDAHfamu+gaiMdsQYHBrMmiOhSEAUHe8T1ffzbCs1W3K2UeiiseI2zYlEQL8K45W4LBzzqZjVCkaGTCQd3vcJaU8w0axBwwX11GtZguI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717690361; c=relaxed/simple; bh=+/CS8USn6wiB6FaZ6ooyFQf+NWxoxcSHGKvL5rcyZcA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=etzyTD5TD5LjU6TZ9Xnc66e0QSy8f86wPgyRMrN5GcbPvxdTTxm55c7N67NIjOpyDeFjzIJJh+Nlb85VO5qKg50400KE1rvIkFrfUbdYO9rAOf9a2c93wl4O6rGM8X04FyPALoKMgvu0dYPCt4rjti66HQCD+t54KXZKoLGZHNk= 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=HnRwMqYX; arc=fail smtp.client-ip=40.107.22.115 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="HnRwMqYX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l8TFrB5JNyhttNDjLD4iHD+1Ch1MYvCereAK1Daz/J6yxTvN7MRjGyiHAV+Yj5aKIhqE0m0m5QyPa7AbcUXX62GFL5TgarmSdiWP1rD2LXQXobsyLv+fJwN76PFblQgJoFey3GTP8JbYeEW4nLrt1NuIwXwZtHrbkSFLPTdsO30cosV2VYXTfQE96Aa0mIOode7sZhu5F/p3urgSTekFufSi1NpFOY+DVc23LMY0/1LSiBcr81GtM7sIZlQmlOuhc7xRcsbN63Sc6INpAbKDfMKXigv1SHrx13ysmy9qsSx7otMLaRMmp8Fj3GlW/rX4se/NPJZKmfL4Yt3gc+ELlg== 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=DhHgDslOBASD7s64P5KfwTymBRlfINLihCyBsaaDRLk=; b=eEJGofUIagvpmSoAD6BkIDf1MdNL1K31hDCsACUgXMvJTTbQY/kTVeW+wtis3qjRqkOcKbEKbbXE/BvbPWnbhcsbhGc9r0AQ4lojjzIo5gDh5q8LLWejYLYEwVK8tfniShVoEIgnJkCWLr8Hf/nEU/y1KClHCXGStzIT/NnOxnluJDy+tnd8+dh7OGFnKOZZFCp00KfSgxII14Xly0VVpnPDBya0qr/gMnHEnM4WQnejCLuDyR8SMCzFJU+sYZofsavjR1F+5/qY1WoxCr9rKNRdRZBDAWei50KKDYF2I1TwghAEVRYcOxQ1VypzxVFdXU5lI/cxae5Ey6PosZACBA== 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=DhHgDslOBASD7s64P5KfwTymBRlfINLihCyBsaaDRLk=; b=HnRwMqYXN5iP57YmaMMTgARS3eDndI1Uz6cTEfkL60nAniGpLJWyMStyJUGUIe90AlgEz1u60+E6SVYE8to0YVGZ0gzdNSp6zoUkIa98lPrnIko5Juoc2Zh2gYNYfv3Jfdr34zCXQ4XxEfk5wcycypyRvIAr5GMXOFtZ8xgW5dpwL+zgkduuxIC1U+O/24ag295CWJOmj4fbz5vKAOmGhnSsPUJ/K/dx55uyIo6m2wllTLIHF/zwE3za/vCVS2w70uMK5UEqHdl1DHEAGFAUP+tHfcKBa5P6urD+hblMXLqvCYvzcuwqL2+JF/ZgLvmN/eAtudnBkTzxXkc+1YxWyQ== 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 AS8PR04MB7815.eurprd04.prod.outlook.com (2603:10a6:20b:28a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.33; Thu, 6 Jun 2024 16:12:37 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%4]) with mapi id 15.20.7633.021; Thu, 6 Jun 2024 16:12:37 +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, 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, idryomov@gmail.com, xiubli@redhat.com Subject: [PATCH v3 1/4] net: introduce helper sendpages_ok() Date: Thu, 6 Jun 2024 19:12:13 +0300 Message-ID: <20240606161219.2745817-2-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240606161219.2745817-1-ofir.gal@volumez.com> References: <20240606161219.2745817-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL0P290CA0009.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:5::6) 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_|AS8PR04MB7815:EE_ X-MS-Office365-Filtering-Correlation-Id: 9495f9fe-f094-4370-d8a9-08dc86437baa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: +XKTzYWFGIukks25OQqVp53B7+PK0OmQJFA1IXBK2QVw1G+c8iV96kkCfqCrL3mESWo0Ud0sDD9g8wTFZi3dA+ot27IuFT3q6u/WOHUpz6tX3+SejwiJKAABPDvhgpmFvIb5tx3xJRgUoP+BBm2d5B9QNd+O0vlFuoyrJP4h/nG9HUhAK6vz9+W52gIJHuuraruOTBMUD0eurUHouKdsfjYlW1S3/8Ka37E3Y68T23w9Kk4yKkBX1Yjs8IE/uNmZB60D9Rm87VBcM6Pzbs1Y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pkg+TBK6zLmZLMjLwH4eEXN3k/n/eH8zQ= 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)(7416005)(376005)(1800799015)(52116005)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yt5zKlB+VUpDVLwyW7Kr+roCIftrJWXwCOZHBcAJUQCsShpi3DBL0tVxme/mX+Ykq+0BG3A8jA8uN9o/K011akwwpG67V8GXw9xZCjC62qdZVcTk2mt7rH6m/rKmkmn09yY/r2HquOYC6RRqlfJIrnHUa98IyyF/RKuqrEw1NCnoshV/r7YigDMXYiZHzmfajUwhcUh+mwH59c0KplSF6C08f3Al0zIjqTdtxUrYl55hsIgOJWhGxUGrImSWHz/n+0RBbbp8m2B+/nesuNdsXF/Lx9OlD70ZaY0PBiAgpIn6sKVAl9WZnEd1sx9L+s7Ko3tXWSoAmJFnru1MIVYOW5kk/v2e5UXwhaH54v77ggrrkruyTjvORF3aXI3ZnAKCoG7Jm8maWSjw0A6x5nQzcGXj3q/7B8ZuLUxm5L4mMJzRgpQGIdHXyyGlxwu844tF8cm+ijFpaNFdZ9gPATKscAP3DfMeMqKoUaJ97ApwY7MJvWqfRMey4zeLCV+j+XpCuE9Xe6yZxnkeBJBir4i8zoljIWjwNmZPfXks+8G/r5Uy6p17btx0ewdJxAdJBUIRCkZ6PRtyxzTT1bqIxuP/T3zvx08QmmAFotynjJL1TMYbLMXxkilcFWkXdxULaAaXQKuVMHfopKDGGX19Cu5P0RH7ngYcG43raOXgocisNTwNLZXLxhTPMBeX26JJ9Q++DS4Roaemb+NRmpXPabyceXfX/jYA0InZnRYNE4FumvdM0PwzhuwuMbBB1Z7zxPo94Zjm0vUHgyEBIxd8TtqRFuhaAzJyv80qbz+y0B4PPl6DL7dSJ6iFt4gAtfUqBlngKFsxxlaIwTw9OW7fXVCcuqZUV/wKB2iS2dTG9EHZ+0LQBxUKEcQO1HoTYeY3caBc/K6lD0VlXl+1zHBbfq7XN5xvaOBZp/fBigucRs18xGLJ9kxXOftMAdufxcrzua3xdpGMnry5mzgY2rWbr1caY8rGd4GxVWTQAZ7H513GwEyzvgG80/IIoTmXTILkYmjW/eZGilCLB52stdbJWPAnYk0cp1J1x38B39KFZSE6gDg+rZSVbJDJz4NGzRcWE0hLTbV87TpSvr6hRKF1OHlD6Wrp6Z0ZhvI0NAHyE4j249V/z1zxIjGeyaMghXcGWrcdw9DEa5A+QS1zjtrhlGDFoXehu8BFkSnbl3g6XljYwa9vxD9wgSQgkNt2x+Gcq9nrj/vYpZvNJOuRI6uiMjK61OtMR5fcmg1KhxgPI2miJcmUvDDyZHRxmH9R+RwREWoghUG/KSqRaIHwjxX9/s+BAYrSFExD/KUgCWPQzcrVt/XsSkHv6jSgFWXtb/lfoS9xOPVvwL131MIpUcB6QjnKmTA8H6JGeu1BYZdalugnqzM1hYkAeusP16e4WohXIrfc3sOsAukiV9n/9w8Jn7/IvcjDonfegJnIiYE91p+1KWVqQStvylHvDSTANzql4/G+BAD6gc7cXUXmmurnfNkrLjmBSgGl/QWoYwxeC8Zk9+D98WaMDNIMHxqULRytUJpV6g0CLLGvHuNQNwSyD+39mZOIAF8V7wfDMB0ianROLLio7j/bylEo/4UOQZBtwPAZ X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9495f9fe-f094-4370-d8a9-08dc86437baa X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 16:12:37.6557 (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: SDSTf6hIfi2ZUAOtzmEVi5AlBH7LHlJRL+gpMgPwGIuKvuRF9TPx90IezFHwD6kvmWv0VWeaKdyAJsPrk/vwiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7815 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 Signed-off-by: Ofir Gal Reviewed-by: Sagi Grimberg --- include/linux/net.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/linux/net.h b/include/linux/net.h index 688320b79fcc..421a6b5b9ad1 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -322,6 +322,28 @@ 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; + size_t count; + + p = page + (offset >> PAGE_SHIFT); + + 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 Thu Jun 6 16:12:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 803266 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2115.outbound.protection.outlook.com [40.107.22.115]) (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 0A6761990CF; Thu, 6 Jun 2024 16:12:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.115 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717690363; cv=fail; b=ppsyrneV6edzMBeYEFtn+kKJI1TSoCc/uRZnbEA+sYLLd3uvqRwyVQejNtqMSf/TxO4ypxrve2Y9ON0Yas2Elt+9IbGIpzASOC4RrExwnlAyAspevxgdnKCa6V2IqaWZizXXilnPdQDgGtN5yMc1CyyFjXVV43ehCgZ13hDR2mw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717690363; c=relaxed/simple; bh=xHoxeibYaof2PZLRkUPOD8YLGXSRfep+S9+C7JtLqzQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=tLZ6RE8Poxx4WuBALsiQrvUzxNe1mL4cYwrRj5LoAsEwC9oB4oe0Hj8t3QSENiWEGXze/er2eOQOt4jKwkyEQa7ZjrQtSwrOOzn9phoYcNmWrfRXzg0p0cuJNXsmJc+CtubRYMdl6hnxwD3DFnWIhPfBinTYke1Qu8gVjZLbHEQ= 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=WlsC6oIi; arc=fail smtp.client-ip=40.107.22.115 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="WlsC6oIi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IbdQkB6PYKm1kuCLm+8TL7CNSJ2TCshHsW+sH9KCvIfYIqf+0Wz64xV4MYEQN26RTZWSl6GpPUaCSiK5REXBYCTpkjyAnTwTCdCF2KYbO28Fj5qEXqtCarhQQ8Ubchqpc6bTjsOR3YpdzLA+aIMlEYfEe2oi5XvEjLItPFMGzouxYzhLc4J050wrnp0LgV3DIZcQNMZCDTv/u6DQXRQZXcaok4VMn0OeUGJngxTK9IOWI7tRQV3Qoi6RZAHmSgs92svgvLpIINxv1qzeJ49D5SwOrOT0zz39QYDhEzQ5xDvGlgDHdBrndj366Fduu3h20uXyrn2MXnsCVB3TTAFx6g== 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=gR9RZ2XAe++YKE4yhZYyM3HdbhJrpHDV7vjsbzCN2fE=; b=OUUirCL85cLBSs5OEfoStzR3JqSIBKccfv5WKGCIbB2CfPhcd2fjabXrgI2Pl5dJR+3u7xk7RnPQK0BBmqR4k2GIAMDeP9VyM6YL5kf5SIcdw9GcPXFkTniALBho0sKmSyDAXy7Qu8AWNr678qcMI1nzX8ne1ltoaqr4Zbqzhh+kVozMpho8hMop/35jWGTXVNmxGeLTUBfCuY7nwwpxtN5aujGfRw4V6JCmoanyhDjzUquRFZ+spGysurMQZ2PTDu6N7zWXIEt9ZzFS8axhxhZcDWfTIrdFBaXmNL5Ig+Vb8xiq73xrbpsUeN+D924DkYygFAbgQcoiTOk4aPHsmg== 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=gR9RZ2XAe++YKE4yhZYyM3HdbhJrpHDV7vjsbzCN2fE=; b=WlsC6oIi08M8SvaWv+nMVCEiThcDw8JBfc4EpXlNMKDsHU2+jIYRpjYUf9PBjuF1YPPycF4vgnuhg9SO3QhSWYvzntARO8AUiVKXXbRvakWRakJbtKN24jlUm40l+yvRYk/hv4LsQ1CrLm+zOIhfSV2qWHrojxH7sw8owBfsEehj1I5w9cMarhbQihua+UFA8AS4W1s7O0rRaCUCv0ZOhgJ/zr7i05ZSELIiqZSJabQHDZkw70ERWTxXIkrltfsfHQskWRCX8uyCGj6ATzXXrhLpq+e87veNqDnVVsuwqQSaltgoS2sfSl98XpiSnI1v07w9sRYe6JFtmmzvMmUwpw== 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 AS8PR04MB7815.eurprd04.prod.outlook.com (2603:10a6:20b:28a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.33; Thu, 6 Jun 2024 16:12:40 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%4]) with mapi id 15.20.7633.021; Thu, 6 Jun 2024 16:12:40 +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, kuba@kernel.org, pabeni@redhat.com, kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, Hannes Reinecke Subject: [PATCH v3 2/4] nvme-tcp: use sendpages_ok() instead of sendpage_ok() Date: Thu, 6 Jun 2024 19:12:14 +0300 Message-ID: <20240606161219.2745817-3-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240606161219.2745817-1-ofir.gal@volumez.com> References: <20240606161219.2745817-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL0P290CA0009.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:5::6) 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_|AS8PR04MB7815:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ad05692-f5f5-4f8b-bd20-08dc86437d5b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: Oa8CILbqAUz03+aKsStymH+zp2FTIU/BzjTFb3L3eivNDwfFj6/8Xu/j5tGKE9Oc5bZEPdW9obVv/iLbkvb7dEoCByihmCNKKh/1Bn0EMkIuetl5DtpYPMCRCrDuP7ePaZM+GAPJxSZ66gQkNZJO9iOBXtTP9x7MYL4a+U5a2F4FuBFMI8+q0aKTDABExvd3KuXGnBgFN6Zg0G7vZ1FfFuR2v5IUPN/8Q3jOwPjy+KxFHCpWBu/x+BnK22d+RyrGVZV7GAc/p5x4byudVm2EBy2ZSM00kzg6EZrLXATIZiJfGO9UorPus/66dxWGpgx4XzU1oKtR1WOQmow3qVCCzkEQdQpggbt+5dGRRA4G8GQ2x2sjIA+rN8vPWb+bsNdukx9gOLHKioVTzGp33hjTo28ooCcIlE87T0xqAjxXOGo/smp9i0Yk/+oGESG+I0smZKNLZ/02TxZKXLKV99jYvesLbl+JNeVAiYIlEnyhBH7QyunUJL+z9XT3Yvk9iGui/DgmfKk+ADgCA1mVdKexJCSkajlZMmE8jn4adL9xe0ZanOWCTkRW7IsiEFqGCAAV81KUpFojgXrFfVE7MMsQSPl6uzXRBmEyRox3OAIgBrGXr2JNpST/sFfE65e30kzzOWgwHnTMV+5srePDREysG7MPDch39VhDXhzv9tHWmUK105yhwNTOIMGvlTS/btkICsw0Y4DDHxPKTjk0FF2JQO+rl+Im5B5c8sJ6YMOYnaM23v50MttU8a9UBOepIYr9NyxbGFax4MO7mEjse8+6pO/9R9cZeXGUS/951r93wATChP0/UDS9jSHd+BQ1QnvSjO7nQLm/udAktMTTBCsJMrf7nGUjANg07j3bsowfbzGL9qBiNNRyZ9cgMjDtetg2VvrqRU0Zz3H6RzeUMhUnE7ioEHsqmHXzgTfyFCfYX6J2hK42qWfI13Td3A0OCseqV+wrb6XeGD8dLQx0PbpemF/kQv9SDA+YdFaYSRMFcEVIqDCl+l0oT+Op9XwK4dn8Kt8wgoYJF6ZERquZ1zYN8XJ1tJ1xc5b/jmcC6wj5M6aWhQF6ZRFcF8Fx+whCfuWL0qJf7aoKkRVvDRTrRBPswfnyuVvN+CjLE/d4cD30UAuB1PwIhTuPGBmTfXMyE1PH8AXfTEwl4yXZZYOKTNs5pXX4y0YPDhwVdjRhftIx+IIU6c/NMMnAepp8UOEvihpNPhbPBx/FuD6DsEMPEsnItDSJw3luzttxgrypdrW5eK1BSS443TUWWunG0OxIHDgb54/cg1pkpZVMo98s85OOmFAx7kf5/wy1jH01tOOMgke53gog1sTDK85JjrghK+/iN2U4yq9dTSLsJai0pSEEjdWQK/8+E51a0fomcb7xSOU= 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)(7416005)(376005)(1800799015)(52116005)(366007)(38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pKZQMpk25c36GnJvXV2I69MmSQSRV+uWSd/BnBGgn+1upuyoYDou8PsaSRFvVM+2KuRjzUscrsPC4vkJvZcHLtIDVb0ccYeVgD6o619KuwKsDCgiJKbUES0mG3gkxOatbbcyWlKMfAjkQtfbJvVSjeclooQ10PjsQgjMi5IUOhHXzqd4RSDimVkSqKlF4WeseTZrKEx+vdd/M2fSToohxCFlU5yd/yuGN0OTYnx5ufnrmmoPMPciTZNVnaM5pmTpT5B331TiM3feKBm+cuv23aDmyoeaBJBtAFFicytG/Y5L4XwMKx/yMkpGq2ADx3rTWU09PBmeyopP2mWR1R4a03dF9ug5+5/9tWgX9C5cMnCGFXi/8/JPcQUcHOBQdIc6v378w0NwAW//Lm4NuOk5Y6EEw9a4ZS+bfNjuaU5BK5NyZlEoezRRQlMdZMabvbaQZl0AvnJHv7JSIiYNrE6NVxXg2Bzh6tQsgm70KdH/QAZwiJDG885V8jwUJ1KNwYBqG9tRI10MqC0rHSEgjglWtqQIwOlPYrAmk44dyVtxpxo7MqRZRtQCerRUJmrXD7ExA6NQojmaGC1p4TRm1/49dY4qnRwwj3G1elAbHQF4V X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ad05692-f5f5-4f8b-bd20-08dc86437d5b X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 16:12:40.5508 (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: c7fLwV0+sJMNc/NVA9yl7xejSTjlTRlFkVR3DCWH3mHB37T5yOYVgVyIeYVcGtsIKr1YkEPpDulv0pwi9hUmvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7815 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 Signed-off-by: Ofir Gal Reviewed-by: Sagi Grimberg --- 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 Jun 6 16:12:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 802029 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2115.outbound.protection.outlook.com [40.107.22.115]) (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 005631991C5; Thu, 6 Jun 2024 16:12:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.115 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717690365; cv=fail; b=WFCbQJniEEYoq4q4VZWDU7BZXKPnz7+BjgSe5ImsUuyY3fZ+RWC6Y3XPJZX+jS/1mpRcoMP5njg7JmuNdunu4U1cxHAPTCUUKAEB6OrWO4COQuCDfg0rnHxo05xu0XCsnFQqd6oHMAIaKMic92O58Ag0f0MBSXuTTIPUXuNAOpE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717690365; c=relaxed/simple; bh=hrXyDaUZD5O+KIuY6QI0GBnrWAENZW6x0xDSGwfPjoU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=q8LSN1WJga4iPfZHN9VRyyDNi9RjBGW1H6A4zwzusPVyfqRfNSkQukJod+kRq1gi5TXPyAO+7Uz9/Mc4qxwerBMcvf13qbH5UaeXRW3FZ8ff1Y6ub2rErZA7Att6b+/Sfh7pKwJTFjRrDUiBZLJn2vddGxzhBH+d0z9YjfxQWog= 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=guqWz5Sp; arc=fail smtp.client-ip=40.107.22.115 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="guqWz5Sp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HuwTf7whzjLoquvu9+o8QKauz8MH5WV9dH70wB1gIAMbBgO1hjw5kPi3KGXkK1TsPG3p4qYpGcRwDiQ3jCobLRJR1k6TC+qWzjygG0pXcCcvpS3eQEu6QFugEC3DXwsRB0dpbeNpKAWVNVc3o0PrZA+LqOQ5LtUdYOI/JyeL0sNDAl06wp2IYyEdsumKrieG3FU8WlUY4JcqZUWygAcrmLvU9q8RNyfwq80UMvRq8CDkEACtadbGTMzAlZDTajNrORh7JlVzjAfJZfKnN+aKuie5q39GFIK4twujvt9ySgF2TZbKbFedqG1jnWbhOohOYMaO40DyqDqMDhhBB18Qlg== 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=427ibjUET2vgiYD30TKQMjrgcTz1GT6EqH2o5uxTbbg=; b=dLAFRpUlNHUMLrQ1i1dNl0at0kVgaFBLdy+yPnJ0TcIXDAxA+oojD/ZFMrdb1k584/ynG1zlooFGAC2cZ78YWXF8jKvhMyjGz4MvDzPV2Y/gOITd8Xh5s6hfwl7Prpext3yzo4Zd+/dGRIn3TcjtlzBG87bgJdQDmCAGscZO2yiGMcrxGxIalBLn9POI/9YGHWt7SuWHVbEJWdQzmK00kjM+6t+HP04wKTF106DBitAARM3BhZHOzTW2q264WYCPcypRX+0Om0wvVz33LiQs3aQuamAVvElozZmwU1ipufxoLHHW1touWMOrSOtcqDaedDOEGcNECbGLsBCn1io2+g== 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=427ibjUET2vgiYD30TKQMjrgcTz1GT6EqH2o5uxTbbg=; b=guqWz5SpW0uhbmxgZMNSJ8WrbQlOpJEye/vNy1PTu2bRw7Qyc5U46te1G9Qw/AV3MkSGagw/PIEjo1FCOOTWh/43kKpcobyHrxJhk6nBN1ZBfoRYMMtU90ObYquFre8ydCsaUrWhUfyNshimwSzjjeWbjTC6VP1Wx1nDxhOT1bOLagUOijQ/+4hSCpNXkP3GAKPOAcg9eaww7hobczDMkg85hFFdTs4R0s5hX3h6x1WLfcflR8fZk+2mvXm4659lVZMJF13tnm67H3+lP81d89FniWqqKC6+SbflzeQC7MApI2Km5kO6abCkROxCSf6ndOgLypYssLD3rUTi9crCYw== 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 AS8PR04MB7815.eurprd04.prod.outlook.com (2603:10a6:20b:28a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.33; Thu, 6 Jun 2024 16:12:42 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%4]) with mapi id 15.20.7633.021; Thu, 6 Jun 2024 16:12:42 +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 v3 3/4] drbd: use sendpages_ok() instead of sendpage_ok() Date: Thu, 6 Jun 2024 19:12:15 +0300 Message-ID: <20240606161219.2745817-4-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240606161219.2745817-1-ofir.gal@volumez.com> References: <20240606161219.2745817-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL0P290CA0009.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:5::6) 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_|AS8PR04MB7815:EE_ X-MS-Office365-Filtering-Correlation-Id: ffa8393e-b4d0-4f63-5a28-08dc86437e65 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?VP4zlff6d8P4Q8cffAf1XxI4gn+AytI?= =?utf-8?q?bKf27lPFMmfU7G4lHQMvD7WcFUIQwaCUU5cSWiVFJ1pHasRrw0f0r05zJY+AiNuKt?= =?utf-8?q?jVh17Idl4TCF8DZbdYfhXvL/XH+pQfBTJV7umJIQ/Ta1Gi5YBE6onNXyWuLMHtW70?= =?utf-8?q?vTZXMkmCyTEGuQpSQsd3kjzzOxxBSRzo49IXX/iNZntruxen1jAHufep0dIHu5cWo?= =?utf-8?q?RKc3uiWC2W0ySY+gr85VmFfslKXEQI8sbb5dojretvPgdTHVkNZK7MbzK7Vrg3zRW?= =?utf-8?q?rlBbm76J09gUzFaVINFEpnJoxUs1griF6o6JD4LIcSD7rz5BpduKsSLeT14jX7XOu?= =?utf-8?q?/YIwrCd/nShuWqkelyhNNDsdsMgyMHbZHpTUZSexzNC/p3jFKjA1tZRKICM00cpPv?= =?utf-8?q?OasUme10jG6N7ZAG3QKaYL7NTVKYXvp99Uo2nzUvXSC9ZKiB1WwCfO5PWQ8ZYvS02?= =?utf-8?q?For7La97dkabEfFf1emZPuPlTgCx395C8lhUpvy+xAQgSdDH5DOIX0Y58fsfY1Gmp?= =?utf-8?q?khCisvIxR5HXjEohHYerWn9S6I3IZD9WLe5CK2HVWH3k6kY664Xqjd49Z821RwM1W?= =?utf-8?q?1WIAY3nngV0SwduXW18QR7kwvWzsoL50NFw3QIyqAfsCe0IC+7JWdj1ixMzd3o455?= =?utf-8?q?CZgUUL5GYlcTGgKBwyFFBX61kChh/Pv9BfXuIWOzt/yNNePlxQ6zQDHmt1fFZdLso?= =?utf-8?q?Adc7zgURz+iN7C+euQ+ojWOMaoKgnfeW/CiUSp99rJAd375oFxahq7J1OJj1OqQdm?= =?utf-8?q?Omgl1PDeSbtMEHjLQK6liuh644H5FSWw1IWJDX+5vBtrgQsij5kT9rpO7ZI83GQc/?= =?utf-8?q?YQDxLbymhLIhu7/uuJXghT8VCsCpilCM8moqEPX13lLf6mlGET1oF4hGSJX7da2L2?= =?utf-8?q?q8nifkcLt6PGX7STCaBhU9DRZIPkENjoUS+5s7hUQ+vuJqFNu3e63f04eymiMzotE?= =?utf-8?q?nuvJIT+txWQNemtrlIAMCuFC4uovsKzj4MTta45km6Feq45uA1emFB5c4H4Vw11A6?= =?utf-8?q?gHsz28AjrPjnQGy4FGHbzUgN4ddMBB+uVs6c27JLlron3bNyBGYYh7+K7ynUeEp/c?= =?utf-8?q?ol2lgRSOT+Re3AdYwT8P0dQuS1wL1H5jheV78ZdsBAqw3EfNK1s6tQEp+6K1qAO4U?= =?utf-8?q?LBizaj9j+KMPc5utoU8a6216JR5zGaEEL8H5PxA1LTQGofLTHyX8LC7Em8guUI7ak?= =?utf-8?q?JGqV9Kqf3ATPHPkvac9jIQ08UGsqgWGFuREraZDJvUyxsTv/PlnHtAr2iS9auzH34?= =?utf-8?q?rns7qsslv/2/LZINIe93ASlVC+P4AQjYVjDmnX5njNxKxCBDIsAkhdts=3D?= 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)(7416005)(376005)(1800799015)(52116005)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?r1N16921y8v0x2Xq93g8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= =?utf-8?q?W41rzJw/4gwUshbztV/U3byFdCvP0bBYBptXrTz8d0L+81OYzj2TbVHs3nHDmVvJO?= =?utf-8?q?vnaWdjEZ0UptM/+8BiI3fPpAdFsU2dKQqSMDhSiJ2t+bs+ChLw9mzVpA59qTEnwMY?= =?utf-8?q?af28J6lYQfwZg7y9A9t9rTEaqTPH+GaK6kaHHXlVrJ7U9G9XcoAiOiPY04HlDcXdb?= =?utf-8?q?KABd5wZSvpmR/DT4t9d+Tbuepl4zadeRPjoJ/cF1l93RlSW4x+EXLDCojS79GKJ+8?= =?utf-8?q?InXJpaTqjfS7t99zxK0l//DbQiZb0Gy7aFFq2VE6T5cWC/Z4GLCU85v0R+k4PQxSE?= =?utf-8?q?WVVBm6147aBR4NNIOgz0Q7gDMp26mpQcHmv3+jltA+gvnAN2iwSotLZyZzNMZ7GJt?= =?utf-8?q?963+0MZCCsYnoAjW3zJXxCftpq9f9VGysDdGttsSlJMC5BU9gBtna4GSYZDypjXbg?= =?utf-8?q?c2wfNOFjnlcQf2frRN+RweZzQgmAMBE3F4shPPked3AtyIWbvtwziWJKKpUm/6Ch+?= =?utf-8?q?6h6u7tVnDbeFAKGvVRm2XICJsC6YZMOk6SfeoSkUXzy3LKK0TUHdvlAAycCS9mPwz?= =?utf-8?q?rEiBNmG1hCHzJwfR+G6wsyd78BRbzOCZwKCwafcZgbB/kc5uxdA5/Q/f0qjRS2/i1?= =?utf-8?q?sesVXJaZRlKR?= X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: ffa8393e-b4d0-4f63-5a28-08dc86437e65 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 16:12:42.1807 (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: 8/nynYWVLoUjrKCZcZ7u3RHje+ZSei8NpzfFLlsaajGhOYnEDZlNBFFl1UW7QbMkotqeJSsowmEHjQhAHGAV+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7815 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 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 Jun 6 16:12:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 803265 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2115.outbound.protection.outlook.com [40.107.22.115]) (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 E9E3519922C; Thu, 6 Jun 2024 16:12:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.115 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717690367; cv=fail; b=Y2xRSCo3HHT+79Urs3bcdkns6ub8Ks1Kryew3yxf4zJSerA2AkiJYTKF2wnxI2YNpOMIJab39ccXlTVqtkhVxScprQiTTI8z2j7MhPic4youQgFFf3MNuuA3LhYOM/Roe99G9MGCzHxoJ+SdAZjOWDuX6nNMf4ZWzgfeRbyFoPA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717690367; c=relaxed/simple; bh=FAVkWpZD9mVkfSM3Go9hINDMlbcRhVrmFZ4QA04jCVo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=DEiEyf8xeMebrHyd65QSoi+Vr1chqByzCoYWV3xEY+NQOjx7wkiAwarsh3b9bQs+gFbhBL9AUUPrnqxhlQ/FztTRZeYeHM4AFiJjkP8EG2u327DHrdsod1XV0bHP9MeFjDmx8DQTpl3QqDsc2If+IDQuRoInQasxQaiCJWO9qDg= 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=WqgMIIJI; arc=fail smtp.client-ip=40.107.22.115 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="WqgMIIJI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vv7JUPOM6SD+gmUlSwSUKkuNCZZEuTZSV/Buo4jg6yJkyCBQvvkWxgq2r/UulgHRakcgTP0OGiVI/Uuyd2KmgZFYjJoX+c+5z73dk53HdlpwPsVd2PO7knxJt1opNhI7XrA72I5Pyc9wac2Sxs7JwhDc/QFmUWa2rHtcrO1WdGWPcQ5cSaLLrErL8W1PJ8XaKS6BlZA793HLDLRW7zBgLZt42pYKUnNG0zRQ22VgDgrpUCOjdTZMp9gdMm4M2HX/4Q9NnWRe7eQqz6dFrKGvH4SvbzdTxDmBk6eu4P2THgUHEgZJuORRgnrQfV0TmMegrz6Dm3TxhS3gCWgUJss2wg== 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=9SX86DQTOJ8HdXRRoou33jJOY8pcihenVKw3GEnto/A=; b=aFAmoVWOE1GNukWslDPz2lVPMHyHCyTsdz8mbzsINcEbJr9pCrHEEhoXYrLCYfG86Ol5dYJ6BkYyTpQOHt7JllUQ/z8JeD2fZP4kWlhpYmhdf4TJZZC4eU/9Aav1cSoUXkVz8ULiMz8yzTnEbAxHWt6yvfYbKA2EjYvXnxJ/JIaqO8nJzka6vcCYhoc5qh1LYcABLJ0QC4LTIhdH+xx55hq4Bg3bQQh6YzIz1vRGZVeowvHok+8dhyvMA64/R1Zucze3HMBVLsVr9uRA0Ar93pGH8D+WZeYwXLxL62pMx4POC6Q2whr/vkSQcfttBoW4XhkscRp7vfg5MgNkutZQow== 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=9SX86DQTOJ8HdXRRoou33jJOY8pcihenVKw3GEnto/A=; b=WqgMIIJINOm1D6nlQLqxjpL6rOxBOQdGkvTT5kVvYT6o03VCzbqsaXrIV8jExlAV+j38/tZvRpw491a8pjNqCpfofosfeCJPO1bzb/NtE4WvVnjdiw+fWzo0jDneBaciVIl1IV/IGEMoznrzE2EzQkJ3LA+D0lkLFSsRh0ZFxpiJYyBMqKM6KG2cmoiKP4zq/E9JeFut+odqtnMR2j53QCKnXh9P3+i//XRWnEwrtt/QBrByCdKFrNEKgCoijAj/PBP71g33YJgfbpk+kjVPC//LsWhT6Fs4jW8iAI/ZvDqolYiWetI/bH9K9J8E9qrutDewhy6UgJVoN/z9Adqc3g== 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 AS8PR04MB7815.eurprd04.prod.outlook.com (2603:10a6:20b:28a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.33; Thu, 6 Jun 2024 16:12:43 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%4]) with mapi id 15.20.7633.021; Thu, 6 Jun 2024 16:12:43 +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 v3 4/4] libceph: use sendpages_ok() instead of sendpage_ok() Date: Thu, 6 Jun 2024 19:12:16 +0300 Message-ID: <20240606161219.2745817-5-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240606161219.2745817-1-ofir.gal@volumez.com> References: <20240606161219.2745817-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL0P290CA0009.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:5::6) 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_|AS8PR04MB7815:EE_ X-MS-Office365-Filtering-Correlation-Id: 57a6d197-043b-4c4e-10d3-08dc86437f4a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: lrQguqNAfATipSx4Z7s7og+E9xZz8cm4bQsowWDh3mMYSr8jP8/MkOIABRUGDFE7nR9sv2YdgnJb2KEbKQpzJKaGCRC3f/7HG+PX+CzufmcLr1QS3YXkrLKUrnZTk2LCRIAENs51+FNiN7NlIvZ9b0/rxJtrVFfsKeov/JLceJaPwmx8lzarwJNOt4D0cmoAgotday3LGmrxLq+PBMvUuw8RFwLxexYJdDH6MlijEeSXN47OnPO732/M1mwXrffo/ZiAbrzs45SfM1V4YGJTVySI2TMxd92VBxV6VWzqPJgNkvmvSj8XLuR/AySUWxQotKse/ActXMQPSOWHLCQIDk2WhRaUrSHeEGY9+J2ilfpK51hykPNgO9DADq1tvLLgxQuEe+1qjWmTaSnwhE+djf5VGQ/Tdd9M9sa2nFl6iBs6KkwHjsEHguQcbn4VnEsFDGaAHC6v5HhMUZnSb2G2d2L0X07sUhtt7EPWhoabXUELmLSZtP/MLfCDN+R+Zqb4vf5c31AlBgUIzIeUn4FsXQTMi6gRr1UQFwFmNRMc5DCG3TwIRONn8NkBMz9MQCl/fXKDYE9b06ZMmhIMVQsSFY63Y8fus7bl/9LsTk1JcOtOkIaagv3qOM7/SePjjGxPE4GS6HxTFdqtFKdk0vOn18GL+ik2+57p8cihdxCjj2gbun0pW4o2/2WvcqzBrAJgkaXOFMFop19D5X/GanT8b97guIaQ9LkXudTBwfZiAEvtc5kmi9zF2PhZLf5KgbeCa4KMqPeFFaGgTFzURS8SUGarrI9o1O+EQoBq9x88A3ibBWFxDxLikCkLk3a9UgddVmbz4bToiDdLE/5fXdeXU2xMmL97RUinkxmikBdh5TDUYyQfWJOrCucZ317J//t0Wa0DG90AQ5Tnf8AOuX1DbG6vhZnMQjxA+bsB58kdI61Vqy4//yjUKnOpr7QIHtJ7051ZFz3dMFGK+fYkWotNkDFmSyvXVDmq443a3Hl5l4UzLjZpV7Mzr/rgo8QSBDlMmdvFi6FOgwHk7/VDeABFwGEcxVtP5+RmzdWLczjHsJIDlPOy2y/x8R/i4n8NtRcLJlwFSL+TT9KAOvKI/B6QaoDNe+T513NKGLNZlw6Z44PYUiU00litRsY7/y9BZCgelHO2fMuoLKyZusUS5oMo5/UZyPEiAMhbM5XTQ3MbgjsBTnifordldwPai8NB6vsbruornarWIzHuGJbFNQGISfQCuZLyZ+6q4RF7eIwg365OWFsTH8w6/ij6ZDRmAQDppnnqlKvmjRfVf7Y/g33UhJddKZvwkJB02u6Ob0kRJ3O+wnTnC3/edEQ1NOTHWoRvfINJ/HZds6I2vdw98YW/dy8NJlqUfZlWbiKqRJBUhik= 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)(7416005)(376005)(1800799015)(52116005)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DZoDFsewqmJtu0WCGvqYfT/1OFHqc9SIHe7ss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RWDCwSxbca952Dx4fwhRzqbhGXCs3GKejtOXhWc1RX592iZ4Shby27WI4zndvqPT0o3fWANFlfBjLg0r6xn7y7GklfuoeWopU25UozhIdwYxQaPS/0kKdFe/nhb7m70nON4CTfCz6KuS00Ktrqqg+KpQXlPR4KOWhgqM80pvi5U4Kgmrf8UdWWqPbjGQI1WRlyxwClePxjDr2pEfwVPL+oYhBvy9GgrIPZ5jY4KTaDqcUUFZIzlVOQYczGtILbvt1HI1jpWqdI7B3eNEMamy9LFIgoWk0CLaQaAR2+/uy/Aqjx4Ac1xv+2nCwL7XnHJqLb7u2KjeHy6zhB5lbShJ+N9d1k+EbiNGipU4O5cr2Udz1obGVhmQ5pl6CleYZTq/jvwzyfPBUU5ggw4v/fMwbb7IxL/i0eU6Kf/M5VRvUfz47mR4lncLKms3sMbKe4s8hMPne9TZZEbJz372CEFnF+x4TEldhDa X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57a6d197-043b-4c4e-10d3-08dc86437f4a X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 16:12:43.6854 (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: FY9A2J7fXTh3mg0WmRNYe/qYSnXij8LXnJF7o3ibbCFTKZ5TQ6LDtzVDXgovfd17TGMOyVc9SiXiEWP0ZvpRfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7815 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;