qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* VDPA MAC address problem
@ 2025-03-19 16:34 Konstantin Shkolnyy
  2025-03-20  0:58 ` Jason Wang
  0 siblings, 1 reply; 12+ messages in thread
From: Konstantin Shkolnyy @ 2025-03-19 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jason Wang, dtatulea

I’m observing a problem while testing VDPA with Nvidia ConnectX-6 (mlx5) 
on s390.

Upon start, virtio_net_device_realize() tries to set a new MAC address 
by VHOST_VDPA_SET_CONFIG which doesn’t do anything.

Later, the VM gets started and learns about the old address from 
virtio_net_get_config() which returns whatever VHOST_VDPA_GET_CONFIG 
returns, unless it's "6 zero bytes", in which case it instead returns 
the desired new address (and the problem is avoided).

Then QEMU again tries to set the new address from vhost_net_start(), now 
by calling vhost_vdpa_net_load_cmd(...,VIRTIO_NET_CTRL_MAC, 
VIRTIO_NET_CTRL_MAC_ADDR_SET, ...). This time the new address is 
successfully programmed into the NIC, but the VM doesn't know about it.

As the result, the VM now sends packets with a source address on which 
the NIC doesn’t listen.

Upon reading this forum, I see that VHOST_VDPA_SET_CONFIG is 
“deprecated”, and so VIRTIO_NET_CTRL_MAC_ADDR_SET must be the right 
method, but it’s apparently called too late. Or maybe 
virtio_net_get_config() needs to always return the desired new address 
and not the old one from VHOST_VDPA_GET_CONFIG?

I’m looking for an opinion/direction from someone who knows this code.

As it is, the only VDPA scenario that's working for me is:
1) Avoid specifying the MAC address in the "vdpa dev add" command (which 
will create the "6 zero bytes" condition on the first launch).
2) Keep using the same MAC address for every subsequent VM launch on the 
same NIC "virtual function" (so that the old and new addresses are the 
same).


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-03-24  4:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-19 16:34 VDPA MAC address problem Konstantin Shkolnyy
2025-03-20  0:58 ` Jason Wang
2025-03-20  6:54   ` Eugenio Perez Martin
2025-03-20 13:59     ` Konstantin Shkolnyy
2025-03-20  9:14   ` Cindy Lu
2025-03-20 14:18   ` Konstantin Shkolnyy
2025-03-21  1:23     ` Jason Wang
2025-03-20 16:45   ` Konstantin Shkolnyy
2025-03-21  1:22     ` Jason Wang
2025-03-21  4:29       ` Konstantin Shkolnyy
2025-03-21  6:18         ` Cindy Lu
2025-03-24  4:04         ` Jason Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).