mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: agk@redhat.com, akpm@linux-foundation.org, anuj20.g@samsung.com,
	axboe@kernel.dk, bmarzins@redhat.com, brauner@kernel.org,
	christian.koenig@amd.com, dm-devel@lists.linux.dev,
	dri-devel@lists.freedesktop.org, hch@lst.de,
	io-uring@vger.kernel.org, jack@suse.cz, joshi.k@samsung.com,
	kbusch@kernel.org, linaro-mm-sig@lists.linaro.org,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-nvme@lists.infradead.org, matthew.brost@intel.com,
	mpatocka@redhat.com, nj.shetty@samsung.com,
	phil.cayton@intel.com, sagi@grimberg.me, snitzer@kernel.org,
	sumit.semwal@linaro.org, tushar.gohad@intel.com,
	viro@zeniv.linux.org.uk, william.power@intel.com
Subject: Re: [PATCH v7 06/13] nvme-pci: implement dma-buf backed requests
Date: Wed, 30 Sep 2026 11:09:41 +0100	[thread overview]
Message-ID: <77db5aa5-f160-48fb-ab59-a754b100bc34@gmail.com> (raw)
In-Reply-To: <5a35ad21-c9d4-4dab-a4f0-97baee6e2301@wanadoo.fr>

On 9/29/26 16:45, Christophe JAILLET wrote:
...>> +    for_each_sgtable_dma_sg(sgt, sg, tmp) {
>> +        dma_addr_t dma_addr = sg_dma_address(sg);
>> +        unsigned long sg_len = sg_dma_len(sg);
>> +
>> +        if ((sg_len % NVME_CTRL_PAGE_SIZE) ||
>> +            (dma_addr % NVME_CTRL_PAGE_SIZE)) {
>> +            ret = -EINVAL;
>> +            goto err;
>> +        }
>> +        while (sg_len) {
>> +            map->dma_list[i++] = dma_addr;
>> +            dma_addr += NVME_CTRL_PAGE_SIZE;
>> +            sg_len -= NVME_CTRL_PAGE_SIZE;
>> +        }
>> +    }
>> +
>> +    ret = dma_buf_io_init_map(ctx, &map->base, sgt);
>> +    if (ret)
>> +        goto err;
>> +    map->nr_entries = nr_entries;
>> +    map->sgt = sgt;
>> +    return &map->base;
>> +err:
>> +    if (sgt)
>> +        dma_buf_unmap_attachment(attach, sgt, ctx->dir);
>> +    kfree(map);
> 
> kvfree()?

Sashiko also flagged this one. I'm going to apply the nits from
both emails, thanks.

-- 
Pavel Begunkov


  reply	other threads:[~2026-09-30 10:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 13:32 [PATCH v7 00/13] Add dmabuf read/write via io_uring Pavel Begunkov
2026-09-28 13:32 ` [PATCH v7 01/13] dma-buf: introduce initial file I/O infrastructure Pavel Begunkov
2026-09-29 16:12   ` Christophe JAILLET
2026-09-28 13:32 ` [PATCH v7 02/13] iov_iter: add iterator type for dmabuf maps Pavel Begunkov
2026-09-28 13:32 ` [PATCH v7 03/13] block: always adjust bi_offset on bio_advance_iter Pavel Begunkov
2026-09-28 13:32 ` [PATCH v7 04/13] block: introduce dma map backed bio type Pavel Begunkov
2026-09-28 13:32 ` [PATCH v7 05/13] block: add dma-buf support for raw bdev Pavel Begunkov
2026-09-28 13:32 ` [PATCH v7 06/13] nvme-pci: implement dma-buf backed requests Pavel Begunkov
2026-09-29 15:45   ` Christophe JAILLET
2026-09-30 10:09     ` Pavel Begunkov [this message]
2026-09-28 13:32 ` [PATCH v7 07/13] nvme-pci: rename nvme_pci_sgl_set_data to nvme_pci_dma_iter_set_sgl Pavel Begunkov
2026-09-28 13:32 ` [PATCH v7 08/13] nvme-pci: add SGL support for the dmabuf path Pavel Begunkov
2026-09-28 13:32 ` [PATCH v7 09/13] io_uring/rsrc: introduce buf registration structure Pavel Begunkov
2026-09-28 13:32 ` [PATCH v7 10/13] io_uring/rsrc: extend buffer update Pavel Begunkov
2026-09-28 13:32 ` [PATCH v7 11/13] io_uring/rsrc: add uncloneable regbuf flag Pavel Begunkov
2026-09-28 13:32 ` [PATCH v7 12/13] io_uring/rsrc: add regbuf import flags Pavel Begunkov
2026-09-28 13:32 ` [PATCH v7 13/13] io_uring/rsrc: add dmabuf backed registered buffers Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77db5aa5-f160-48fb-ab59-a754b100bc34@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=agk@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=anuj20.g@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=bmarzins@redhat.com \
    --cc=brauner@kernel.org \
    --cc=christian.koenig@amd.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dm-devel@lists.linux.dev \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@lst.de \
    --cc=io-uring@vger.kernel.org \
    --cc=jack@suse.cz \
    --cc=joshi.k@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=matthew.brost@intel.com \
    --cc=mpatocka@redhat.com \
    --cc=nj.shetty@samsung.com \
    --cc=phil.cayton@intel.com \
    --cc=sagi@grimberg.me \
    --cc=snitzer@kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tushar.gohad@intel.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=william.power@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®