lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACLfguXcgMgczeRG1w4Af=FnaR8_0MhtMd+bO8E3Vm-y6RTRXA@mail.gmail.com>
Date: Thu, 6 Nov 2025 15:44:39 +0800
From: Cindy Lu <lulu@...hat.com>
To: Jason Wang <jasowang@...hat.com>
Cc: dtatulea@...dia.com, mst@...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

 there

On Thu, Nov 6, 2025 at 12:08 PM Jason Wang <jasowang@...hat.com> wrote:
>
> On Wed, Nov 5, 2025 at 4:02 PM Cindy Lu <lulu@...hat.com> 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.
> >
> > 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;
> > +       }
>
> I don't get the logic here, mgmt risk themselve for such races or what
> would happen if we don't do this?
>
> Thanks
>
sure I can move this to the reslock.
I added the VIRTIO_NET_F_MAC bit because when the device is created
without a MAC address, this bit is missing in dev_add. Since we now
configure the MAC address, we need to also add this bit. I now coding
in QEMU to use this bit to identify if the mac address provided by
host.
there is no vdpa_config_ops for device to change the device_features,
So I add it here
Thanks
cindy
> >
> >         down_write(&ndev->reslock);
> >         if (add_config->mask & (1 << VDPA_ATTR_DEV_NET_CFG_MACADDR)) {
> > --
> > 2.45.0
> >
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ