qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Konstantin Shkolnyy <kshk@linux.ibm.com>
Cc: qemu-devel@nongnu.org, dtatulea@nvidia.com,
	Cindy Lu <lulu@redhat.com>,  eperezma <eperezma@redhat.com>
Subject: Re: VDPA MAC address problem
Date: Mon, 24 Mar 2025 12:04:35 +0800	[thread overview]
Message-ID: <CACGkMEsK12J6+vrg_rnv9mL6=AGRKsiUvuXcaafEh1BzaFpDPQ@mail.gmail.com> (raw)
In-Reply-To: <816c6468-9fb4-44d3-9bce-ecdc04f118be@linux.ibm.com>

On Fri, Mar 21, 2025 at 12:29 PM Konstantin Shkolnyy <kshk@linux.ibm.com> wrote:
>
> On 3/20/2025 20:22, Jason Wang wrote:
> > On Fri, Mar 21, 2025 at 12:45 AM Konstantin Shkolnyy <kshk@linux.ibm.com> wrote:
> >>
> >> On 3/19/2025 19:58, Jason Wang wrote:
> >>> On Thu, Mar 20, 2025 at 12:34 AM Konstantin Shkolnyy <kshk@linux.ibm.com> wrote:
> >>>> Upon reading this forum, I see that VHOST_VDPA_SET_CONFIG is
> >>>> “deprecated”, and so VIRTIO_NET_CTRL_MAC_ADDR_SET must be the right
> >>>> method, but it’s apparently called too late.
> >>>
> >>> VHOST_VDPA_SET_CONFIG requires the vDPA parent support which is not
> >>> necessarily there.
> >>
> >> The mlx5 driver doesn't do anything for VHOST_VDPA_SET_CONFIG. Intel's
> >> driver, however, apparently stores the configuration. So, it appears,
> >> Intel will avoid the problem... Perhaps mlx5 could do the same so that
> >> QEMU can set the address before it starts the VM (QEMU doesn't have to
> >> later let the VM change the config).
> >
> > The problem is that config space is not allowed to be written, that is
> > why mlx5 doesn't implement the write method.
> >
> >> Conceptually, setting the address
> >> by QEMU cmdline doesn't look different from setting it by "vdpa dev add".
> >
> > It's kind of different.
> >
> > E.g the device may not even have VIRTIO_NET_F_MAC feature etc.
>
> I'm not sure I understand... This is the MAC address returned by
> VHOST_VDPA_GET_CONFIG. If mlx5 allows it to be set by "vdpa dev add",

This requires privileges where userspace(VM) doesn't necessarily have.

> shouldn't it also allow it to be set by VHOST_VDPA_SET_CONFIG called by
> virtio_net_device_realize(), before the VM exists.
>
> When VM starts running, it queries this MAC address and QEMU fetches it
> by VHOST_VDPA_GET_CONFIG. But, because VHOST_VDPA_SET_CONFIG hasn't
> stored it, it fetches a wrong stale address.

For example, for some reason management wants to forbid mac address
changes from the guest.

Thanks



      parent reply	other threads:[~2025-03-24  4:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19 16:34 VDPA MAC address problem Konstantin Shkolnyy
2025-03-20  0:58 ` Jason Wang
2025-03-20  6:54   ` Eugenio Perez Martin
2025-03-20 13:59     ` Konstantin Shkolnyy
2025-03-20  9:14   ` Cindy Lu
2025-03-20 14:18   ` Konstantin Shkolnyy
2025-03-21  1:23     ` Jason Wang
2025-03-20 16:45   ` Konstantin Shkolnyy
2025-03-21  1:22     ` Jason Wang
2025-03-21  4:29       ` Konstantin Shkolnyy
2025-03-21  6:18         ` Cindy Lu
2025-03-24  4:04         ` Jason Wang [this message]

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='CACGkMEsK12J6+vrg_rnv9mL6=AGRKsiUvuXcaafEh1BzaFpDPQ@mail.gmail.com' \
    --to=jasowang@redhat.com \
    --cc=dtatulea@nvidia.com \
    --cc=eperezma@redhat.com \
    --cc=kshk@linux.ibm.com \
    --cc=lulu@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).