From patchwork Sun Oct 27 14:21:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 13852663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C4E6D13562 for ; Sun, 27 Oct 2024 14:23:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 06EC28D0009; Sun, 27 Oct 2024 10:23:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F0F598D0001; Sun, 27 Oct 2024 10:22:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D3C2F8D0009; Sun, 27 Oct 2024 10:22:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id AA3408D0001 for ; Sun, 27 Oct 2024 10:22:59 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id E9C8AA1C4F for ; Sun, 27 Oct 2024 14:22:19 +0000 (UTC) X-FDA: 82719597786.03.5FD734C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id 11EB712000E for ; Sun, 27 Oct 2024 14:22:27 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pd0BzzZL; spf=pass (imf29.hostedemail.com: domain of leon@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=leon@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730038899; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=qCSfEUxX1kivYoEN/pG87zG2xU+fc4uyPhwvg4kTeno=; b=5OOx6bmmAuCUGEl8S8OA64DONRPhH2LhbxZpM2F5VplYeQYNvBmpM1rY7sVK3xYPto9W5T m9o4iBN4JkNI0l2AfBieDq+U/z+IcrAeXTt5Y8aD8ShD8FgvVG1zL8ZRecXZG/F2Z0rns7 VQNY+4HPnQKszlFHsvK335apCtDYGtM= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pd0BzzZL; spf=pass (imf29.hostedemail.com: domain of leon@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=leon@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730038899; a=rsa-sha256; cv=none; b=5M+y/GBPPjs4KM4eWQ+ChEzAqtKiT19zD5h9vqv3xoC6+qzJTOQfKVMDI3/l9bgxmPORzd hrWuK1qveLwcFb6tFFwxkFMojiD7TyGsxBp8XuTcLJiAgKfK29aNpE5ZQyIrU1hxAaM547 S2T+BVEVjrTdcdPfJBndAARauOhPi8k= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 2A2CC5C5416; Sun, 27 Oct 2024 14:22:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 319FEC4CEC3; Sun, 27 Oct 2024 14:22:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730038977; bh=BINE0bzsOqI+RjXMn339mOpninDICNxaXannsg5oEKA=; h=From:To:Cc:Subject:Date:From; b=pd0BzzZLKEzBqB8FWM9UZHam4tYNjsnnks0WcWuSmuuGlWxovKjdQAiI80MVb2wGZ MTG3Xte9Jh0NPOVe8g5i1zq0pO5fVaNHNx2Y5e677UAgwYHjtDxNvA9Zat2wJBBXiz R9aUDLrTH2666bqNkqWn8CjaFttj2+pvGYC79+kM2RvXqapBiYUhaEBxX04LxMqBA5 nEFd2n+xRDKhnirU2/wPoC5KGRP0XTSFPNger8/n0w6gzVIWEHU+Kx5hRf7z0+eAnI hxdNIMaJRWkRkHkRXtlZgB+O6cM86XADyzKCTloRhKNu3+iYzVgS1Hqy8Wx0zQnauc 6bI4K5B/nVNRA== From: Leon Romanovsky To: Jonathan Corbet , Jens Axboe , Jason Gunthorpe , Robin Murphy , Joerg Roedel , Will Deacon , Christoph Hellwig , Sagi Grimberg Cc: Keith Busch , Bjorn Helgaas , Logan Gunthorpe , Yishai Hadas , Shameer Kolothum , Kevin Tian , Alex Williamson , Marek Szyprowski , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Andrew Morton , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-rdma@vger.kernel.org, iommu@lists.linux.dev, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 0/7] Block and NMMe PCI use of new DMA mapping API Date: Sun, 27 Oct 2024 16:21:53 +0200 Message-ID: X-Mailer: git-send-email 2.46.2 MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 11EB712000E X-Stat-Signature: mxf73yfnb5qatco9d6efjai179xqk1pb X-HE-Tag: 1730038947-790106 X-HE-Meta: U2FsdGVkX1/nIDvZWV+/Oi7osl9eHXuL1BFo0HnA/kqLQbwCl8znm5T13TKA3ZVTppo4OOpJwR9VawPAeSEM7UpnSbjW+6mqaJz5LQZa+DhWha2SQxrJFAIMhzvrTgVM5QslyqoWHpgkCP2gF/dmNfUbTb2mv/P+J7kJ3CF9CjgS+VS59B8LkWSpim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Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This is complimentary patchset to the series which adds new DMA mapping API [1]. In this series, Christoph converts existing nvme-pci driver to use new API, which is wrapped by relevant blk-mq helpers, so future blk drivers can reuse them in block layer specific structures. This is posted as RFC as it is under heavy testing now, and presented here to get feedback from the community and show another advanced use case of the new API. Thanks [1] https://lore.kernel.org/all/cover.1730037276.git.leon@kernel.org Christoph Hellwig (7): block: share more code for bio addition helpers block: don't merge different kinds of P2P transfers in a single bio blk-mq: add a dma mapping iterator blk-mq: add scatterlist-less DMA mapping helpers nvme-pci: remove struct nvme_descriptor nvme-pci: use a better encoding for small prp pool allocations nvme-pci: convert to blk_rq_dma_map block/bio.c | 148 ++++++------ block/blk-map.c | 32 ++- block/blk-merge.c | 313 +++++++++++++++++------- drivers/nvme/host/pci.c | 470 +++++++++++++++++++------------------ include/linux/blk-mq-dma.h | 64 +++++ include/linux/blk_types.h | 2 + 6 files changed, 636 insertions(+), 393 deletions(-) create mode 100644 include/linux/blk-mq-dma.h