From: Dragos Tatulea <dtatulea@nvidia.com>
To: Cindy Lu <lulu@redhat.com>,
mst@redhat.com, jasowang@redhat.com,
virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH v2 1/3] vdpa/mlx5: update mlx_features with driver state check
Date: Fri, 2 Jan 2026 13:09:07 +0100 [thread overview]
Message-ID: <09178761-3ff7-4c6d-bdf4-cbf16531d71e@nvidia.com> (raw)
In-Reply-To: <20251229071614.779621-1-lulu@redhat.com>
Hi Cindy,
Thanks for your patch!
On 29.12.25 08:16, 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.
>
> Signed-off-by: Cindy Lu <lulu@redhat.com>
Having a cover letter with the summary, history and links series would
make the review process easier.
> ---
> drivers/vdpa/mlx5/net/mlx5_vnet.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> index ddaa1366704b..6e42bae7c9a1 100644
> --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
> +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> @@ -4049,7 +4049,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);
> @@ -4057,13 +4057,22 @@ static int mlx5_vdpa_set_attr(struct vdpa_mgmt_dev *v_mdev, struct vdpa_device *
> config = &ndev->config;
>
> down_write(&ndev->reslock);
> - if (add_config->mask & (1 << VDPA_ATTR_DEV_NET_CFG_MACADDR)) {
> +
> + if (add_config->mask & BIT_ULL(VDPA_ATTR_DEV_NET_CFG_MACADDR)) {
> + 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");
> + err = -EBUSY;
> + goto out;
> + }
> pfmdev = pci_get_drvdata(pci_physfn(mdev->pdev));
> err = mlx5_mpfs_add_mac(pfmdev, config->mac);
> if (!err)
> ether_addr_copy(config->mac, add_config->net.mac);
> }
>
> +out:
> up_write(&ndev->reslock);
> return err;
> }
The patch itself makes sense. For it you can add:
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Thanks,
Dragos
next prev parent reply other threads:[~2026-01-02 12:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-29 7:16 [PATCH v2 1/3] vdpa/mlx5: update mlx_features with driver state check Cindy Lu
2025-12-29 7:16 ` [PATCH v2 2/3] vdpa/mlx5: reuse common function for MAC address updates Cindy Lu
2026-01-02 12:09 ` Dragos Tatulea
2026-01-07 12:24 ` Simon Horman
2026-01-19 2:13 ` Cindy Lu
2025-12-29 7:16 ` [PATCH v2 3/3] vdpa/mlx5: update MAC address handling in mlx5_vdpa_set_attr() Cindy Lu
2026-01-02 12:14 ` Dragos Tatulea
2026-01-19 2:13 ` Cindy Lu
2026-01-02 12:09 ` Dragos Tatulea [this message]
2026-01-19 2:12 ` [PATCH v2 1/3] vdpa/mlx5: update mlx_features with driver state check Cindy Lu
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=09178761-3ff7-4c6d-bdf4-cbf16531d71e@nvidia.com \
--to=dtatulea@nvidia.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lulu@redhat.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.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