On 5/4/2023 10:40 AM, Jason Gunthorpe wrote:
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
On Fri, Apr 21, 2023 at 06:06:39PM -0700, Brett Creeley wrote:
+static struct pds_vfio_lm_file *
+pds_vfio_get_lm_file(const struct file_operations *fops, int flags, u64 size)
+{
I see this function is called with a hardwired 64k size on restore -
so this means save is also limited to 64k?
This is really overcomplicated if that is the state size you are
working with - the mlx5 code this was copied from is dealing with much
larger values.
Just kvalloc() your 64k and be done with it. You need a bit of fussing
to DMA map the vmap, but it is much simpler than all of this
stuff. See fpga_mgr_buf_load()
Since the kvalloc is linear the read/write is just memcpy.
Jason
My only thought here is that if we ever need to support a larger device
state size in the future we may have to revisit this implementation once
again.
I will look into this before pushing the next revision. Thanks for the
example/pointer to fpga_mgr_buf_load() and for the review.
Brett