From: Christoph Hellwig <hch@infradead.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: David Airlie <airlied@linux.ie>,
Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>,
dri-devel@lists.freedesktop.org,
Zhu Yanjun <zyjzyj2000@gmail.com>,
Leon Romanovsky <leon@kernel.org>,
Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>,
linux-rdma@vger.kernel.org, Christoph Hellwig <hch@infradead.org>,
Doug Ledford <dledford@redhat.com>,
VMware Graphics <linux-graphics-maintainer@vmware.com>,
intel-gfx@lists.freedesktop.org,
Roland Scheidegger <sroland@vmware.com>,
Maxime Ripard <mripard@kernel.org>,
Yishai Hadas <yishaih@nvidia.com>,
linux-kernel@vger.kernel.org,
Thomas Zimmermann <tzimmermann@suse.de>,
Maor Gottlieb <maorg@nvidia.com>, Zack Rusin <zackr@vmware.com>
Subject: Re: [Intel-gfx] [PATCH rdma-next v2 1/2] lib/scatterlist: Fix wrong update of orig_nents
Date: Thu, 22 Jul 2021 14:07:51 +0100 [thread overview]
Message-ID: <YPltp39n9URglTXT@infradead.org> (raw)
In-Reply-To: <20210722130040.GH1117491@nvidia.com>
On Thu, Jul 22, 2021 at 10:00:40AM -0300, Jason Gunthorpe wrote:
> this is better:
>
> struct sg_append_table state;
>
> sg_append_init(&state, sgt, gfp_mask);
>
> while (..)
> ret = sg_append_pages(&state, pages, n_pages, ..)
> if (ret)
> sg_append_abort(&state); // Frees the sgt and puts it to NULL
> sg_append_complete(&state)
>
> Which allows sg_alloc_table_from_pages() to be written as
>
> struct sg_append_table state;
> sg_append_init(&state, sgt, gfp_mask);
> ret = sg_append_pages(&state,pages, n_pages, offset, size, UINT_MAX)
> if (ret) {
> sg_append_abort(&state);
> return ret;
> }
> sg_append_complete(&state);
> return 0;
>
> And then the API can manage all of this in some sane and
> understandable way.
That would be a lot easier to use for sure. Not sure how invasive the
changes would be, though.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@infradead.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>,
Doug Ledford <dledford@redhat.com>,
Christoph Hellwig <hch@infradead.org>,
Maor Gottlieb <maorg@nvidia.com>, Daniel Vetter <daniel@ffwll.ch>,
David Airlie <airlied@linux.ie>,
Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>,
dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
Jani Nikula <jani.nikula@linux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Roland Scheidegger <sroland@vmware.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
VMware Graphics <linux-graphics-maintainer@vmware.com>,
Yishai Hadas <yishaih@nvidia.com>, Zack Rusin <zackr@vmware.com>,
Zhu Yanjun <zyjzyj2000@gmail.com>
Subject: Re: [PATCH rdma-next v2 1/2] lib/scatterlist: Fix wrong update of orig_nents
Date: Thu, 22 Jul 2021 14:07:51 +0100 [thread overview]
Message-ID: <YPltp39n9URglTXT@infradead.org> (raw)
In-Reply-To: <20210722130040.GH1117491@nvidia.com>
On Thu, Jul 22, 2021 at 10:00:40AM -0300, Jason Gunthorpe wrote:
> this is better:
>
> struct sg_append_table state;
>
> sg_append_init(&state, sgt, gfp_mask);
>
> while (..)
> ret = sg_append_pages(&state, pages, n_pages, ..)
> if (ret)
> sg_append_abort(&state); // Frees the sgt and puts it to NULL
> sg_append_complete(&state)
>
> Which allows sg_alloc_table_from_pages() to be written as
>
> struct sg_append_table state;
> sg_append_init(&state, sgt, gfp_mask);
> ret = sg_append_pages(&state,pages, n_pages, offset, size, UINT_MAX)
> if (ret) {
> sg_append_abort(&state);
> return ret;
> }
> sg_append_complete(&state);
> return 0;
>
> And then the API can manage all of this in some sane and
> understandable way.
That would be a lot easier to use for sure. Not sure how invasive the
changes would be, though.
next prev parent reply other threads:[~2021-07-22 13:08 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-18 11:09 [Intel-gfx] [PATCH rdma-next v2 0/2] SG fix together with update to RDMA umem Leon Romanovsky
2021-07-18 11:09 ` Leon Romanovsky
2021-07-18 11:09 ` Leon Romanovsky
2021-07-18 11:09 ` [Intel-gfx] [PATCH rdma-next v2 1/2] lib/scatterlist: Fix wrong update of orig_nents Leon Romanovsky
2021-07-18 11:09 ` Leon Romanovsky
2021-07-18 11:09 ` Leon Romanovsky
2021-07-21 16:13 ` [Intel-gfx] " Christoph Hellwig
2021-07-21 16:13 ` Christoph Hellwig
2021-07-22 13:00 ` [Intel-gfx] " Jason Gunthorpe
2021-07-22 13:00 ` Jason Gunthorpe
2021-07-22 13:00 ` Jason Gunthorpe
2021-07-22 13:07 ` Christoph Hellwig [this message]
2021-07-22 13:07 ` Christoph Hellwig
2021-07-22 13:39 ` [Intel-gfx] " Jason Gunthorpe
2021-07-22 13:39 ` Jason Gunthorpe
2021-07-22 13:39 ` Jason Gunthorpe
2021-07-18 11:09 ` [Intel-gfx] [PATCH rdma-next v2 2/2] RDMA: Use dma_map_sgtable for map umem pages Leon Romanovsky
2021-07-18 11:09 ` Leon Romanovsky
2021-07-18 11:09 ` Leon Romanovsky
2021-07-21 16:16 ` [Intel-gfx] " Christoph Hellwig
2021-07-21 16:16 ` Christoph Hellwig
2021-07-18 11:14 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for SG fix together with update to RDMA umem Patchwork
2021-07-22 14:31 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for SG fix together with update to RDMA umem (rev2) Patchwork
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=YPltp39n9URglTXT@infradead.org \
--to=hch@infradead.org \
--cc=airlied@linux.ie \
--cc=dennis.dalessandro@cornelisnetworks.com \
--cc=dledford@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jgg@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-graphics-maintainer@vmware.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=maorg@nvidia.com \
--cc=mike.marciniszyn@cornelisnetworks.com \
--cc=mripard@kernel.org \
--cc=sroland@vmware.com \
--cc=tzimmermann@suse.de \
--cc=yishaih@nvidia.com \
--cc=zackr@vmware.com \
--cc=zyjzyj2000@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.