From patchwork Thu May 30 13:26:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ofir Gal X-Patchwork-Id: 800236 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2118.outbound.protection.outlook.com [40.107.7.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 604CC183996; Thu, 30 May 2024 13:26:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.118 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717075620; cv=fail; b=j1bV1Dwc9sz6kyk2KjvcUD7Wyqe1Vrh7pPIPc6P7mlrNRIaA2Sgxx958HB8xgwXHqJQMZQlt5EbrqrxeQZ9opDMaTCIHbgI2sdSsrxt3YrXkGFYDfTjt20cRuv7D7v8/3O2RQa//QOQVzi+9IZOItZgBx9DoOY0xSYOOr8Ir2/w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717075620; c=relaxed/simple; bh=YJD+FPKgbmJBQczz7F0n2W7TR14NqRIo6Xol2gzLjeo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=F/Do818NYfJFm81FO6zHVv/rUDI8X5Md80aLjqM4xP7s9IW13Dkax05nwmYIQ0sbQt7wJXhsATRLQbGn+HbstGsEen1sOj7RWmi+vkDMEzetW8rfxWyX082sVbfBLpR9ojVCh73VeziN5aD3kOOgCsP+mFKpyUZbSa4McMOcSCk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com; spf=pass smtp.mailfrom=volumez.com; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b=X+SCcUG1; arc=fail smtp.client-ip=40.107.7.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=volumez.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=volumez.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=storingio.onmicrosoft.com header.i=@storingio.onmicrosoft.com header.b="X+SCcUG1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iGje6C/NKvWSrZF2am7UnlK2nNtDAfvxfkOByM+EN9m6pl0Cf128mMj2eg1lGlzGK3wWhiGmqhi06V4512hWIjc75KmMyLZgI2GfXU+qTf+nEffbAS0drrilIJH+gsxUOHUBUPJBXJAroaGtlkf2OXWCgrX1NwWSW5+R6GEQPoegzGRo2m5bu6Zbyeo59mmkOLwwG+N7CmxYxos6DSyQX1M01aPfbcXLZQgUogYeaoCbG53wRwTPKAEtR6C03hqEEiokCQUd419IEhN3XrbaPf82zYySJwPDHKBBZdP1FBDUbvXGPH063e18DzHbWwpy70S7N7eNrS9o6Z0iHq/gKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u6CD2Ca2T75xtBaR82rnXRMIKFDHu6ZHcG7APYtvi+I=; b=IZWLcg4PppxgtIT8Uj2AD/slUVzLDXXcgxoC2td2QsaGu3EFF0l7FDJ3TiXO90gGdJb56+8GEksn4WI5tcD1Emd3CIZWVtMnknXubkno5YB9RWdl6JicbSE0/fGoM1FQV5S9HwjyqhLvRJgS4wx3GXHgYIr1nVKSbGMMvaGDQgKQYZ3YXOLiqp4Mq8Lh/q/PK13shWQi0f6T5MgMXha2t8sv0TiOZt3tvPwdESgmjKExDPDH8oojsxW2elwZzpvmhjkxhGPjJKOeWkqO/18/1fagWLexbXh73iCDR3RW3bOnC/TYps9LCApF6d+UF3Lrz5LQeqpXXeQtvqkfiCUU3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=volumez.com; dmarc=pass action=none header.from=volumez.com; dkim=pass header.d=volumez.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=storingio.onmicrosoft.com; s=selector1-storingio-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u6CD2Ca2T75xtBaR82rnXRMIKFDHu6ZHcG7APYtvi+I=; b=X+SCcUG1Tenv3FuXjbOJSfgZdduTdS95ZXJy+kMZxDh5rEOLiMm1HJnIHUewu96p7kh919f3mH28xEGlwFZx6yYbt5/Yy/0JAnu/QAqZJgZEZg9g9DM2iOoJzaLa3nrA34QF4UvtdE28sLby17/om7r7duqx8AYjEUz/vdoZ2WfNFF9ocgSUj+k66wdTgxIiMXXnpLNa5j7VJa+ynK/JAHC3IATdd6ErKYUqpazndrkWw2Za/ZjExQGX4LGoQjSooEIm/rBKZ3yhQLTtCv7XuaClYjHpTXj8HOqHNonS6lnJu99lZ9dTvsOxNC9k46gURXHgIMUz+em0rmVJp3cz+w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=volumez.com; Received: from AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) by PAXPR04MB8814.eurprd04.prod.outlook.com (2603:10a6:102:20d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Thu, 30 May 2024 13:26:58 +0000 Received: from AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb]) by AM0PR04MB5107.eurprd04.prod.outlook.com ([fe80::de53:c058:7ef:21fb%3]) with mapi id 15.20.7611.030; Thu, 30 May 2024 13:26:58 +0000 From: Ofir Gal To: davem@davemloft.net, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, netdev@vger.kernel.org, ceph-devel@vger.kernel.org Cc: dhowells@redhat.com, edumazet@google.com, pabeni@redhat.com, kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me Subject: [PATCH 2/4] nvme-tcp: use sendpages_ok() instead of sendpage_ok() Date: Thu, 30 May 2024 16:26:24 +0300 Message-ID: <20240530132629.4180932-3-ofir.gal@volumez.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240530132629.4180932-1-ofir.gal@volumez.com> References: <20240530132629.4180932-1-ofir.gal@volumez.com> X-ClientProxiedBy: TL2P290CA0005.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:2::15) To AM0PR04MB5107.eurprd04.prod.outlook.com (2603:10a6:208:cb::11) Precedence: bulk X-Mailing-List: ceph-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB5107:EE_|PAXPR04MB8814:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e14c051-7083-4daa-6d11-08dc80ac2e6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|376005|7416005|1800799015|366007|52116005|38350700005; X-Microsoft-Antispam-Message-Info: 5RUiHKm3Cisyj569Zo5cMADn7EN3vLWe7tr0pRtvOWR50fYwbtf/zBsitW0CgUvc5rrGU7GgD2kCPTlzKbzA75ATCVxcaS1wBxyuN4JVOyAG8NUHgIschJHcGdQoc1pkV0lC09G03frE9tSxZ6GJoaszZkZT5qfIAL9pd/7RBiijCE6rmlUS0fH6WEFxOg4CPXmb1yWB5XcCEnwAE2F+I8mcpjycE9R90elEyBR0CpVnAWtn/NA/8Y4vk0gvb8A7hUgZuforFZ6YpVBRJBo8ywvy0w+zKtiiS/44ghzeejA10eN4XNjGecbxrWtnD0PInCpCh3xjFePEsB+OEfs13Rj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IPV:NLI; SFV:NSPM; H:AM0PR04MB5107.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(7416005)(1800799015)(366007)(52116005)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kPXpXVsEndokRDFOnDbK11qcfFgzaQ8fWbyF1+0xH38Pn1gRnGonY/X1wRunCqowqc7qQIHGR2i+lr54ZB9HAFXXT0i0LkgtbBBELRu/srPmwawLRmn9PwWu+rD7a3En3RYM1C5TvX17jDx1ymHFrqYKmY+TBa+ffyGrwzTmiCj1lrywEaPHhK2nfeFvbhRKnFo6ETX3sGdHRW3JOsDVUvHcBdBDv9ssEEzZvzZQfO2yjsEEHNNIRmsXS8rTzzw18hH3sIuOYtD110WMJ0lBM+mTkIvXlJc3/TMmDjQLLo7qALnQDs9VL0/9ceXaqWG5yweA07La3xurswrFnqGQDCkBlmt7Uh43uFK9CI59g7w+yqp6UQG0Hg/rHXuUsDxLn5dcVnVfexICkKSyL95BystW1PUm0gRBJHLCtlZwZfbtdTyxZdnzSuZLfiie6ik/OXyvt11c8lbd8/yzRx2XGHFDGiZuG95nMzj/yVPrBrtgSqUMe9d/EuoWhhmZNiVi7e2CdwheiuacS0pesptCLW2wRmwuhrwITkCNh9ayPGhrw89b+ND8FUdPCj+C8y54B9gdUTH5X1ZGgU6GzV4oIafXfuR3dGgkbOXfUVg5ArWUc1Lf8u6YSHVPtiw3P1sVeUvLlW9tFqfyI/Vn2WLKFOteoI4G3Eq0iJ5TP+6LvrZ1fB8f/+NuQGgf+zgPuocU7UcISYArqgXoia4mKAaX1RSMiSJJjKnZnAbzNjIN0WluGsHg/LWytOMqCaMdZYyEAV1VNeAUwZwg9IWrEt0vLHx0/F5bM78txsd/6e/F7aLv2M+mqmkBAIc7TIbZt2jfup9kMm8tsQALHAL6EPMFsJQSXDHjMYIzTbm1XM51NiiG38bceN1pn7bee8tqGO4iuZNhewMVemwkqgLdMpfV+5Ou21CbWyt/P9xkNkf8ZjK3KAeMaaqVDYok162M26VVQZsL+i5gVaKasT2aglwS/86nLatUXsXqUMqih2XisRYLDZxHm8dVvdM5nAOKH7g2+eg5ulXieqkQkJR9NrZyCBlo0zFVkv90RtlTQviYQUZsn66XoTD7lWqjSTjkH0AzzYcDQ3I6BdxxHBag4gz2vhAzVqViRzrV6Reh2waKB4EFnyvDij92ex2Xr5wNqr9uBwqiyVKQ4/K4C3TjsEGPMJdTe+YjrC4vIY/HCOBwPgBOBzRyrHl2mkO+zn8b8aT8MVAu5jA6MYRWzhYngnInw1gxuad+eeFLkYt/AAj3G07xxoOE/I7Cpu1eIU8I5HUIQ8Jg/WqaY2XQangFwB3ZHSqlA43z7rhpKhKkcwNcxffYRMC5NwfhNTYGw8QYkIuVFMTuQ7yoIwfgru7MThfMypSHRBovEGkxIIxH3qxCbcDBsCVjhaq9fOZRqmOoLVhHh/ucjo+K/ylOY4oGQ3i0vdYlAyRLfXny7X3mMh+ZnkZHglh2kGlCAdRQR3w1OyDVR2C7IQ+X9RSB0pTw+Ab7Xdni0h1DJ3mFkXZx8s2BfYHmlXtKp2Ej8dSmvWqUCzG4DXP24yOMb/8DyBdEgxRe2zyB5MdO2CTw+x5Q/TWqk4t078apj69mq0qNK5q3aq8S X-OriginatorOrg: volumez.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e14c051-7083-4daa-6d11-08dc80ac2e6a X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5107.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 13:26:58.2923 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b1841924-914b-4377-bb23-9f1fac784a1d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: o0xu8W7k5fpDAM4l+a+aDFw9XbM10l8ba2QlotGD8FCi+We+B0WAyTb4ZPAtBZOR4AN1MSRVann2buy+gZdzWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8814 Currently nvme_tcp_try_send_data() use sendpage_ok() in order to disable MSG_SPLICE_PAGES, it check the first page of the iterator, the iterator may represent contiguous pages. MSG_SPLICE_PAGES enables skb_splice_from_iter() which checks all the pages it sends with sendpage_ok(). When nvme_tcp_try_send_data() sends an iterator that the first page is sendable, but one of the other pages isn't skb_splice_from_iter() warns and aborts the data transfer. Using the new helper sendpages_ok() in order to disable MSG_SPLICE_PAGES solves the issue. Signed-off-by: Ofir Gal Reviewed-by: Hannes Reinecke --- drivers/nvme/host/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 8b5e4327fe83..9f0fd14cbcb7 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1051,7 +1051,7 @@ static int nvme_tcp_try_send_data(struct nvme_tcp_request *req) else msg.msg_flags |= MSG_MORE; - if (!sendpage_ok(page)) + if (!sendpages_ok(page, len, offset)) msg.msg_flags &= ~MSG_SPLICE_PAGES; bvec_set_page(&bvec, page, len, offset);