netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Yishai Hadas <yishaih@nvidia.com>,
	saeedm@nvidia.com, kvm@vger.kernel.org, netdev@vger.kernel.org,
	kuba@kernel.org, kevin.tian@intel.com, joao.m.martins@oracle.com,
	leonro@nvidia.com, maorg@nvidia.com, cohuck@redhat.com
Subject: Re: [PATCH V1 vfio 03/11] vfio: Introduce DMA logging uAPIs
Date: Wed, 6 Jul 2022 21:30:43 -0300	[thread overview]
Message-ID: <20220707003043.GA1705032@nvidia.com> (raw)
In-Reply-To: <20220706171137.47e4aa10.alex.williamson@redhat.com>

On Wed, Jul 06, 2022 at 05:11:37PM -0600, Alex Williamson wrote:
> > +struct vfio_device_feature_dma_logging_control {
> > +	__aligned_u64 page_size;
> > +	__u32 num_ranges;
> > +	__u32 __reserved;
> > +	__aligned_u64 ranges;
> > +};
> 
> num_ranges probably has a limit below 2^32-1, is it device specific?
> How does the user learn the limit?

The driver is expected to groom the provided ranges to meet whatever
limitations the device happens to have. eg expand to fix misalignment,
cluster to fit in the available tracking, increase page size, etc.

The next patch has a small algorithm that works with mlx5's limits.

This way we avoid trying to explain to userspace every possible device
quirk.

eg if the device support one range it should take the lowest and
highest address, fix the alignment, and use that. If that doesn't work
then tracking isn't supported in the configuration.

> Presumably new ranges cannot be added while logging is already enabled,
> should we build this limitation into the uAPI or might some devices
> have the ability to dynamically add and remove logging ranges?  Thanks,

If we see a device that can do dynamic then we'd add a new ioctl for
'add/remove' ranges along with a feature bit for the capability. mlx5
doesn't support that so we aren't adding uapi that isn't implemented..

Jason

  reply	other threads:[~2022-07-07  0:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 10:27 [PATCH V1 vfio 00/11] Add device DMA logging support for mlx5 driver Yishai Hadas
2022-07-05 10:27 ` [PATCH V1 vfio 01/11] net/mlx5: Introduce ifc bits for page tracker Yishai Hadas
2022-07-05 10:27 ` [PATCH V1 vfio 02/11] net/mlx5: Query ADV_VIRTUALIZATION capabilities Yishai Hadas
2022-07-05 10:27 ` [PATCH V1 vfio 03/11] vfio: Introduce DMA logging uAPIs Yishai Hadas
2022-07-06 23:11   ` Alex Williamson
2022-07-07  0:30     ` Jason Gunthorpe [this message]
2022-07-05 10:27 ` [PATCH V1 vfio 04/11] vfio: Move vfio.c to vfio_main.c Yishai Hadas
2022-07-05 10:27 ` [PATCH V1 vfio 05/11] vfio: Add an IOVA bitmap support Yishai Hadas
2022-07-05 10:27 ` [PATCH V1 vfio 06/11] vfio: Introduce the DMA logging feature support Yishai Hadas
2022-07-05 14:11   ` kernel test robot
2022-07-05 14:28     ` Joao Martins
2022-07-05 16:05       ` Joao Martins
2022-07-05 14:22   ` kernel test robot
2022-07-05 10:27 ` [PATCH V1 vfio 07/11] vfio/mlx5: Init QP based resources for dirty tracking Yishai Hadas
2022-07-05 10:27 ` [PATCH V1 vfio 08/11] vfio/mlx5: Create and destroy page tracker object Yishai Hadas
2022-07-05 10:27 ` [PATCH V1 vfio 09/11] vfio/mlx5: Report dirty pages from tracker Yishai Hadas
2022-07-05 10:27 ` [PATCH V1 vfio 10/11] vfio/mlx5: Manage error scenarios on tracker Yishai Hadas
2022-07-05 10:27 ` [PATCH V1 vfio 11/11] vfio/mlx5: Set the driver DMA logging callbacks Yishai Hadas

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=20220707003043.GA1705032@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=joao.m.martins@oracle.com \
    --cc=kevin.tian@intel.com \
    --cc=kuba@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=leonro@nvidia.com \
    --cc=maorg@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=yishaih@nvidia.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;
as well as URLs for NNTP newsgroup(s).