All of lore.kernel.org
 help / color / mirror / Atom feed
From: liulongfang <liulongfang@huawei.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: <alex.williamson@redhat.com>,
	<shameerali.kolothum.thodi@huawei.com>, <john.garry@huawei.com>,
	<cohuck@redhat.com>, <linux-kernel@vger.kernel.org>,
	<linuxarm@openeuler.org>
Subject: Re: [PATCH v3 1/5] vfio/migration: Add debugfs to live migration driver
Date: Thu, 1 Dec 2022 09:37:02 +0800	[thread overview]
Message-ID: <5c08db2b-386c-fadd-d975-412e4d344b03@huawei.com> (raw)
In-Reply-To: <Y4YF6KmQMys+w2hi@nvidia.com>

On 2022/11/29 21:15, Jason Gunthorpe wrote:
> On Tue, Nov 29, 2022 at 10:02:46AM +0800, liulongfang wrote:
>> On 2022/11/28 21:39, Jason Gunthorpe wrote:
>>> On Mon, Nov 28, 2022 at 11:11:56AM +0800, Longfang Liu wrote:
>>>
>>>> @@ -119,6 +132,9 @@ struct vfio_migration_ops {
>>>>  				   enum vfio_device_mig_state *curr_state);
>>>>  	int (*migration_get_data_size)(struct vfio_device *device,
>>>>  				       unsigned long *stop_copy_length);
>>>> +	int (*migration_get_data)(struct vfio_device *device, char *buffer);
>>>> +	int (*migration_get_attr)(struct vfio_device *device, char *buffer);
>>>> +	int (*migration_debug_operate)(struct vfio_device *device,
>>>>  				   unsigned int cmd);
>>>
>>> Please don't do wrappers like this, give the variant driver a chance
>>> to create its own files natively under the debugfs directory
>>>
>>
>> Using this public debugfs file does not need to deal with file
>> creation and destruction.
>> The driver only needs to define its debug operation command,
>> isn't it simpler?
> 
> No, it is obfuscating the normal kernel apis, what if a driver wants
> two files?
> 

Yes, if there are special devices that require multiple debugfs files
and use the same operation, using this migration_debug_operate() will
cause the function to be impossible.

Thanks,
Longfang.

> debugfs is not a heavy burden to implement files for.
>
> Jason
> .
> 

  reply	other threads:[~2022-12-01  1:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28  3:11 [PATCH v3 0/5] add debugfs to migration driver Longfang Liu
2022-11-28  3:11 ` [PATCH v3 1/5] vfio/migration: Add debugfs to live " Longfang Liu
2022-11-28 13:39   ` Jason Gunthorpe
2022-11-29  2:02     ` liulongfang
2022-11-29 13:15       ` Jason Gunthorpe
2022-12-01  1:37         ` liulongfang [this message]
2022-11-28  3:11 ` [PATCH v3 2/5] hisi_acc_vfio_pci: extract public functions for container_of Longfang Liu
2022-11-28  3:11 ` [PATCH v3 3/5] hisi_acc_vfio_pci: register debugfs for hisilicon migration driver Longfang Liu
2022-11-28  3:11 ` [PATCH v3 4/5] Documentation: add debugfs description for hisi_acc_vfio_pci Longfang Liu
2022-11-28  3:12 ` [PATCH v3 5/5] vfio: update live migration device status Longfang Liu

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=5c08db2b-386c-fadd-d975-412e4d344b03@huawei.com \
    --to=liulongfang@huawei.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=john.garry@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@openeuler.org \
    --cc=shameerali.kolothum.thodi@huawei.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.