From owner-freebsd-xen@FreeBSD.ORG Sat Jan 15 10:12:16 2011 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFC5510656CA for ; Sat, 15 Jan 2011 10:12:16 +0000 (UTC) (envelope-from snabb@epipe.com) Received: from tiktik.epipe.com (tiktik.epipe.com [IPv6:2001:1828:0:3::2]) by mx1.freebsd.org (Postfix) with ESMTP id B34B68FC14 for ; Sat, 15 Jan 2011 10:12:16 +0000 (UTC) Received: from tiktik.epipe.com (tiktik.epipe.com [IPv6:2001:1828:0:3::2]) by tiktik.epipe.com (8.14.4/8.14.4) with ESMTP id p0FACGWf096820 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 15 Jan 2011 10:12:16 GMT (envelope-from snabb@epipe.com) X-DKIM: Sendmail DKIM Filter v2.8.3 tiktik.epipe.com p0FACGWf096820 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=epipe.com; s=default; t=1295086336; x=1295691136; bh=siXK9GUJQpwTLC7qgbZJrXcXs48ciVUqQX5c1oivldM=; h=Date:From:To:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=arP2rlFN2esqO/RP8yDBnd8uqVUiAmS+jGpqU61tY1/7tdY6Rp3QEjd1EW7S9BOSK XXIZUu3Qi9/J3qLVXa8EJwFQQ+nq+YAY/M5x1Gfq56MyaueFQLmSb+t35Cdm2zz43o wGNxqN0Q/GpnOwa699VXetvnI431BrhyOI1oCD20= Date: Sat, 15 Jan 2011 10:12:16 +0000 (UTC) From: Janne Snabb To: freebsd-xen@freebsd.org In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.6 (tiktik.epipe.com [IPv6:2001:1828:0:3::2]); Sat, 15 Jan 2011 10:12:16 +0000 (UTC) Subject: Re: xn0: Error 2 parsing device/vif/0/mac [PATCH] X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jan 2011 10:12:17 -0000 On Sat, 15 Jan 2011, Janne Snabb wrote: > It appears that that the netfront driver fails to get the vif mac > address which leads to panic shortly afterwards. The patch at the bottom of this message solves the problem for me. After that the current 8.2RC2 system works fine on amd64 with XENHVM kernel with Xen 4.0.1 (have not tested other versions). If the "mac" node does not appear in the front-end vif directory (does it ever appear there? in my experience no), we fetch a link to the backend directory for the same vif and try to get the "mac" node from there. I am not sure if this is the proper way to fix this, but it works for me. I can send-pr this if desired. Best Regards, -- Janne Snabb / EPIPE Communications snabb@epipe.com - http://epipe.com/ --- sys/dev/xen/netfront/netfront.c.orig 2010-12-21 17:09:25.000000000 +0000 +++ sys/dev/xen/netfront/netfront.c 2011-01-15 10:01:12.000000000 +0000 @@ -399,16 +399,30 @@ */ static int xen_net_read_mac(device_t dev, uint8_t mac[]) { int error, i; - char *s, *e, *macstr; + char *s, *e, *macstr, *backend; error = xs_read(XST_NIL, xenbus_get_node(dev), "mac", NULL, (void **) &macstr); - if (error) - return (error); + + if (error) { + error = xs_read(XST_NIL, xenbus_get_node(dev), "backend", NULL, + (void **) &backend); + + if (error) + return (error); + + error = xs_read(XST_NIL, backend, "mac", NULL, + (void **) &macstr); + + free(backend, M_XENBUS); + + if (error) + return (error); + } s = macstr; for (i = 0; i < ETHER_ADDR_LEN; i++) { mac[i] = strtoul(s, &e, 16); if (s == e || (e[0] != ':' && e[0] != 0)) {