From owner-freebsd-virtualization@FreeBSD.ORG Sat May 16 17:01:50 2015 Return-Path: Delivered-To: virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E745A34 for ; Sat, 16 May 2015 17:01:50 +0000 (UTC) Received: from mx1.scaleengine.net (beauharnois2.bhs1.scaleengine.net [142.4.218.15]) by mx1.freebsd.org (Postfix) with ESMTP id 5AE7D1C0A for ; Sat, 16 May 2015 17:01:49 +0000 (UTC) Received: from [192.168.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 9BADAAB87F for ; Sat, 16 May 2015 17:01:43 +0000 (UTC) Message-ID: <55577814.6040202@freebsd.org> Date: Sat, 16 May 2015 13:02:12 -0400 From: Allan Jude User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: virtualization@freebsd.org Subject: bhyve code question, pci_virtio_net.c Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8x2KDc8as1P1b2kThjDTc4b3mG4npEPAT" X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2015 17:01:50 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8x2KDc8as1P1b2kThjDTc4b3mG4npEPAT Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable While looking at the code, I noticed the following comment: /* * The default MAC address is the standard NetApp OUI of 00-a0-98, * followed by an MD5 of the PCI slot/func number and dev name */ if (!mac_provided) { snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, pi->pi_func, vmname); which raised 2 questions: 1) According to the comment, the mac address should be based on the md5 of the DEVICE name, not the VM name. Which is correct? Which is more desirable? I suppose most people's VMs will have similar slot/func numbers for the NIC (especially with certain config engines that always assign devices in a specific order), and so the VM name is more likely to be unique than the name of the tap device. Would it make sense to include more unique information in this hash? like the host's UUID or something, to prevent the chance of more than 1 VM on the same LAN having the same MAC if they have the same VM Name? 2) Should bhyve instead use the FreeBSD assigned OUI for these MAC addresses? --=20 Allan Jude --8x2KDc8as1P1b2kThjDTc4b3mG4npEPAT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJVV3gXAAoJEJrBFpNRJZKfZqMP/j3BNJt1zTF73eNTvYyyiJ69 TeweBfzJbaTjXibOlZlqgo/Fq0cwmyhosUz09FBFOnTdBRZOdXgslKe5RAdaS9dP 6ZaO9g7EPrctw3XhodEys29VRKt4qvwJ6wY2FPyFe5k/YpY7Vt2S2xzuc8t3hc3Q jX0x8r3IIJb/XtMyPzMTZWG4JN5mjsEVnZ5IkGxEMleLKaShWKexpxCdieSBwKUx YXnL9KMMmdrh0ucd2b2Cal/VnQTqVIP+JBd3eoZJIryf1vIwuxKsL8dQ981FRJLN L6n1DAj2lPDeunxdpW+FfjM+VU8KDGSZIMv2RupoHCb0th0bfN2Pg4OMvsPMbgI1 s5E7qCXWfvoqsMXrXQQgfudcSsZqTjRRFeZ+8U3AD8DRVwSbHBOttfz9a5MII4O+ XJFaBiRS5dxwidUaVOhUkOBim/v0A33aAKnWos+TfQnhhJOxfSCSdnAsyxcohY4o sVIj+53MZET61jbSEIwp38E+ybe+evRKNJWPNRhJwuwl54hHZEdr3gWTD5GvIU6i Tv9PTgLXK6uqLJteD0kRcmDTe9q5AuL/pYs771SsX6Op5y8CyKUrs6800sPtNm/m BmrpFQDe9H5Jd9KhwlBR6vdpSfHe9BcI8Kxt12PJTijyFcji6VIg9VnyWJPKgOxS n5DzoiK+K+t1rLO7CXoA =/I7T -----END PGP SIGNATURE----- --8x2KDc8as1P1b2kThjDTc4b3mG4npEPAT--