[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACLfguWr37_OON9f7T3=tu87Fp1ZDm2gKxREikAUCnD8+McVvQ@mail.gmail.com>
Date: Thu, 6 Nov 2025 15:32:42 +0800
From: Cindy Lu <lulu@...hat.com>
To: Dragos Tatulea <dtatulea@...dia.com>
Cc: mst@...hat.com, jasowang@...hat.com, netdev@...r.kernel.org,
virtualization@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] vdpa/mlx5: update mlx_features with driver state check
whie
On Wed, Nov 5, 2025 at 6:03 PM Dragos Tatulea <dtatulea@...dia.com> wrote:
>
> Thanks for your patches!
>
> On Wed, Nov 05, 2025 at 04:01:41PM +0800, Cindy Lu wrote:
> > Add logic in mlx5_vdpa_set_attr() to ensure the VIRTIO_NET_F_MAC
> > feature bit is properly set only when the device is not yet in
> > the DRIVER_OK (running) state.
> >
> > This makes the MAC address visible in the output of:
> >
> > vdpa dev config show -jp
> >
> > when the device is created without an initial MAC address.
> >
> So when the random MAC address is assigned it is not currently shown?
> I don't fully understand the motivation.
>
Yes, when the device was created without a MAC address, the
VIRTIO_NET_F_MAC bit wasn’t set during dev_add, so it wasn’t
displayed. At this time the mac address is 0. I think we can remove
the VIRTIO_NET_F_MAC bit check when showing it.
> > Signed-off-by: Cindy Lu <lulu@...hat.com>
>
> > ---
> > drivers/vdpa/mlx5/net/mlx5_vnet.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> > index 82034efb74fc..e38aa3a335fc 100644
> > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
> > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> > @@ -4057,6 +4057,12 @@ static int mlx5_vdpa_set_attr(struct vdpa_mgmt_dev *v_mdev, struct vdpa_device *
> > ndev = to_mlx5_vdpa_ndev(mvdev);
> > mdev = mvdev->mdev;
> > config = &ndev->config;
>
> > + if (!(ndev->mvdev.status & VIRTIO_CONFIG_S_DRIVER_OK)) {
> > + ndev->mvdev.mlx_features |= BIT_ULL(VIRTIO_NET_F_MAC);
> > + } else {
> > + mlx5_vdpa_warn(mvdev, "device running, skip updating MAC\n");
> > + return err;
> The err is EOPNOTSUPP. Is this the right error?
will fix this
>
> > + }
> >
> Why is this block not under the reslock?
>
will fix this
> Thanks,
> Dragos
>
Powered by blists - more mailing lists