From owner-svn-src-projects@FreeBSD.ORG Wed Dec 12 19:25:49 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9771697C; Wed, 12 Dec 2012 19:25:49 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7CAED8FC14; Wed, 12 Dec 2012 19:25:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCJPnKh028822; Wed, 12 Dec 2012 19:25:49 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCJPnmC028821; Wed, 12 Dec 2012 19:25:49 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201212121925.qBCJPnmC028821@svn.freebsd.org> From: Peter Grehan Date: Wed, 12 Dec 2012 19:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r244159 - projects/bhyve/usr.sbin/bhyve X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 19:25:49 -0000 Author: grehan Date: Wed Dec 12 19:25:48 2012 New Revision: 244159 URL: http://svnweb.freebsd.org/changeset/base/244159 Log: Create unique MAC addresses for virtio devices that are created with non-zero PCI function numbers. Remove obsolete reference to CFE. Obtained from: NetApp Modified: projects/bhyve/usr.sbin/bhyve/pci_virtio_net.c Modified: projects/bhyve/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- projects/bhyve/usr.sbin/bhyve/pci_virtio_net.c Wed Dec 12 17:49:01 2012 (r244158) +++ projects/bhyve/usr.sbin/bhyve/pci_virtio_net.c Wed Dec 12 19:25:48 2012 (r244159) @@ -548,14 +548,15 @@ pci_vtnet_init(struct vmctx *ctx, struct /* * The MAC address is the standard NetApp OUI of 00-a0-98, - * followed by an MD5 of the vm name. The slot number is - * prepended to this for slots other than 1, so that - * CFE can netboot from the equivalent of slot 1. + * followed by an MD5 of the vm name. The slot/func number is + * prepended to this for slots other than 1:0, so that + * a bootloader can netboot from the equivalent of slot 1. */ - if (pi->pi_slot == 1) { + if (pi->pi_slot == 1 && pi->pi_func == 0) { strncpy(nstr, vmname, sizeof(nstr)); } else { - snprintf(nstr, sizeof(nstr), "%d-%s", pi->pi_slot, vmname); + snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, + pi->pi_func, vmname); } MD5Init(&mdctx);