From owner-freebsd-virtualization@FreeBSD.ORG Sat May 16 18:36:22 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 3AE76EB6; Sat, 16 May 2015 18:36:22 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0225714F4; Sat, 16 May 2015 18:36:21 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t4GIaE9V024511 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 16 May 2015 11:36:14 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t4GIaE4g024510; Sat, 16 May 2015 11:36:14 -0700 (PDT) (envelope-from jmg) Date: Sat, 16 May 2015 11:36:14 -0700 From: John-Mark Gurney To: Allan Jude Cc: virtualization@freebsd.org, "George V. Neville-Neil" Subject: Re: bhyve code question, pci_virtio_net.c Message-ID: <20150516183614.GL37063@funkthat.com> References: <55577814.6040202@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55577814.6040202@freebsd.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sat, 16 May 2015 11:36:15 -0700 (PDT) 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 18:36:22 -0000 Allan Jude wrote this message on Sat, May 16, 2015 at 13:02 -0400: > 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. Correct, VM name makes the most sense here... > 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? Sure... > 2) Should bhyve instead use the FreeBSD assigned OUI for these MAC > addresses? Depends, if NetApp gave us permission to use them here, then we might as well keep using them. gnn would be the persion to talk to about this.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."