From patchwork Tue Jun 11 06:36: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: 13693152 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2113.outbound.protection.outlook.com [40.107.247.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 5176F171647; Tue, 11 Jun 2024 06:36:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.113 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718087794; cv=fail; b=RGV1r9sRA+7QmCcP669u48RVLAjXAZKarG137tKkLcVVC1dGEaHrtQN4fvG2ZzYr8OnXkyIaGmq435jFNVhFw99FWlm0FnJiw8qhYmblEMGacWrAFxn1VluPhtagMW+B3BkaESgeOm3BDCdbepVf1qS1IndLH/A+egTMwTdq3jA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718087794; c=relaxed/simple; bh=JvGJVB2TWQx07cYj81j3WvS5qO3qZipt7/2iFRhd/2c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=dMRnhCPtLA3LYPgmVNnRPc1cuUlXvqbQnAtTIu2ij7wWMM/Ikel2EjRDMDXQnSh4EUPbDVtyTGTtjj6c961ZMdp+T5iYnBJUhXeMTA7A1KhZUvEZJcLs5PHapgVVK0UYFCSxIArsvEgzuqn2ppZT3kZZZWOOXa05oB+ecURghXc= 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=nCDMcBQL; arc=fail smtp.client-ip=40.107.247.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="nCDMcBQL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dmSC32iEMi2fLoxgMFPOZqz1dLpufBuQCi2xTKXSrb6idQV1gQkQZ0b0090k7yFu8Ba8t3ovkt4KM/JsijPE1NqcKfrdZls6zSSCSKuOofUagcFOSWGx3LfMAaqprw6u8IF5pM+Kr70GpwOpJzMWSrVMrFcbVz/QrtbbEb3/ZfL4Rxh2ltDeJcZ2h+bUmk1JN8J4WJAF4Gk4aj5tFDx2r9811LswmetEnW+F14IKDopoizLvWB60cxz9Hxq2XXqg7S2GYb6M5Od6hBj4z8k+VBjfvnrjcchRNTJxc2O46PneJWfGliOYHYtseZvpep3qVFPKqh4Mtns5MbUW7CwMIQ== 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=NpEc9IbUa5kZ/1013u1ORU9PTtVQZpUlS3RuXqB7dzo=; b=gjZ5JprsbXG8aenzqr0Q1LfE1paV9ZmX2lq7mHzeLFgGZ2MTBE8x9xQ2CkQcE4rnaewAB54CwFiFt9awveBa5MioCY6TD2fbdrT4uexAnpKfrYDgIwsXT8ovRElYQ6o+fIDMW93AUhv2T1vHBrzPxfbz5Lp9yw9TyCegJKPraz+jGOrMu5jAxepUGnqw/yn5c1QSlwEmOXtCo98l78ZUZLQcNPJJz3F+A1NDIn2sgfuATdrb0oD6aOaEekyuzYZvdFE88pqPJzQjMFcbiaHfeRKmmNhcxJHJQ2ItxUpUzdPOlTzY9E8YhAoJsmR14yKB4uccjmRBiv968T+6409GvA== 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=NpEc9IbUa5kZ/1013u1ORU9PTtVQZpUlS3RuXqB7dzo=; b=nCDMcBQLfploKjFXsuR+XftmAHdCNqPbF2DzVLBn9sOBr7ytjlNJc8IVTZD7e36ibjSDfPH0DB2LecOZ38c+eS0oYWks1OPEL29apVCwi0h/HaVUVAdwyCX9kavAwsOri40h68+geF70ob2z8smw4xwziqi38QGoppwZoe1BKd+w8EKdCJVxxDdTfSj0jlh1FxNiFWETva69tbZUzqKDzFGsz7sP8+cHtneIGQsLwXebTAeDCNIkfuol40WQogYOvjWU+UbC2rHF9TcvkIqOeX9h8E8zs8Wgo4O5wTyuG5N9OJi45Ts1gc3OlBnH3c6j/xGeojjZSvzLfsdrbc6p3g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AM6PR04MB5110.eurprd04.prod.outlook.com (2603:10a6:20b:8::21) by VI1PR04MB9977.eurprd04.prod.outlook.com (2603:10a6:800:1d9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 06:36:29 +0000 Received: from AM6PR04MB5110.eurprd04.prod.outlook.com ([fe80::4077:a101:3fd3:3371]) by AM6PR04MB5110.eurprd04.prod.outlook.com ([fe80::4077:a101:3fd3:3371%6]) with mapi id 15.20.7633.036; Tue, 11 Jun 2024 06:36:29 +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 v4 1/4] net: introduce helper sendpages_ok() Date: Tue, 11 Jun 2024 09:36:14 +0300 Message-ID: <20240611063618.106485-2-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240611063618.106485-1-ofir.gal@volumez.com> References: <20240611063618.106485-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0005.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:2::15) To AM6PR04MB5110.eurprd04.prod.outlook.com (2603:10a6:20b:8::21) 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: AM6PR04MB5110:EE_|VI1PR04MB9977:EE_ X-MS-Office365-Filtering-Correlation-Id: 8860a05f-0cff-4b5a-5acf-08dc89e0d3b5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|52116005|1800799015|7416005|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: KzI2TV2L1TjoxYMLUsa3fPRWcsDHjzPjpyfMAaQOwzoHnAR8iWLe1MU8F6O9G1CuHsNFz/c29MOWJOJGByvyzIWEYHjkjH93y+FuWEQVsmGopFTq86KeRF9IZGA2QC6VdUoWictaAhaGXll5bNc6X+tkZ7Z5A1Bx9PJITrnbugBjBchIgGlFEzAQ4lO6xoS65kARSyIyvpSEOkYMIni/3bdo3zGpvf2zTmws8MVcA3Yj1ZRJ5EKE/nf1bNWmKDQXTk1G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OWUeolZWp0O/FlS2SnC2FJo106PacDXGHUuqIy3SHJk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB5110.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(52116005)(1800799015)(7416005)(376005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: R/JFLKILAfVjHWNZoqyCC5UeRdvt2XqvCh4dRUZcCzeLRaAbWK8aHZgjLvV6lOMqjLDn7ktkTFnX/+jHfCMdXYB3KGF68Z3YpeA72/mv3PNifsucsOlUG2Wx9QBNO6xHKp6fFuskl+8/h0/PKLcyAh5bMAjEjGZ1NCCq9RIUJsmkNiBD+HcjtDJiITPG8JGMRtdt5q2Z5g+rusLo+OvAQ+lQtI3e8U04/mo2tqUJrA1wEoyG/cshiwO0UZteLYlQ9Uv+C908VConm+d7DJKgRHWifZA/ouhWhUWST/ZSRlUDgZaFx8mFQrHh8hvN1xs80iAkCdEf9aLBMW0rXuqVIEgmbDAjdxbTzWDPDfNNBwTrbFaxKiNRcFj4ZqJUheAZwVsTDwB0+aoGSGlpYdQqlzeOH/fFMlT6td29f7yAUbU7nvnnM/CRcTiQJuO6ZK+f3OSUfTyamSKkpRovkK8zW0l58+3mCnmFerf6pQSq2Jqs+cHe/LSq+WkNHUjmfo0gyRqKQzkd6OAZ05bznrxN5GUi9bM63rQzM6DbfZHgnSlWdmj0dP6MbhhCsvUlFJkjZeDrOHNSwEdXBB13ep915v8uKt5NL8xfjcMEIe3KzO+wC5UdD8VvT9jZ1wWRPsBYPGRs1jlXMOCysU5dXo0tKB/WeKzDfe5YmwNRvpoZNvlyNNu0pNkvDcdzdSel8QKjaPisKaeQd2WviNdGQyzWCliEM/Nn4a6DoQWUcCUfFylpIqLeG5l3TpQbQJeUIae/qjn4eBT/M/E33V+E9NlCvjLni2sSAa4bwSH4dT9dlYO0GKVs8jh0nCOroglD9vzLNSJJRve6mTLOF3onZA5A1hrAaIH736dmkCZFf9cNeyIFqDLpCj4Ppc1VNl5qBYJ6jV1ZG50L3uBdW8ngYrdg7KaLBPPJOdBSKBzB69u/557QY5jWZSXeoJjJvanl1NjZBTVfMLrqcCKLF6pnhRfvGXaecznSq9s5HhztsAB8dSEoPZU7iKzNdzbWO+gYZaB7XR0BSAIdsO2OcT5mkYDH2pMegerTgQhb6ZuGd4GuFNGHqCLvt30vcnKFvEY0eoCEicPHFpUkz7S8w5OdxFmnBtKtohwlIZWBtL1QRrbeOE7W2liJ7qKTsWRgx1KX6wehVFuGqmTIhwYNK2BtS9G3maSEmIdLMkoyv9a3vgy9ZYHgD90SftcsV0t2MmhP0KOkKMZQMfUD4KlOVboO9BD44fPRJwbRKHiNT05nNrrcXHYioTP9KGbv9M3ky9rs6JPixwBTBabfA6PdE4VOhJ99SPrjajUzO1vtkFt7r0AOaWSwlSZG1YUk9ju1SUJDWWQf22auvWoq6/yH1B9ZpO3sEHDxPXI/1SJ7x18wbz4nNGBpmDdf1gB/d2f2xjb6E40vLRTDl+ixGhZtVTKqUWZcVYVtKT8fjgKd1a+tW77pUkAXN1KUhAc57Qs4gvttWc3fs/i88Hk2ld/K9sfV6GZxukCEmZjG+dYe6cCIedTzKDvxWH/PXmlyI29qufWgZlxEIjcHI7u8hVX5LGnB/C4NRD4KOm6ELJ+SSZnH0Wznz5FYXmO/NWfYG/H/wtBY9JxC X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8860a05f-0cff-4b5a-5acf-08dc89e0d3b5 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5110.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 06:36:29.8296 (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: yDenvQOw++f1Gxv125oRbS4a9LfNkjxKWgIl2fEHXf9vzP9wAsD5zluYO462dXRsbLD39zwedey+tTkEpsH1lg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9977 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 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 Jun 11 06:36:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13693154 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2113.outbound.protection.outlook.com [40.107.247.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 8785C171E65; Tue, 11 Jun 2024 06:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.113 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718087799; cv=fail; b=r1lJtrHy+0AQIfrBFocHCblVosTngKEdXndZeShIiKiFSjS0GlAs9lP4RL6m1WScday2zHyU/qMk2Zfw7tuw56KKrK0ta7fdjF59MSVCzHOycwEMlUKXSiAxq8wE6lhLhcJtdShDY60mqj3ztX4ZG6hHOZSz1dL2NcIU/25G8vY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718087799; c=relaxed/simple; bh=wYZQ26y0os4R5zRsiqzIRgSNnbiRuxC9GerU31GCTcw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=qKejFgKHGzGSEGx7ujWM2bjdGvGZrvG9DXQi5IjDaLI8Hh3NUurB6bd6PddUhuGm9zfAU+MWb1k3+XesvNXGaWIdRZQSJKJ7Ra/6Dr1kH3YegyT6trvyleLVx2qvejFlJYH6f6/lFSndheVn5PYdblfwuKXRM1UFBguwqqWCopk= 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=ocTSdSBP; arc=fail smtp.client-ip=40.107.247.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="ocTSdSBP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iyvgAC8Lwm6tD6/LS6+wpXZyMeHr9D1+S7MJRAyAmnJOU4M4bZymZduWCEUbOYyV+sCq8ZPG/2gWZERkXpamTek2EUfwxX0y2afydp3RQ1R3aLsUhdlrc5IdGU4mRoACF5m5ERJxu7BDquibz3M7kJ4YizqF8qf2KN48tAi8TxTECRwPo26YbCif4v56B8jaI8TxeLo3Cuk8N0B91DujAyjUF1kEm9CSUBJIWwh6RRzObXOUBoSNc1bDfJJmAzlfnha+iWX4VZm2bPDezQSmS8Ad7Zqye2SEqgbwYM/7otYEdEG80ylUjthfB5Bah/Lwpcrl6EwqU5yd03wDSydGtQ== 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=aH20jbNOmN07YNyZ4sxTXgGz26CzhSHDXBRGbZ9/rkM=; b=TogY/xXc/aW/D4PEiJJ87sKYjBhG8PXyyHdxNINoux1rWTYQUGrNylMcD6T8J4hDdZsKUmUrRceew34fen04HsTnFf9Kl6Hr3HAg7rYEpvJwlrKO/oUt/exysBHh12j8Ki7ehuI6nAOj4SV2wGXsIJ7bWosCnRRHBzLtRl81otbZWSpCRNnZs42ovb8FyNPr4WSje+hziGpZ+FWMEQkIPMdRP+Qbt8iWl6xCe9tPmOIOoRtwmlhZPGhpvpkOPOhXGEGqXcn1UQlRl47qanaVTaWbljSS7DlViJ5aj1GhXErdzQecJbVaVsEK5w1T7bxzNrpNcanRF3eVdtU5qkmSZw== 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=aH20jbNOmN07YNyZ4sxTXgGz26CzhSHDXBRGbZ9/rkM=; b=ocTSdSBPGqo/BkTX8l6U4LvraIVezH7AdDfxjb9Zr3oV0V9BbmEPybPW3IEJarh4z8FRT8MtNCnjxGUsiajhxYZCxyv8wwPz4PxaiOgAGV66UskpOviHVf5ca7Ro2tUkZT6L/IpvY/vY2K9+W5momgRLg16FwkP1juD9Wcx795v3ey9r0a0V0ubEugZ00GyunugAZNEePM0Uy7R3xRq+gcSw1PYbkL1tyHXzWiyYyv9GGwyUbKTEncyn0ayeH3S7c5NToVgrNPPfqgKcxR8YR18b6gqcQ7wcFjTQZNqBMvL0edd/SMVkXUQOK6+60Uyr4r1Dl8xd83iTfPl6KJtAoQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AM6PR04MB5110.eurprd04.prod.outlook.com (2603:10a6:20b:8::21) by VI1PR04MB9977.eurprd04.prod.outlook.com (2603:10a6:800:1d9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 06:36:31 +0000 Received: from AM6PR04MB5110.eurprd04.prod.outlook.com ([fe80::4077:a101:3fd3:3371]) by AM6PR04MB5110.eurprd04.prod.outlook.com ([fe80::4077:a101:3fd3:3371%6]) with mapi id 15.20.7633.036; Tue, 11 Jun 2024 06:36:31 +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 v4 2/4] nvme-tcp: use sendpages_ok() instead of sendpage_ok() Date: Tue, 11 Jun 2024 09:36:15 +0300 Message-ID: <20240611063618.106485-3-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240611063618.106485-1-ofir.gal@volumez.com> References: <20240611063618.106485-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0005.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:2::15) To AM6PR04MB5110.eurprd04.prod.outlook.com (2603:10a6:20b:8::21) 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: AM6PR04MB5110:EE_|VI1PR04MB9977:EE_ X-MS-Office365-Filtering-Correlation-Id: f94cd1c0-2de7-4ceb-c928-08dc89e0d474 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|52116005|1800799015|7416005|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: QzSzGHztvpDTo5/nnqjOaAdvR+QE/Ge7pmy6RstGXZnyJvt0SFzJF2JC0LgaGLTVs+9oeAOUNWRKEN90e7ZNBxO2a3tWNAMvM4hXPDeAfDDSGKZkNP94NZtWdUc6ugTPfMfF4wk89TX6w+I3DGVr59mw7hW8bfdniM8LQBmdwiP6K7+wuYz4itx4qzXoKjIQV1Jg132dRPI8CKxiPHvnkcu87SjSOQv3xsCkLSxxBUv13t7aS8PVxNmSnqM/XkdGfXDKo/G2F4aWuBpaUYKyMA4mUbwdAjwxqRMUobVesha6c7eRQVeIn2uCxuyXRflDDbbWZ7iv6ysPYIt/3SRshuLlZV2exwh+YV0VFdgSsEKyJZwcvKFsurvnshSN+6ajcakgN3+wJUd5oBWDklHLtmqLah80YAGbgt4TwRisgjG8lsm9/assRsaz35FuFp0JwtoP90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SFS:(13230031)(52116005)(1800799015)(7416005)(376005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y++U6p3aj8gWl3NyeF4giNGy2i5Ls5mcxGPtmQKzOgpIqtq5572zDw3TJnIOZhIYv20ozjCg9NtHX1COE7fDeHD18x1Dmog6RNUTcQqByGGEVfNJhqGx5Gm0FXX5Lq51MsQcT3LBg8MPNW2zCMlcVlw9lB06OAuT1zRpa02ZodCVAplsSoDzSdOOE5OSs42Ds4Ti7MaNLlA+zFDE5yBZpmDfy0FshKJ/cuTq36R6lwUZn7PcW/BZCii/fPplxF66tIno1rnlMx2NfAjD4GL9D1riQpiwLdnihyrLj/5qH4SnQLTuiGtS+i/qR1DOyUU53XmmToUP9K0JbsNPihYx151l4qdOmYxTvZrGDSPRvZyhxChSNzu3sS8C+W53n7I8WatTipjg369CqIdxOm4/JTvHXO8zQmGITvLq5puX0fCVDgsEGMBUKZCBV3fXJ8l1mjdefcrpX07pcuzZs/FtRymKxjN8OR1wZNhE/5wbzCAzbwN1IUjwxsyIKzt7FBRhlJz/F7v71lYVCQMQ6+aoLNCoBQR1bZWLuSu0yjivVODmaV+gw4sk99Ihq0IDCs3zRDpAePh1DVAxngUFIS7CXVgzAOIgrTIclWfDgbuuycuJd4EFBAKc6cFoVJtEPoSmL0Ch9M907iUW+S3pYl1ee3wQI/Wj3Oa3T8n2soLUHpwCyZbZsSHRmlE8friwtHDNOkJaI6nTvNVucfp6G1hUcHsoUk4QlMwtsFSm0W72y3htDTrZ2CTXSCi1OtLIpooPLCQr+bGmpCpt2jMjt2p32Z569Yvm667siN7ta5NEqJr3fQuc/7MwG/ocpkWwvIK9maMVctWD+bhI6Ph50JdyzbqQD5FOZ0xKppYhgl95dAozwGEgxOJJmuKpKNtR03i9fMOZX3euigjMnBF2Ejcs6IC5E1xaL6os5D9qG26acjc2CMUT+Ktr6/FTjWy4nptAPBEtZGOnfo/6SDDldPVZ8ZXGEm8CBR6MK70wuZ5Ihy8OaZabksMEgxnkTnGNsuK95WRIOOSUsIWJ7VrgIbhHl1ru6yiSjshKazudKcFs+4IecEXxl5iBw9cfqA9zD6iEjM5bBVY6k8v5YX1ULZaFBoNYL/KS05rSsTe0x27rg1902+mhn+f4uBwgkj4a9Xuco6vf+sulTf7PEran8+FJYZoxZKxUpqS2US+g+I2UBDEQtyy7XNWCvzHEJESHGNfiTMdFQyNmMaUsEUHPvqtHh4q4tOtSjeHqaQCdlsIQZK1U6J97igVkv2Z5SQIdzSd72qcvLU2Wdl65dykL7pKcezzgDzov5bpUYUNA7ZKMB8iuCFK00QukQEVqKZSOaTK3U6VtoLR+FLcE/4x6gI1mOGNu1bEVzsuwUbRHM1dY63WwYi0KQjAw/UriVQVC9GeK6M7FMsn5XmXcI1imFUJ/uOYm8kHN4SOPx61MIR6I/h9f4onGFkpgCyZMjL6FfDXchX1xkg3pztLEsfF34WAFAlBzzqgrIqKUSZ/XPPDArTRxhkjODI1LPAZSQNUsMJvMcronq84zmN/LnKZI0OxYWQAcP3efI+2DHGy9BApF8AnGNqh6zOpmpejFJUbbF+a4 X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: f94cd1c0-2de7-4ceb-c928-08dc89e0d474 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5110.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 06:36:31.1881 (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: VntzRM5FctOjkbgyL+ox7cwZ53uWAi3QvFISr82/1gkqZdpIhGrve428cMSZM8OCI0ux9RBZW073RylcTpn4cQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9977 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 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 Tue Jun 11 06:36:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13693155 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2113.outbound.protection.outlook.com [40.107.247.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 6961B17277F; Tue, 11 Jun 2024 06:36:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.113 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718087801; cv=fail; b=uJ5BpeKTKDxTRSWxhvtx4RpnE4GjbyMaFZl0CKfj1NuO7/oLDPreV3NFEn2TroSeWaZ3NmZ0/xIIgVTvi3SDXjgB5Vd4vGbqOLW2aHvOHcVdHYtgNH35gYKJJXLQ7hiFTdnSIYXhbbFQsZhEurP7hHD6fUHus2X06jWJyMA6LEs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718087801; c=relaxed/simple; bh=hrXyDaUZD5O+KIuY6QI0GBnrWAENZW6x0xDSGwfPjoU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=RhVoz7FDQE76tc1rN6e1bgarJT/z412Hr9niHlQgq6AENlmyqcWOnd3jLwvRM7MNCCfBuxCpaE8bmnFWQ8hYcR04yx4VeXwHXQMp+GaLT6bpnSkKSHz+d2F6+KFopcBfD45RIcEYsShD+hwJ/t4POnTODzhJDNB3o1x38zDVcQs= 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=ImVExr43; arc=fail smtp.client-ip=40.107.247.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="ImVExr43" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UcNM7otcTBlKBxAdidLgA1vqNV6pDlPZE0NtpZNci+I0GjSb47b2ugbdbPMOCHX7W1jUMB7KJvL8pGZti4oRGlgWvlTdGevABkr2FDnueA0uPM5caJPJ0EIDntgH/fbzZsAVptr/HIPqzB2xEj0oRd8Ada6ww3OwgPJBlTbegEws9OXvtP3qQdXsHAwkeG1QjHpFw9j+LrXfkZPVnFJ2iXp+uSrvgGo7qd1ZYaybrSaKZ6s2ZIOBnkALvU76wAXltzjrr8K/2cR3LMksRjY4kzNkIL5ekdNlb3pSogImC+9JtRINsjtZJu4uTTgdr2rMLT1H5atgygt39nNyjMWgfg== 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=VVutqMSI2D6d+ExjzqK5j187yA7ODtsw1FunRF8U7467Snjf1CH3GaaXyvb0mf5szgoDZj6t9TUBzEH+uqGjX/sfNwjsnDsb4kZOC11gYmwqWc+j5hwzrfGoTJKxnUD/gKWwO8DPr/yZolx+w2efsmHGVqvs4Pq5rptt49fR/uOQa3kJEZXe2J8taL4DT2I0NO3d/Te++7UOuvZdHlbldS0ZoYjvoNHIvrbBs4Ep7sWFvJFqaeboY/7WLFSgiXjLfjI7Ntg0Hi0f5H06CZvnQxH+1P7f35prZ2dRNG24WJcK7QFhNGMU3lNEsYfGDwD9fXEf77X5INUcZIURv/o8Ug== 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=ImVExr430azNG615NNqknS59S5uJwPIl1q3c49TGFZ2vknbpdXt8S1lJoylZMr7viMCTy46M14N5isbSzbe5B5mRTArwwOr0aflxEdbLDeVOwXNIakApgR5uPh8QCbjkHFghI2esSRnaG8FbARlJnEDlcnADGTUjyFTpx1ISKDb4Mz/etPI6D+DPRcbYHHnexXsQJch7BxtEL6A8QSDsRzIzl5I7Ai1Hvg+bjA72VLNSxDf8wwut5xhBdtH4xp2I3dDkMzpDRey01C760U4APNgCsWDnmSIy3vfn+pDI8Yd/Gt/9bWEBhi9WFaYdVuJnx2bxRkwxtRnyZgYi+T+KDw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AM6PR04MB5110.eurprd04.prod.outlook.com (2603:10a6:20b:8::21) by VI1PR04MB9977.eurprd04.prod.outlook.com (2603:10a6:800:1d9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 06:36:32 +0000 Received: from AM6PR04MB5110.eurprd04.prod.outlook.com ([fe80::4077:a101:3fd3:3371]) by AM6PR04MB5110.eurprd04.prod.outlook.com ([fe80::4077:a101:3fd3:3371%6]) with mapi id 15.20.7633.036; Tue, 11 Jun 2024 06:36:32 +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 v4 3/4] drbd: use sendpages_ok() instead of sendpage_ok() Date: Tue, 11 Jun 2024 09:36:16 +0300 Message-ID: <20240611063618.106485-4-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240611063618.106485-1-ofir.gal@volumez.com> References: <20240611063618.106485-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0005.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:2::15) To AM6PR04MB5110.eurprd04.prod.outlook.com (2603:10a6:20b:8::21) 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: AM6PR04MB5110:EE_|VI1PR04MB9977:EE_ X-MS-Office365-Filtering-Correlation-Id: 39d04b5f-1bdc-45ed-ee84-08dc89e0d52a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|52116005|1800799015|7416005|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?65YQhIRK7URILPbqvCpkkSXh4Y4tIXB?= =?utf-8?q?ODhGxJBjEojE2SCnA7oomjUXv+h75ptNsSQa7qIPpcvt01APHQkYMY4MOmB17zj1B?= =?utf-8?q?Ip2WXETvy++od+8MvhkXE4upkcYQl4xoLwTDxFAaBhj12y8GdUDzrJAqSvRxNyUnk?= =?utf-8?q?HNwKomIsOr1TUhAOW6g+Ii1PyH8VS8vVzcfybt3gtLiha9X4XvQQNIRH2gfUQZaXc?= =?utf-8?q?gHK40lLh90vpRNzagpN6PbUQ9nTN9Cm1Xl2Bsbcbtzl2jFU1eAsNaUL1arZ8IdbJM?= =?utf-8?q?7LykWK3ZYh36Mw5tbu6NNpuBMwGLuSb9hTB5jBz6jiaPCS04rx3YCERFwhm++UJWK?= =?utf-8?q?5YOZs35+PNYw/H+gOYYUuAbtg3N1J00igHF2WQM6yU+3IP4NcehWN/yd9Jy4yoepL?= =?utf-8?q?2b6SfVBSvJvRZ9dVIuKul2sX82cGj9JSQJWBxAN/EV8xCA26B7++2SmZOZnsGmscT?= =?utf-8?q?NyilHm+ufxr1cpVz99A/RHbynXGj0nm9wlU5gJweUmiTdBPF/03pEA9InR9Ujrlod?= =?utf-8?q?N6dUPJ6oywC/aRhS74DDins2v8nE3MxZpNvBcGP76MmjmluSiw7nrfelzC35SraJe?= =?utf-8?q?h2K06YIjjAQxdtL6TuXNK815Wn676EKJKzs2WQTRwGvSwLtJ0MXa9upsl7WCOZUXG?= =?utf-8?q?cbJ7CICeWgOifP+nUCCBzSlCh4w+DKZWGYMBR+fc2d6jxYpaXEKMHZwA/L4iPnn97?= =?utf-8?q?2cFfEsSYW/hYTWksbMY4LJd0D2wzpVo5Ysj8yrfGK8Q7LSowHStnCmFwivuIhZ7ce?= =?utf-8?q?HZUjt5+kZj+oiOb6myRiVjFz5P6DlTouxkt2SxF0USRC0zfAygaDje88PdLWoeZ54?= =?utf-8?q?4tmpRB8vnoltTguwwFNjfodKiCe5wqbDtCNMDBy+i4v9IkYdsOoJue/KLztIQIEt0?= =?utf-8?q?idRlQVeL+HlER+6NESkCpfJNpQoYiXzMR8AL2D1me009fRayQ+sTBUYnTJXJBrz+P?= =?utf-8?q?nDIztkXaMhU8LisF/sER+0fC3YRqoPUDcomb3wjqxYVcUGiu1UWHk++ReuP8Oejmu?= =?utf-8?q?wexPIidT0HwZfqq1JPFFXSiszUT97MZUGls45HT3VEiLMnXE8CBcWH5H0N6flUv8p?= =?utf-8?q?ApfoAFbg9F6UVPQVwyuvsSoLmsz4PBaEAitYq9HSK0+B0Ou14QojDQPt3NAMOhX8W?= =?utf-8?q?Mv87rUl+mPpZRqwoLaAbuwrzxcSeBSDmJGQ0OpOd/TM0dQsLAMRxcT5sYAtKNDZuX?= =?utf-8?q?WyR4RejhsKWlja6jVmqEOSJc3W0Ce+HBdqUjBRIaiqflCixiMY7BhvL79sNlK5ihi?= =?utf-8?q?ffB5LjPDwTSUBEiXrRex93UpjyE1xAYzQZa5oBjlXSNDP/mbwfIILzdg=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB5110.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(52116005)(1800799015)(7416005)(376005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSp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jbJLlD0vsQgAhZuQle2K/pD6e+qPsTIEIJt+iYfYEz1PQO+3hRpP5escQ9zA?= =?utf-8?q?jhz4O0jqwG7DJrI763OmjH/dqQ3ZgrVA6yVS7WZdVrZvnPeRXLzJaEAYetk15LiCy?= =?utf-8?q?aTF8UvDFVAM7a0o+Ii22+wyVOUWqVMe7lRNAaeBDNgy6tSny3IAu2XFo3FFnrJOwi?= =?utf-8?q?uDnjddDvH/AQyzNCd0MvuRokaww7EH+B1zbfcQsKaGYafj0lSLROOw+AESPuSJguM?= =?utf-8?q?UZ+ofwDaRjF1if8Luu6gRuqbdrzM2oXIcBLiQZG+o5ItFmjN/PHWWfPf0/vWPvlRt?= =?utf-8?q?nq2MDKcCy7/FJ/mKRSDr/HCiECZM0ZGzHlE+HhnucedWbB3SxAOWy+fjfPxqN6vi+?= =?utf-8?q?MBb2/5iVlNos0ih9OT18Rh3kCVdGl6nLgEAwY7XBNCfYdZvA7Gh0+Q+WXbOS+xafN?= =?utf-8?q?kh0b9M2UwixwGRBiay2v+ej6RxtxcIGnDNRCoKiojTpOUn1BEy6NoyuTkswpgnyAV?= =?utf-8?q?lu6mOBDSMjesBGm8Asrbwinn+Ahmqi5utqyF1FuiN/wU4uRSe0ew4EWSedHXNlClr?= =?utf-8?q?JhuZosjLNAjhje36bdtxIlKz4YU47LlbagcGb84I1D5ZckiDNkxopYCXnOdU9LKBW?= =?utf-8?q?S8+Nqk3M62LD36VF/A3G7fpB1O50zyF799k0WevaL+JNZaTjuBTlztwsoq236Qoqj?= =?utf-8?q?boIwveRAnyNn?= X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39d04b5f-1bdc-45ed-ee84-08dc89e0d52a X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5110.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 06:36:32.3194 (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: /YpgsXZuFOPpQh/WzxeeAknxlL1D9RUqP672z+Akxu6Y0ZmrC7FmC29HKf+Per/OyEFmTyJyD/ymxAAwYDmMig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9977 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 Tue Jun 11 06:36:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 13693156 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2113.outbound.protection.outlook.com [40.107.247.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 413D1172BAB; Tue, 11 Jun 2024 06:36:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.113 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718087802; cv=fail; b=AK80g0yT1BCqU8tCNjlhLg625veMUHDj1z+wdacf8bNIYv0hMTnxQCYnE4UCYWDg6JGuK0jZ/xKaJO7+J+iJ1CaP77Yf+rK4S/iPh7lFOuM7RbPiZkVCJaJ/4VuhcekEoHpOMcrDDUiCclPyxbTsEN2Kb0zjbj8eaJl4V5yFXhc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718087802; c=relaxed/simple; bh=FAVkWpZD9mVkfSM3Go9hINDMlbcRhVrmFZ4QA04jCVo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Abji9dy56RwWCLmspOnbKWoXhlqjdbR68r8BA/Q9VtaSWVFq4P76pa1d+6PGs9abVBGnaBiPcdIzuUox5InOC0REtbt4dczs7mxv0CWNtVZObxR6KosstanJqWBJYiHAG6GvKW9X5nhvfGzQqFxZnF/1qp7URdDtrkcqVcxicNA= 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=XrDXE1YV; arc=fail smtp.client-ip=40.107.247.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="XrDXE1YV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gnLIrMb/qzuZmwus9mbIJaKcpabiRjIpCXKbaMKaKCTMnaToMyVUcVkUksdnaY9YbuUbwKUccNzXytC1PrpC2PEpJl2uEtbSVFTdcGp080fYTZX2QvSXJG6kmUSGh0P9WZv2dtqWZ6Sp/b7iBV+0tCpFzmua0bYvD+0rwk18B8VUYs9Y27vNia2vVKrSV4S7EdosbpxnXTUy8OCIK+EAJzeLFc2y6bn/mV2FDnbY5VDBSmzC2GICFWGjYaD30AblEorw9phbhYPgLwuRDHv0E4vdhrusrD7q3LtLkAct2eDIFkIfOvfDzVP6oqG9vG/ls0R/akAHX8nLe4agIpN1Hg== 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=JMQWNOPUSCk/+GL71d4B9o3C/UcDaNfrInGJg4p5USVojPLuqACPcVcCVhszvMebD6aR8ZCasG/66oKKZptX7QUMNzbsbqH4Z5CVqWepss4ZP5VjN3eHJev+P6L20eQhQUncMt+YX6bIoR5gH+dBwEQAj/aH5NULau4u5fhD9bCyIUimt+P9ocvTvt9RetEYFOMc07vLqLQQ14oneJAFJbHfTaDFbX6K44QqhUjamQu2PZb/fefgHk+P61Tpqdj9JM+QtKG039vH2nIFmj9RjKAhP48xzMBncmByhb04z8Qkvf38lnQXaCEsyWeXzbNv7aMSp4HY7QbyNN9vl4K8lw== 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=XrDXE1YVOMb4WZGCK61ifAGcu2ROfYnqziVvhHpJP5K1mqnUAvZ0FKbfR0j9BQOmiYOmHMb3AMKSfpqIeczgCGwbzrZ2mC5Fmf2MsjPhefg9PaYMGa000SLJLHuO0V1NCiEWKcSu2rMAaZOSYJTfqvzBcoqxVxWZnBoqpj0Bk8PyFRVjl7nSNmLqDsHHohzycW8Mk9I9EAZNvNc4h1ehv5CHnMd0nRnnXNIWjcoKfbEbM269JF0r22F+xEN5lV/BNnECjPR7T5x8m8jZQrzomtVOY/bvSpolFUEP5c343b7fVcJgGTu2mQNEjnF8AMQ+/hKMhNc4Fv06UgG7/KZX4A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AM6PR04MB5110.eurprd04.prod.outlook.com (2603:10a6:20b:8::21) by VI1PR04MB9977.eurprd04.prod.outlook.com (2603:10a6:800:1d9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 06:36:33 +0000 Received: from AM6PR04MB5110.eurprd04.prod.outlook.com ([fe80::4077:a101:3fd3:3371]) by AM6PR04MB5110.eurprd04.prod.outlook.com ([fe80::4077:a101:3fd3:3371%6]) with mapi id 15.20.7633.036; Tue, 11 Jun 2024 06:36:33 +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, idryomov@gmail.com, xiubli@redhat.com Subject: [PATCH v4 4/4] libceph: use sendpages_ok() instead of sendpage_ok() Date: Tue, 11 Jun 2024 09:36:17 +0300 Message-ID: <20240611063618.106485-5-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240611063618.106485-1-ofir.gal@volumez.com> References: <20240611063618.106485-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0005.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:2::15) To AM6PR04MB5110.eurprd04.prod.outlook.com (2603:10a6:20b:8::21) 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: AM6PR04MB5110:EE_|VI1PR04MB9977:EE_ X-MS-Office365-Filtering-Correlation-Id: 41663eb0-2a67-4b1a-9119-08dc89e0d5d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|52116005|1800799015|7416005|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: b9CViXbhOZVlT6bJTVcX00GvjDo7xg3kaGDtQ/u1Bt3d9bcy+79+h9FHY/qZNrIiCAuIP1ZdpHWkuhQOrrRA6Z1sOS1nT9gnqs2vgDRc/z92qiERVqGDR+Qki7Py4gsA60cuCKgBtJ2f4N8UEsTHMKjFfdT4/rY3fwLLM713XfUfgy5J+/tLsndqiPvyJ2K2pfrHI1gMBvX+ubFfoD8up6NjQgJn2HbUoxIIwlsGaiJRycr77UC8+pb/ZAX7KGYJhXj+mwWFdGJG5mnACeSiw6ztzJQExL3SdHQxaHsp0hYZZ2Ec4FFWfQObbJKcWd6WHHYgRJjTLhmDbiqT6+3+tpRj/3yVzz+gsKgO/58kGsF9DJN0DoqP6lZOyOih4fSHg8S8jvSdulgnIu4HHdZ0PC5KE2bfTnanQ7f/nzQjE9+bjDcDcAnB5eYoLe5EFUNCLiQDZJuw4R5Q7NM62faYFY3+kOGZagK9mP7hzGb8K/eOfXTe/VROTk0dlnGOxCnZEbKH5O1XeA51GpRsvTbhkhffrpvpfs9IyI31WMxqMB6H6UGPAstsUivmv2BPs4AWXNzFJDPGSdvx98ESEaanx+zxkOXAJbxdHXdqn1SjuTvc0HtJe5CSuuMxfLDcATR9oAjzhAjGp/caEES8xyIOyzhOzKxw91BGkwlUWxMVivuM1t7vh99Bytthnig+RIIIwK/4LAJCGFhUb0Dr13UQwB0KyF7Z/W1ydqwSl8/fnz8bytpycVrZdlWPkYqMj/zfV2DOeNR8/4RCk/B8i781+AbdkcxLIL9kXopH/wsWXm7Rd99OVUqa0zDiK6vl6JIPxC0/LcCeOYeYwZIvUlD9Tl6JOuv1v0dp8DRAwn5a9BcUVtRUuo81q3eyECSdxWldK9DXsGZ1pY4DBanMqMPPADS6RvwQeeFlN/MVtwu7YfwZzFNJzspEYAJWHbVB4JMsWq9hVtQ4okL7j5FYt7QK5BNhxidAplaI0GhgbIlrpG+3xze58T1AOWfPBVDWyWZ+wSwNZuCKVxR6/kmKJg0lHp6nI3TW2+t+uUPuHKnGRyswpLhMIM5nJJu3rPcuil1rldPCgMYWLI4oVmKnUm5Pd2Bre/Fe3EQYafQcu/1jau9I6uOWY7Ha9tiPD3F9q4VCPJf+QbQoRQWD3PlFDLVeT3bhtzfA9dEkqCqrZSDT5Y1elDC4MKgsZTVHGanN6ez0aw8plDPALYOPXJ5sTmrBa9D4nEYyWiTA6rF1VPr4l8aAHsh6oNwT7lcjraDBTuxAd8HV/33mH4B7T1CP8xs6BOoUB7J/hmBkt/jhcONPZQc0bYDcY8KZRtJtu+mVLZBDstvDxHf6kHruigelA914ScAm99HpnwsZOEpn499cMl4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB5110.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(52116005)(1800799015)(7416005)(376005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-Anti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+Uz3G4gV5ZiFUEUbW7jnVVNOJN7gpFUrb4zHDX6Z257M+NDBdYfSZ9ReZsFIu2ViIhHc/Rb3PB/FR/Shqo9/T+eae3UZ6nHezCQFx5XSJJ4uNAortZxdYycvp4VXKmVe3h5bXLS7ueqqh/PBxDZLuwYx5ciB8kaLIlTvslYNj54V2WXw1rDsF7xxpK5zCavFyElsYn3BB031u2SB5bcYDtCX+mhffRYqN/VjA1T8nzcLRS0DB+qgqoy4pN6ZNR5axy2IE5GhMzmrXZhR1t8hR5giro/4d4u7DeCROKoXaOk4ndiiqImycrmzJq1+zCtXayXhF6wy4k/b0brveSFA74CMbQiCfg9i3BU5pz1hfXdlQ9xqZaHmfq9e4EAQx2tcCVDCs1RDjE7tn/Cp+tYb24KmZn2Lj8w3cqdm1A0pmP5KWTIbGfJTvySzqAc98AyNwrBj2eXMzo+8j+cV6N+c73rNfw8RZomFuPy+mwc5JyKNV895QaC+uIf7Ml9uUc5oGZOJMCHfh505T4fWfGzrPQNWZloE/2P3EV+zc17kFPK2cup X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41663eb0-2a67-4b1a-9119-08dc89e0d5d6 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5110.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 06:36:33.3859 (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: fHhBJ7d6GZLSjpYwF9KYK8lSRinYPKxmy6qLh2JnttMn5PbyXcTWFh0KwzaZJ0Ex4JUdHouD471I/or5NZoMHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9977 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 Acked-by: Ilya Dryomov --- 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;