qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cindy Lu <lulu@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>,
	mjt@tls.msk.ru, QEMU Developers <qemu-devel@nongnu.org>,
	qemu-stable@nongnu.org
Subject: Re: [PATCH] virtio-net : Add check for VIRTIO_NET_F_MAC
Date: Thu, 30 Sep 2021 09:35:15 +0800	[thread overview]
Message-ID: <CACLfguVsjZbDo0JXMHJeNSusOyimajOABBG66T6tm32QN=ihEw@mail.gmail.com> (raw)
In-Reply-To: <20210929093513-mutt-send-email-mst@kernel.org>

On Wed, Sep 29, 2021 at 9:36 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Wed, Sep 29, 2021 at 08:08:40PM +0800, Cindy Lu wrote:
> > On Wed, Sep 29, 2021 at 6:07 PM Michael Tokarev <mjt@tls.msk.ru> wrote:
> > >
> > > 29.09.2021 09:52, Cindy Lu wrote:
> > > > For vdpa device, if the host support VIRTIO_NET_F_MAC
> > > > we need to read the mac address from hardware, so need
> > > > to check this bit, the logic is
> > > > 1 if the host support VIRTIO_NET_F_MAC and the mac address
> > > >     is correct, qemu will use the mac address in hardware
> > > > 2.if the host not support , qemu will use the mac from cmdline
> > >
> > > So if hw supports NET_F_MAC, cmdline-provided parameter will
> > > silently be ignored?
> > >
> > yes, this is based on the virtio spec, you can check this document in
> > 5.1.5 Device Initialization
> > https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html
>
> Maybe use the hw mac if mac is not provided? If provided
> make sure the command line matches the hardware, and fail
> otherwise?
>

so here come to the final question. which mac address has the higher priority?
I think the NET_F_MAC bit means the hw mac address > command-line address.
if the hw drivers want to change this. they can simply remove this bit.


> > Also, this check it only working for vdpa device
> > > s/host not support/host does not support this feature/
> > Thanks , will fix this
> > >
> > > > 3.if the cmdline not provide mac address, qemu will use radam mac
> > > > address
> > >
> > > s/not/does not/
> > > s/radam/random/
> > >
> > thanks, will fix this
> > > Thanks,
> > >
> > > /mjt
> > >
>



  reply	other threads:[~2021-09-30  1:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29  6:52 [PATCH] virtio-net : Add check for VIRTIO_NET_F_MAC Cindy Lu
2021-09-29 10:01 ` Michael Tokarev
2021-09-29 12:08   ` Cindy Lu
2021-09-29 13:36     ` Michael S. Tsirkin
2021-09-30  1:35       ` Cindy Lu [this message]
2021-09-30 10:46         ` Michael Tokarev

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='CACLfguVsjZbDo0JXMHJeNSusOyimajOABBG66T6tm32QN=ihEw@mail.gmail.com' \
    --to=lulu@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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).