[PATCH v3 0/2] virtio_net: vdpa: update MAC address when it is generated by virtio-net

Laurent Vivier posted 2 patches 2 years, 7 months ago
drivers/net/virtio_net.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
[PATCH v3 0/2] virtio_net: vdpa: update MAC address when it is generated by virtio-net
Posted by Laurent Vivier 2 years, 7 months ago
When the MAC address is not provided by the vdpa device virtio_net
driver assigns a random one without notifying the device.
The consequence, in the case of mlx5_vdpa, is the internal routing
tables of the device are not updated and this can block the
communication between two namespaces.

To fix this problem, use virtnet_send_command(VIRTIO_NET_CTRL_MAC)
to set the address from virtnet_probe() when the MAC address is
not provided by the device.

v3:
  - update comments
  - fail probe if VIRTIO_NET_CTRL_MAC_ADDR_SET fails
  - move the virtnet_send_command() upper, inside the RTNL lock,
    this simplifies the cleanup in case of error, and a future patch
    from Jason adds an ASSERT_RTNL() in virtnet_send_command()
    ("virtio-net: convert rx mode setting to use workqueue")
  - add a patch to disable F_STANDBY if F_MAC is not set

v2:
  - remove vdpa_sim related fixes
  - check virtio_has_feature(vdev, VIRTIO_NET_F_MAC) rather than
    addr_assign_type

Laurent Vivier (2):
  virtio_net: disable VIRTIO_NET_F_STANDBY if VIRTIO_NET_F_MAC is not
    set
  virtio_net: notify MAC address change on device initialization

 drivers/net/virtio_net.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

-- 
2.39.1
Re: [PATCH v3 0/2] virtio_net: vdpa: update MAC address when it is generated by virtio-net
Posted by patchwork-bot+netdevbpf@kernel.org 2 years, 7 months ago
Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 27 Jan 2023 21:44:58 +0100 you wrote:
> When the MAC address is not provided by the vdpa device virtio_net
> driver assigns a random one without notifying the device.
> The consequence, in the case of mlx5_vdpa, is the internal routing
> tables of the device are not updated and this can block the
> communication between two namespaces.
> 
> To fix this problem, use virtnet_send_command(VIRTIO_NET_CTRL_MAC)
> to set the address from virtnet_probe() when the MAC address is
> not provided by the device.
> 
> [...]

Here is the summary with links:
  - [v3,1/2] virtio_net: disable VIRTIO_NET_F_STANDBY if VIRTIO_NET_F_MAC is not set
    https://git.kernel.org/netdev/net-next/c/7c06458c102e
  - [v3,2/2] virtio_net: notify MAC address change on device initialization
    https://git.kernel.org/netdev/net-next/c/9f62d221a4b0

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html