lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 14 Jan 2021 12:17:53 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     Parav Pandit <parav@...dia.com>,
        "Michael S. Tsirkin" <mst@...hat.com>
Cc:     "virtualization@...ts.linux-foundation.org" 
        <virtualization@...ts.linux-foundation.org>,
        Eli Cohen <elic@...dia.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH linux-next v3 6/6] vdpa_sim_net: Add support for user
 supported devices


On 2021/1/7 上午11:48, Parav Pandit wrote:
>
>> From: Michael S. Tsirkin <mst@...hat.com>
>> Sent: Tuesday, January 5, 2021 6:53 PM
>>
>> On Tue, Jan 05, 2021 at 12:30:15PM +0000, Parav Pandit wrote:
>>>
>>>> From: Michael S. Tsirkin <mst@...hat.com>
>>>> Sent: Tuesday, January 5, 2021 5:45 PM
>>>>
>>>> On Tue, Jan 05, 2021 at 12:02:33PM +0000, Parav Pandit wrote:
>>>>>
>>>>>> From: Michael S. Tsirkin <mst@...hat.com>
>>>>>> Sent: Tuesday, January 5, 2021 5:19 PM
>>>>>>
>>>>>> On Tue, Jan 05, 2021 at 12:32:03PM +0200, Parav Pandit wrote:
>>>>>>> Enable user to create vdpasim net simulate devices.
>>>>>>>
>>>>>>>
>>>>>>> $ 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).
>>>>>
>>>>>>> +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?
>>> That would require book keeping existing net vdpa_sim devices created to
>> avoid setting VIRTIO_NET_F_MAC.
>>> Such book keeping code will be short lived anyway.
>>> Not sure if its worth it.
>>> Until now only one device was created. So not sure two vdpa devices with
>> same mac address will be a real issue.
>>> When we add mac address attribute in add command, at that point also
>> remove the module parameter macaddr.
>>
>> Will that be mandatory? I'm not to happy with a UAPI we intend to break
>> straight away ...
> No. Specifying mac address shouldn't be mandatory. UAPI wont' be broken.


If it's not mandatory. Does it mean the vDPA parent need to use its own 
logic to generate a validate mac? I'm not sure this is what management 
(libvirt want).

Thanks


>

Powered by blists - more mailing lists