On Mon, Apr 21, 2025 at 11:14 AM Jason Wang <jasow...@redhat.com> wrote:
>
> On Thu, Apr 17, 2025 at 6:25 PM Cindy Lu <l...@redhat.com> wrote:
> >
> > When using a VDPA device, it's important to ensure that the MAC
> > address is correctly set.
> > This patch adds a new QEMU command line parameter to enable MAC
> > address verification,  which is enabled by default.
> >
> > Usage example:
> > ....
> > -netdev 
> > type=vhost-vdpa,vhostdev=/dev/vhost-vdpa-0,id=vhost-vdpa0,check-mac=true\
> > -device virtio-net-pci,netdev=vhost-vdpa0\
> > ....
> > To disable this check:
> > ....
> > -netdev 
> > type=vhost-vdpa,vhostdev=/dev/vhost-vdpa-0,id=vhost-vdpa0,check-mac=false\
> > -device virtio-net-pci,netdev=vhost-vdpa0\
> > ....
> >
> > Signed-off-by: Cindy Lu <l...@redhat.com>
>
> This patch needs to be squashed to the patch that implements the real
> logic of the checking.
>
> > ---
> >  include/net/net.h | 1 +
> >  net/vhost-vdpa.c  | 5 +++++
> >  qapi/net.json     | 5 +++++
> >  3 files changed, 11 insertions(+)
> >
> > diff --git a/include/net/net.h b/include/net/net.h
> > index cdd5b109b0..fac1951b6e 100644
> > --- a/include/net/net.h
> > +++ b/include/net/net.h
> > @@ -112,6 +112,7 @@ struct NetClientState {
> >      bool is_netdev;
> >      bool do_not_pad; /* do not pad to the minimum ethernet frame length */
> >      bool is_datapath;
> > +    bool check_mac;

Rethink of this, it is vDPA specific, we probably need to move it to
VhostVDPAState instead.

Thanks


Reply via email to