Thread (56 messages) 56 messages, 6 authors, 2021-01-20

Re: [PATCH linux-next v3 6/6] vdpa_sim_net: Add support for user supported devices

From: "Michael S. Tsirkin" <mst@redhat.com>
Date: 2021-01-05 12:16:48
Also in: netdev

On Tue, Jan 05, 2021 at 12:02:33PM +0000, Parav Pandit wrote:
quoted
From: Michael S. Tsirkin <mst@redhat.com>
Sent: Tuesday, January 5, 2021 5:19 PM

On Tue, Jan 05, 2021 at 12:32:03PM +0200, Parav Pandit wrote:
quoted
Enable user to create vdpasim net simulate devices.
quoted
quoted
$ vdpa dev add mgmtdev vdpasim_net name foo2

Show the newly created vdpa device by its name:
$ vdpa dev show foo2
foo2: type network mgmtdev vdpasim_net vendor_id 0 max_vqs 2
max_vq_size 256

$ vdpa dev show foo2 -jp
{
    "dev": {
        "foo2": {
            "type": "network",
            "mgmtdev": "vdpasim_net",
            "vendor_id": 0,
            "max_vqs": 2,
            "max_vq_size": 256
        }
    }
}

I'd like an example of how do device specific (e.g. net specific) interfaces tie
in to this.
Not sure I follow your question.
Do you mean how to set mac address or mtu of this vdpa device of type net?
If so, dev add command will be extended shortly in subsequent series to set this net specific attributes.
(I did mention in the next steps in cover letter).
quoted
quoted
+static int __init vdpasim_net_init(void) {
+	int ret;
+
+	if (macaddr) {
+		mac_pton(macaddr, macaddr_buf);
+		if (!is_valid_ether_addr(macaddr_buf))
+			return -EADDRNOTAVAIL;
+	} else {
+		eth_random_addr(macaddr_buf);
 	}
Hmm so all devices start out with the same MAC until changed? And how is
the change effected?
Post this patchset and post we have iproute2 vdpa in the tree, will add the mac address as the input attribute during "vdpa dev add" command.
So that each different vdpa device can have user specified (different) mac address.
For now maybe just avoid VIRTIO_NET_F_MAC then for new devices then?

-- 
MST

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help