From: Cindy Lu Date: Mon, 26 Jan 2026 09:45:36 +0000 (+0800) Subject: vdpa/mlx5: update mlx_features with driver state check X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8da308e2444d92d8ddffaee0279c96c3af84b4be;p=thirdparty%2Flinux.git vdpa/mlx5: update mlx_features with driver state check 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 Reviewed-by: Dragos Tatulea Signed-off-by: Michael S. Tsirkin Message-ID: <20260126094848.9601-2-lulu@redhat.com> --- diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index ad0d5fbbbca84..14d3fff7bcb7e 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -4057,7 +4057,7 @@ static int mlx5_vdpa_set_attr(struct vdpa_mgmt_dev *v_mdev, struct vdpa_device * struct mlx5_vdpa_dev *mvdev; struct mlx5_vdpa_net *ndev; struct mlx5_core_dev *mdev; - int err = -EOPNOTSUPP; + int err = 0; mvdev = to_mvdev(dev); ndev = to_mlx5_vdpa_ndev(mvdev);