Re: [PATCH 1/4] virtio_net: notify MAC address change on device initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/24/23 04:31, Jakub Kicinski wrote:
On Sun, 22 Jan 2023 15:47:08 +0200 Eli Cohen wrote:
@@ -3956,6 +3958,18 @@ static int virtnet_probe(struct virtio_device *vdev)
   	pr_debug("virtnet: registered device %s with %d RX and TX vq's\n",
   		 dev->name, max_queue_pairs);
+ /* a random MAC address has been assigned, notify the device */
+	if (dev->addr_assign_type == NET_ADDR_RANDOM &&
Maybe it's better to not count on addr_assign_type and use a local
variable to indicate that virtnet_probe assigned random MAC.

+1, FWIW

v2 sent, but I rely on virtio_has_feature(vdev, VIRTIO_NET_F_MAC) to know if the MAC address is provided by the device or not:

https://lore.kernel.org/lkml/20230123120022.2364889-2-lvivier@xxxxxxxxxx/T/#me9211516e12771001e0346818255c9fb48a2bf4a

Thanks,
Laurent

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux