From owner-freebsd-xen@FreeBSD.ORG Mon Jan 23 11:07:19 2012 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 72CC61065675 for ; Mon, 23 Jan 2012 11:07:19 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 484BB8FC13 for ; Mon, 23 Jan 2012 11:07:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0NB7Jon081163 for ; Mon, 23 Jan 2012 11:07:19 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0NB7IfT081161 for freebsd-xen@FreeBSD.org; Mon, 23 Jan 2012 11:07:18 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 23 Jan 2012 11:07:18 GMT Message-Id: <201201231107.q0NB7IfT081161@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-xen@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-xen@FreeBSD.org 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: Mon, 23 Jan 2012 11:07:19 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/162677 xen [xen] FreeBSD not compatible with "Current Stable Xen" o kern/161318 xen [xen] sysinstall crashes with floating point exception o kern/155468 xen [xen] Xen PV i386 multi-kernel CPU system is not worki o kern/155353 xen [xen] [patch] put "nudging TOD" message under boot_ver o kern/154833 xen [xen]: xen 4.0 - DomU freebsd8.2RC3 i386, XEN kernel. o kern/154473 xen [xen] xen 4.0 - DomU freebsd8.1 i386, XEN kernel. Not o kern/154472 xen [xen] xen 4.0 - DomU freebsd8.1 i386 xen kernel reboot o kern/154428 xen [xen] xn0 network interface and PF - Massive performan o kern/153674 xen [xen] i386/XEN idle thread shows wrong percentages o kern/153672 xen [xen] [panic] i386/XEN panics under heavy fork load o kern/153620 xen [xen] Xen guest system clock drifts in AWS EC2 (FreeBS o kern/153477 xen [xen] XEN pmap code abuses vm page queue lock o kern/153150 xen [xen] xen/ec2: disable checksum offloading on interfac o kern/152228 xen [xen] [panic] Xen/PV panic with machdep.idle_mwait=1 o kern/144629 xen [xen] FreeBSD 8-RELEASE XEN pvm networking doesn't wor o kern/143398 xen [xen] FreeBSD 8-RELEASE XEN pvm networking doesn't wor o kern/143340 xen [xen] FreeBSD 8-RELEASE XEN pvm networking doesn't wor f kern/143069 xen [xen] [panic] Xen Kernel Panic - Memory modified after f kern/135667 xen ufs filesystem corruption on XEN DomU system f kern/135421 xen [xen] FreeBSD Xen PVM DomU network failure - netfronc. f kern/135178 xen [xen] Xen domU outgoing data transfer stall when TSO i p kern/135069 xen [xen] FreeBSD-current/Xen SMP doesn't function at all f i386/124516 xen [xen] FreeBSD-CURRENT Xen Kernel Segfaults when config o kern/118734 xen [xen] FreeBSD 6.3-RC1 and FreeBSD 7.0-BETA 4 fail to b 24 problems total. From owner-freebsd-xen@FreeBSD.ORG Tue Jan 24 18:06:58 2012 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 ABDD8106576B for ; Tue, 24 Jan 2012 18:06:58 +0000 (UTC) (envelope-from bounces+73574-0602-freebsd-xen=freebsd.org@sendgrid.me) Received: from o7.shared.sendgrid.net (o7.shared.sendgrid.net [74.63.235.40]) by mx1.freebsd.org (Postfix) with SMTP id 3892F8FC1A for ; Tue, 24 Jan 2012 18:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h= message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=YdEs+/rrYPjsH4aMcWNYt7kIYbo=; b=Y4P6/AyP0djyBvc4bGqpNPY5uyb3 MxUt/cC7StcskF2hBW29xLtm7Gz+oHRBCX29IfHBbqz2WWE9ozQ9FZR+EhzTdg92 9ndttwhih81nb2E/Dkrh2epDCeSaH18G5TPbaVR84PGHyT4NswS3LuXxU0gWW6ye fc7f0ZGcY/ELPu8= Received: by 10.41.149.104 with SMTP id f04-01.8905.4F1EF32E4 Tue, 24 Jan 2012 18:06:38 +0000 (UTC) Received: from mail.tarsnap.com (unknown [10.41.149.212]) by i04-02 (SG) with ESMTP id 4f1ef62e.3f4f.2a8d293 for ; Tue, 24 Jan 2012 18:19:26 +0000 (UTC) Received: (qmail 58521 invoked from network); 24 Jan 2012 18:04:51 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by mail.tarsnap.com with ESMTP; 24 Jan 2012 18:04:51 -0000 Received: (qmail 30819 invoked from network); 24 Jan 2012 18:04:25 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 24 Jan 2012 18:04:25 -0000 Message-ID: <4F1EF2A8.3050507@freebsd.org> Date: Tue, 24 Jan 2012 10:04:24 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111112 Thunderbird/8.0 MIME-Version: 1.0 To: Adrian Chadd References: <4F14AA60.1090507@freebsd.org> <0E8D94F8-8A77-43CF-AE2A-E761C9EE74E4@sysconfig.org.uk> <4F15F34B.3050801@freebsd.org> <6851B793-C4D4-410E-82DD-58704AE3FB5E@sysconfig.org.uk> <4F160576.5070701@freebsd.org> In-Reply-To: X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Sendgrid-EID: RUbAm5H8PjswBj/QH+sYVehaJogg3iBnZcyVi1bw/IxFb//uZh0HZjOXMhvAkEHJLhr6MH8Gjr9gbY/ifI2rY7a5YSzB21uQIr3lro5g5GOtDQQ5iq2Vl5WY0YtVkoy1hy8uFmDEV7DtTN9KEcQRh0A+VwF04cQYvFwCLSHOE6A= Cc: freebsd-xen@freebsd.org Subject: Re: FreeBSD now available on all EC2 instance types 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: Tue, 24 Jan 2012 18:06:58 -0000 On 01/24/12 09:49, Adrian Chadd wrote: > On 17 January 2012 15:34, Colin Percival > wrote: > * ec2.patch is just tweaking some configuration files, so that doesn't need to > be merged and isn't really a patch anyway. > > There's also some new rc.d scripts which get installed and more configuration > files; I'm not sure if it makes sense to bring those rc.d scripts into FreeBSD > proper since they're only relevant to the EC2 environment. > > .. port? Yeah, that's probably the best solution. It means I'll need to figure out how to build disk images with packages pre-installed, but I'm sure that's possible. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-freebsd-xen@FreeBSD.ORG Tue Jan 24 18:14:45 2012 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 D79951065670 for ; Tue, 24 Jan 2012 18:14:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8AED48FC0C for ; Tue, 24 Jan 2012 18:14:45 +0000 (UTC) Received: by vbbfa15 with SMTP id fa15so1237865vbb.13 for ; Tue, 24 Jan 2012 10:14:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=vMoAlDfn/+LNlOxpEBfMyQqJTSA2pucrdVf9WGk5zEg=; b=d5bMBAr8PHSHG6g2jNY3La8eAfXwvThaKJdfN9sW0+8YfhUzgCTvBqFHMaK5LyP8eS YjoGb59rOr2XhgYy6tCEGuEMR8BDtSWwCsH3J0VpcRR/bE34a/DSQ6DCvbo1xcvHcHm/ K93lduzdQrESyQUAxGn28wTpoohYEXmehI58I= MIME-Version: 1.0 Received: by 10.52.94.73 with SMTP id da9mr6637524vdb.6.1327427361449; Tue, 24 Jan 2012 09:49:21 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.71.241 with HTTP; Tue, 24 Jan 2012 09:49:21 -0800 (PST) In-Reply-To: <4F160576.5070701@freebsd.org> References: <4F14AA60.1090507@freebsd.org> <0E8D94F8-8A77-43CF-AE2A-E761C9EE74E4@sysconfig.org.uk> <4F15F34B.3050801@freebsd.org> <6851B793-C4D4-410E-82DD-58704AE3FB5E@sysconfig.org.uk> <4F160576.5070701@freebsd.org> Date: Tue, 24 Jan 2012 09:49:21 -0800 X-Google-Sender-Auth: 9a7toCKIx1NcwV3HWrykkfQ6wMo Message-ID: From: Adrian Chadd To: Colin Percival Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-xen@freebsd.org Subject: Re: FreeBSD now available on all EC2 instance types 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: Tue, 24 Jan 2012 18:14:45 -0000 On 17 January 2012 15:34, Colin Percival wrote: > * ec2.patch is just tweaking some configuration files, so that doesn't > need to > be merged and isn't really a patch anyway. > > There's also some new rc.d scripts which get installed and more > configuration > files; I'm not sure if it makes sense to bring those rc.d scripts into > FreeBSD > proper since they're only relevant to the EC2 environment. > > .. port? Adrian From owner-freebsd-xen@FreeBSD.ORG Wed Jan 25 06:58:38 2012 Return-Path: Delivered-To: freebsd-xen@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DC57106566B; Wed, 25 Jan 2012 06:58:38 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 206D38FC0C; Wed, 25 Jan 2012 06:58:38 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0P6wcKS091283; Wed, 25 Jan 2012 06:58:38 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0P6wcA3091279; Wed, 25 Jan 2012 06:58:38 GMT (envelope-from linimon) Date: Wed, 25 Jan 2012 06:58:38 GMT Message-Id: <201201250658.q0P6wcA3091279@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-xen@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/164450: [xen] Failed to install FreeeBSD 9.0-RELEASE from CD in a Citrix XenServer VM 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: Wed, 25 Jan 2012 06:58:38 -0000 Old Synopsis: Failed to install FreeeBSD 9.0-RELEASE from CD in a Citrix XenServer VM New Synopsis: [xen] Failed to install FreeeBSD 9.0-RELEASE from CD in a Citrix XenServer VM Responsible-Changed-From-To: freebsd-bugs->freebsd-xen Responsible-Changed-By: linimon Responsible-Changed-When: Wed Jan 25 06:55:28 UTC 2012 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=164450 From owner-freebsd-xen@FreeBSD.ORG Wed Jan 25 06:59:28 2012 Return-Path: Delivered-To: freebsd-xen@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6623D106566B; Wed, 25 Jan 2012 06:59:28 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 36FA88FC12; Wed, 25 Jan 2012 06:59:28 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0P6xSdC091351; Wed, 25 Jan 2012 06:59:28 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0P6xR5c091347; Wed, 25 Jan 2012 06:59:27 GMT (envelope-from linimon) Date: Wed, 25 Jan 2012 06:59:27 GMT Message-Id: <201201250659.q0P6xR5c091347@freefall.freebsd.org> To: rlampe@tqhosting.com, linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-xen@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/164419: [xen] 9.0-RELEASE clock stops in Xen 3.2.1 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: Wed, 25 Jan 2012 06:59:28 -0000 Old Synopsis: 9.0-RELEASE clock stops in Xen 3.2.1 New Synopsis: [xen] 9.0-RELEASE clock stops in Xen 3.2.1 State-Changed-From-To: open->closed State-Changed-By: linimon State-Changed-When: Wed Jan 25 06:58:42 UTC 2012 State-Changed-Why: Apparently the problem has been fixed via a configuration change. Responsible-Changed-From-To: freebsd-bugs->freebsd-xen Responsible-Changed-By: linimon Responsible-Changed-When: Wed Jan 25 06:58:42 UTC 2012 Responsible-Changed-Why: http://www.freebsd.org/cgi/query-pr.cgi?pr=164419 From owner-freebsd-xen@FreeBSD.ORG Wed Jan 25 10:09:37 2012 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 4A4541065672 for ; Wed, 25 Jan 2012 10:09:37 +0000 (UTC) (envelope-from krichy@tvnetwork.hu) Received: from smtp-a.tvnetwork.hu (smtp-a.tvnetwork.hu [109.61.0.51]) by mx1.freebsd.org (Postfix) with SMTP id 710658FC19 for ; Wed, 25 Jan 2012 10:09:35 +0000 (UTC) Received: (qmail 20425 invoked by uid 1001); 25 Jan 2012 11:09:34 +0100 Received: from 109.61.101.194 by smtp-a.tvnetwork.hu (envelope-from , uid 64011) with qmail-scanner-1.25st (clamdscan: 0.88.1/1396. spamassassin: 3.0.3. perlscan: 1.25st. Clear:RC:1(109.61.101.194):SA:0(-1.0/5.0):. Processed in 5.838149 secs); 25 Jan 2012 10:09:34 -0000 X-Spam-Status: No, hits=-1.0 required=5.0 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp-a.tvnetwork.hu X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.3.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP X-Envelope-From: krichy@tvnetwork.hu Received: from unknown (HELO krichy.tvnetwork.hu) (109.61.101.194) by smtp-a.tvnetwork.hu with SMTP; 25 Jan 2012 11:09:27 +0100 Received: by krichy.tvnetwork.hu (Postfix, from userid 1000) id 4F11866CF; Wed, 25 Jan 2012 11:09:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by krichy.tvnetwork.hu (Postfix) with ESMTP id 45DD166CD for ; Wed, 25 Jan 2012 11:09:27 +0100 (CET) Date: Wed, 25 Jan 2012 11:09:27 +0100 (CET) From: Richard Kojedzinszky To: freebsd-xen@FreeBSD.org Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Cc: Subject: amd64 xen hvm shutdown 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: Wed, 25 Jan 2012 10:09:37 -0000 Dear list, I am looking for a solution to be able to shutdown my freebsd 9.0 amd64 xen hvm domain from outside, from the host. Precisely, when the host is halted, it issues an # xm shutdown domain --halt --wait to the domain, and the domain does not poweroff. It behaves as if I issue a halt inside of it, and not a poweroff. Is there a way to have it power down itself? Thanks in advance, Kojedzinszky Richard Euronet Magyarorszag Informatikai Zrt. From owner-freebsd-xen@FreeBSD.ORG Wed Jan 25 10:19:03 2012 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 23EFF106566B for ; Wed, 25 Jan 2012 10:19:03 +0000 (UTC) (envelope-from bounces+73574-0602-freebsd-xen=freebsd.org@sendgrid.me) Received: from o7.shared.sendgrid.net (o7.shared.sendgrid.net [74.63.235.40]) by mx1.freebsd.org (Postfix) with SMTP id C05D98FC0C for ; Wed, 25 Jan 2012 10:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h= message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=aL+2CyZu83MPuVNCPIEUMVRn+1o=; b=kG6ZvFnAhABflvyy8VkhtB+5hYch vRlo3a5FXN34QKJIr4aj7M7fW8b/0baf3MPKUxw6SR9Ib/CkhN8YS2MF8LNwubRy VhIh9MYIS/OqOPI02FUyT+qtXeUn1YTcVaYKsPF32/E7WAWpP/QWNO97dfJQKGxS fa5vrq4UkHpj7Mo= Received: by 10.41.149.107 with SMTP id f04-04.27864.4F1FD6D42 Wed, 25 Jan 2012 10:17:56 +0000 (UTC) Received: from mail.tarsnap.com (unknown [10.41.149.212]) by i04-03 (SG) with ESMTP id 4f1fd6cd.3a98.27098aa for ; Wed, 25 Jan 2012 10:17:49 +0000 (UTC) Received: (qmail 66371 invoked from network); 25 Jan 2012 10:16:54 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by mail.tarsnap.com with ESMTP; 25 Jan 2012 10:16:54 -0000 Received: (qmail 33333 invoked from network); 25 Jan 2012 10:16:27 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 25 Jan 2012 10:16:27 -0000 Message-ID: <4F1FD67B.3080305@freebsd.org> Date: Wed, 25 Jan 2012 02:16:27 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111112 Thunderbird/8.0 MIME-Version: 1.0 To: Richard Kojedzinszky References: In-Reply-To: X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Sendgrid-EID: RUbAm5H8PjswBj/QH+sYVehaJogg3iBnZcyVi1bw/Ix2/3GGryArUCwicbqugxW37k5cPI8vkcf1o1pNHXVLzDupgg2ZbpUXe2m1u0pgNAhUdRkquw+pN8QIBfOFq1cSpfI/OpSlmWKddH9e15XPIWWi/PfYK/0w0c+IGRiUwds= Cc: freebsd-xen@FreeBSD.org Subject: Re: amd64 xen hvm shutdown 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: Wed, 25 Jan 2012 10:19:03 -0000 On 01/25/12 02:09, Richard Kojedzinszky wrote: > I am looking for a solution to be able to shutdown my freebsd 9.0 amd64 xen hvm > domain from outside, from the host. Precisely, when the host is halted, it > issues an > # xm shutdown domain --halt --wait > > to the domain, and the domain does not poweroff. It behaves as if I issue a halt > inside of it, and not a poweroff. Is there a way to have it power down itself? That sounds like a Xen configuration issue ("poweroff behaviour"?) rather than a FreeBSD issue to me. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-freebsd-xen@FreeBSD.ORG Wed Jan 25 10:40:57 2012 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 F183A1065674 for ; Wed, 25 Jan 2012 10:40:56 +0000 (UTC) (envelope-from krichy@tvnetwork.hu) Received: from smtp-b.tvnetwork.hu (smtp-b.tvnetwork.hu [109.61.0.52]) by mx1.freebsd.org (Postfix) with SMTP id 612268FC16 for ; Wed, 25 Jan 2012 10:40:55 +0000 (UTC) Received: (qmail 19817 invoked by uid 1001); 25 Jan 2012 11:40:54 +0100 Received: from 109.61.101.194 by smtp-b.tvnetwork.hu (envelope-from , uid 64011) with qmail-scanner-1.25st (clamdscan: 0.88.1/1396. spamassassin: 3.0.3. perlscan: 1.25st. Clear:RC:1(109.61.101.194):SA:0(-2.9/5.0):. Processed in 6.320726 secs); 25 Jan 2012 10:40:54 -0000 X-Spam-Status: No, hits=-2.9 required=5.0 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp-b.tvnetwork.hu X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] X-Envelope-From: krichy@tvnetwork.hu Received: from unknown (HELO krichy.tvnetwork.hu) (109.61.101.194) by smtp-b.tvnetwork.hu with SMTP; 25 Jan 2012 11:40:47 +0100 Received: by krichy.tvnetwork.hu (Postfix, from userid 1000) id CB82F66CF; Wed, 25 Jan 2012 11:40:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by krichy.tvnetwork.hu (Postfix) with ESMTP id C404866CD; Wed, 25 Jan 2012 11:40:47 +0100 (CET) Date: Wed, 25 Jan 2012 11:40:47 +0100 (CET) From: Richard Kojedzinszky To: Colin Percival In-Reply-To: <4F1FD67B.3080305@freebsd.org> Message-ID: References: <4F1FD67B.3080305@freebsd.org> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-xen@FreeBSD.org Subject: Re: amd64 xen hvm shutdown 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: Wed, 25 Jan 2012 10:40:57 -0000 Dear Colin, My config for this domain is here: kernel = "/usr/lib/xen-4.0/boot/hvmloader" builder = "hvm" name = 'db.real-charts.com' memory = 512 vcpus = 1 cpus = '1-3' disk = [ 'phy:/dev/sys/db.real-charts.com-root,xvda,w', 'phy:/dev/sys/db.real-charts.com-swap,xvdb,w', 'phy:/dev/sys/db.real-charts.com-tmp,xvdc,w', 'phy:/dev/sys/db.real-charts.com-var,xvdd,w', 'phy:/dev/sys/db.real-charts.com-usr,xvde,w' ] vif = [ 'mac=00:16:3e:00:04:01,bridge=eth0' ] vnc = 1 boot = "c" stdvga = 1 localtime = 0 hpet = 1 acpi = 1 apic = 1 pae = 1 usb = 0 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" But as I read the documentation, on_poweroff means what to do when the domain powers itself off. But for me it seems, that xen sends a halt to the freebsd domain, exactly as if I issue a # halt In that case, the domain does halt, and shows that the system is halted, and press any key to reboot. Unfortunately I dont have a freebsd on real hardware, so I dont know if issue a halt on that does it powers itself off. But when inside the domain, and I issue poweroff, it works as expected, I guess it sends an acpi poweroff to xen, and then tha virtual machine gets stopped. Regards, Kojedzinszky Richard Euronet Magyarorszag Informatikai Zrt. On Wed, 25 Jan 2012, Colin Percival wrote: > Date: Wed, 25 Jan 2012 02:16:27 -0800 > From: Colin Percival > To: Richard Kojedzinszky > Cc: freebsd-xen@FreeBSD.org > Subject: Re: amd64 xen hvm shutdown > > On 01/25/12 02:09, Richard Kojedzinszky wrote: >> I am looking for a solution to be able to shutdown my freebsd 9.0 amd64 xen hvm >> domain from outside, from the host. Precisely, when the host is halted, it >> issues an >> # xm shutdown domain --halt --wait >> >> to the domain, and the domain does not poweroff. It behaves as if I issue a halt >> inside of it, and not a poweroff. Is there a way to have it power down itself? > > That sounds like a Xen configuration issue ("poweroff behaviour"?) rather than a > FreeBSD issue to me. > > -- > Colin Percival > Security Officer, FreeBSD | freebsd.org | The power to serve > Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid > From owner-freebsd-xen@FreeBSD.ORG Wed Jan 25 17:27:09 2012 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 F0F731065672 for ; Wed, 25 Jan 2012 17:27:09 +0000 (UTC) (envelope-from laurent.cligny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 781418FC0C for ; Wed, 25 Jan 2012 17:27:09 +0000 (UTC) Received: by bkbc12 with SMTP id c12so6188773bkb.13 for ; Wed, 25 Jan 2012 09:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=P0uk5iiRoJLVl5Hl832a8f0rwhrYAJXcDLuYMAqGUec=; b=ULVNl/Ce4MB6xWA08Uzt3lru4BbtiIN9S5dt5Q6Bs1cg8IuzCQkefd8QN54cr1DqB4 jU0POtsjZ1WqR/jO1/v/ImHNNcz8zT24wkKfLOYeZYAhQDDJmPCQt596ZDfVssOMMTxY eIOs6EYFQdaXEQ4oURXzX2WGQDF8qi+MEuoE4= Received: by 10.204.156.133 with SMTP id x5mr7296029bkw.86.1327510928001; Wed, 25 Jan 2012 09:02:08 -0800 (PST) Received: from [192.168.1.10] (ltl56-h01-31-32-191-103.dsl.sta.abo.bbox.fr. [31.32.191.103]) by mx.google.com with ESMTPS id d2sm2274572bky.11.2012.01.25.09.02.06 (version=SSLv3 cipher=OTHER); Wed, 25 Jan 2012 09:02:06 -0800 (PST) Message-ID: <4F20358C.6070805@gmail.com> Date: Wed, 25 Jan 2012 18:02:04 +0100 From: "laurent.cligny@gmail.com" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Iceowl/1.0b2 Icedove/3.1.16 MIME-Version: 1.0 To: Ivan Ivanyuk References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-xen@freebsd.org Subject: Re: [FreeBSD 8.2 amd64 XENHVM] Incorrect behavior of xen networking drivers: unexpected tcp reassembling 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: Wed, 25 Jan 2012 17:27:10 -0000 Le 12/01/2012 19:42, Ivan Ivanyuk a écrit : > On 12 January 2012 00:35, Ivan Ivanyuk wrote: >> Hi All, Hi Ivan, >> I can get about 500Mb/s from virtual machine to external host, but >> only 200Kb/s from any internal PC to the same external host through >> virtual machine router. >> >> Closest description I found in archives is this: >> http://lists.freebsd.org/pipermail/freebsd-xen/2011-May/000902.html. >> I'm the one who had that problem and tried to explain it. I must say that you explained it much better, so hopefully this issue will be understandable to everyone ;) > Somewhat successful follow-up: > > There is still some occurrences of reordered packets but original > issue was resolved. > > Turned out this mechanism can be turned off by "ifconfig -lro" in > FreeBSD itself. I'm not sure if turning LRO on virtual driver by > default is good idea at all, but obviously LRO implementation for xn > device doesn't consider DF flag implication on resulting packets. > > I'm not familiar with other LRO algorithms which used in physical > NIC's. Can someone comment if such problem is normal for it? > > And what is your opinion on using tso, rxcsum and txcsum offloads in > virtual envirnoment? > Glad to know you almost addressed the issue with custom settings. I think I would try again any time soon, to see if I can work with it in production environment. Because of this issue I had to run a Linux/debian vhost in place of FreeBSD, and I would know if anyone had bandwidth problems with this kind of setup under the brand new FreeBSD 9.0 ? I would like to be able to use PF and ALTQ at my gateway for a long time, and this issue was the only show-stopper I felt into. Regards, Laurent Cligny From owner-freebsd-xen@FreeBSD.ORG Thu Jan 26 07:57:22 2012 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 722F51065675 for ; Thu, 26 Jan 2012 07:57:22 +0000 (UTC) (envelope-from krichy@tvnetwork.hu) Received: from smtp-a.tvnetwork.hu (smtp-a.tvnetwork.hu [109.61.0.51]) by mx1.freebsd.org (Postfix) with SMTP id CFB1E8FC16 for ; Thu, 26 Jan 2012 07:57:21 +0000 (UTC) Received: (qmail 4666 invoked by uid 1001); 26 Jan 2012 08:57:19 +0100 Received: from 109.61.101.194 by smtp-a.tvnetwork.hu (envelope-from , uid 64011) with qmail-scanner-1.25st (clamdscan: 0.88.1/1396. spamassassin: 3.0.3. perlscan: 1.25st. Clear:RC:1(109.61.101.194):SA:0(-1.0/5.0):. Processed in 5.484718 secs); 26 Jan 2012 07:57:19 -0000 X-Spam-Status: No, hits=-1.0 required=5.0 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp-a.tvnetwork.hu X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.3.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP X-Envelope-From: krichy@tvnetwork.hu Received: from unknown (HELO krichy.tvnetwork.hu) (109.61.101.194) by smtp-a.tvnetwork.hu with SMTP; 26 Jan 2012 08:57:13 +0100 Received: by krichy.tvnetwork.hu (Postfix, from userid 1000) id 96CF566D5; Thu, 26 Jan 2012 08:57:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by krichy.tvnetwork.hu (Postfix) with ESMTP id 8F24766C8; Thu, 26 Jan 2012 08:57:13 +0100 (CET) Date: Thu, 26 Jan 2012 08:57:13 +0100 (CET) From: Richard Kojedzinszky To: Colin Percival In-Reply-To: Message-ID: References: <4F1FD67B.3080305@freebsd.org> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-xen@FreeBSD.org Subject: Re: amd64 xen hvm shutdown 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: Thu, 26 Jan 2012 07:57:22 -0000 Dear Colin, I am not familiar with the method, but what happens exactly when I issue xm shutdown on the host ? How does the inner guest handle it? Does it simply send a signal to init, or does to host emulate the press of the power button? Thanks in advance, Kojedzinszky Richard Euronet Magyarorszag Informatikai Zrt. On Wed, 25 Jan 2012, Richard Kojedzinszky wrote: > Date: Wed, 25 Jan 2012 11:40:47 +0100 (CET) > From: Richard Kojedzinszky > To: Colin Percival > Cc: freebsd-xen@FreeBSD.org > Subject: Re: amd64 xen hvm shutdown > > Dear Colin, > > My config for this domain is here: > > kernel = "/usr/lib/xen-4.0/boot/hvmloader" > builder = "hvm" > > name = 'db.real-charts.com' > memory = 512 > vcpus = 1 > cpus = '1-3' > disk = [ > 'phy:/dev/sys/db.real-charts.com-root,xvda,w', > 'phy:/dev/sys/db.real-charts.com-swap,xvdb,w', > 'phy:/dev/sys/db.real-charts.com-tmp,xvdc,w', > 'phy:/dev/sys/db.real-charts.com-var,xvdd,w', > 'phy:/dev/sys/db.real-charts.com-usr,xvde,w' > ] > vif = [ 'mac=00:16:3e:00:04:01,bridge=eth0' ] > > vnc = 1 > boot = "c" > stdvga = 1 > localtime = 0 > > hpet = 1 > acpi = 1 > apic = 1 > pae = 1 > usb = 0 > > on_poweroff = "destroy" > on_reboot = "restart" > on_crash = "restart" > > But as I read the documentation, on_poweroff means what to do when the domain > powers itself off. But for me it seems, that xen sends a halt to the freebsd > domain, exactly as if I issue a > # halt > In that case, the domain does halt, and shows that the system is halted, and > press any key to reboot. Unfortunately I dont have a freebsd on real > hardware, so I dont know if issue a halt on that does it powers itself off. > > But when inside the domain, and I issue poweroff, it works as expected, I > guess it sends an acpi poweroff to xen, and then tha virtual machine gets > stopped. > > Regards, > > Kojedzinszky Richard > Euronet Magyarorszag Informatikai Zrt. > > On Wed, 25 Jan 2012, Colin Percival wrote: > >> Date: Wed, 25 Jan 2012 02:16:27 -0800 >> From: Colin Percival >> To: Richard Kojedzinszky >> Cc: freebsd-xen@FreeBSD.org >> Subject: Re: amd64 xen hvm shutdown >> >> On 01/25/12 02:09, Richard Kojedzinszky wrote: >>> I am looking for a solution to be able to shutdown my freebsd 9.0 amd64 >>> xen hvm >>> domain from outside, from the host. Precisely, when the host is halted, it >>> issues an >>> # xm shutdown domain --halt --wait >>> >>> to the domain, and the domain does not poweroff. It behaves as if I issue >>> a halt >>> inside of it, and not a poweroff. Is there a way to have it power down >>> itself? >> >> That sounds like a Xen configuration issue ("poweroff behaviour"?) rather >> than a >> FreeBSD issue to me. >> >> -- >> Colin Percival >> Security Officer, FreeBSD | freebsd.org | The power to serve >> Founder / author, Tarsnap | tarsnap.com | Online backups for the truly >> paranoid >> > _______________________________________________ > freebsd-xen@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-xen > To unsubscribe, send any mail to "freebsd-xen-unsubscribe@freebsd.org" > From owner-freebsd-xen@FreeBSD.ORG Thu Jan 26 17:16:24 2012 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 B261B106564A for ; Thu, 26 Jan 2012 17:16:24 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 061AF8FC0C for ; Thu, 26 Jan 2012 17:16:23 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q0QGlhjN059460; Thu, 26 Jan 2012 09:47:43 -0700 (MST) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q0QGlhec059459; Thu, 26 Jan 2012 09:47:43 -0700 (MST) (envelope-from ken) Date: Thu, 26 Jan 2012 09:47:43 -0700 From: "Kenneth D. Merry" To: freebsd-xen@freebsd.org Message-ID: <20120126164743.GA58431@nargothrond.kdm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2i Cc: alans@spectralogic.com, johns@spectralogic.com Subject: new Xen netback driver in head 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: Thu, 26 Jan 2012 17:16:24 -0000 Hi folks, I just committed a new netback driver to head. Some details are below. If you have more questions, ask Alan and John (CCed). Thanks, Ken ----- Forwarded message from "Kenneth D. Merry" ----- From: "Kenneth D. Merry" Date: Thu, 26 Jan 2012 16:35:09 +0000 (UTC) To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: svn commit: r230587 - in head: share/man/man4 sys/dev/xen/blkback sys/dev/xen/netback sys/kern sys/xen/interface/io Author: ken Date: Thu Jan 26 16:35:09 2012 New Revision: 230587 URL: http://svn.freebsd.org/changeset/base/230587 Log: Xen netback driver rewrite. share/man/man4/Makefile, share/man/man4/xnb.4, sys/dev/xen/netback/netback.c, sys/dev/xen/netback/netback_unit_tests.c: Rewrote the netback driver for xen to attach properly via newbus and work properly in both HVM and PVM mode (only HVM is tested). Works with the in-tree FreeBSD netfront driver or the Windows netfront driver from SuSE. Has not been extensively tested with a Linux netfront driver. Does not implement LRO, TSO, or polling. Includes unit tests that may be run through sysctl after compiling with XNB_DEBUG defined. sys/dev/xen/blkback/blkback.c, sys/xen/interface/io/netif.h: Comment elaboration. sys/kern/uipc_mbuf.c: Fix page fault in kernel mode when calling m_print() on a null mbuf. Since m_print() is only used for debugging, there are no performance concerns for extra error checking code. sys/kern/subr_scanf.c: Add the "hh" and "ll" width specifiers from C99 to scanf(). A few callers were already using "ll" even though scanf() was handling it as "l". Submitted by: Alan Somers Submitted by: John Suykerbuyk Sponsored by: Spectra Logic MFC after: 1 week Reviewed by: ken Added: head/share/man/man4/xnb.4 (contents, props changed) head/sys/dev/xen/netback/netback_unit_tests.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/dev/xen/blkback/blkback.c head/sys/dev/xen/netback/netback.c head/sys/kern/subr_scanf.c head/sys/kern/uipc_mbuf.c head/sys/xen/interface/io/netif.h Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Jan 26 15:23:45 2012 (r230586) +++ head/share/man/man4/Makefile Thu Jan 26 16:35:09 2012 (r230587) @@ -531,6 +531,7 @@ MAN= aac.4 \ ${_xen.4} \ xhci.4 \ xl.4 \ + ${_xnb.4} \ xpt.4 \ zero.4 \ zyd.4 @@ -731,6 +732,7 @@ _urtw.4= urtw.4 _viawd.4= viawd.4 _wpi.4= wpi.4 _xen.4= xen.4 +_xnb.4= xnb.4 MLINKS+=lindev.4 full.4 .endif Added: head/share/man/man4/xnb.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/xnb.4 Thu Jan 26 16:35:09 2012 (r230587) @@ -0,0 +1,134 @@ +.\" Copyright (c) 2012 Spectra Logic Corporation +.\" All rights reserved. +.\" +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\" substantially similar to the "NO WARRANTY" disclaimer below +.\" ("Disclaimer") and any redistribution must be conditioned upon +.\" including a substantially similar Disclaimer requirement for further +.\" binary redistribution. +.\" +.\" NO WARRANTY +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGES. +.\" +.\" Authors: Alan Somers (Spectra Logic Corporation) +.\" +.\" $FreeBSD$ +.\" + +.Dd January 6, 2012 +.Dt XNB 4 +.Os +.Sh NAME +.Nm xnb +.Nd "Xen Paravirtualized Backend Ethernet Driver" +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "options XENHVM" +.Cd "device xenpci" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides the back half of a paravirtualized +.Xr xen 4 +network connection. The netback and netfront drivers appear to their +respective operating systems as Ethernet devices linked by a crossover cable. +Typically, +.Nm +will run on Domain 0 and the netfront driver will run on a guest domain. +However, it is also possible to run +.Nm +on a guest domain. It may be bridged or routed to provide the netfront's +domain access to other guest domains or to a physical network. +.Pp +In most respects, the +.Nm +device appears to the OS as an other Ethernet device. It can be configured at +runtime entirely with +.Xr ifconfig 8 +\&. In particular, it supports MAC changing, arbitrary MTU sizes, checksum +offload for IP, UDP, and TCP for both receive and transmit, and TSO. However, +see +.Sx CAVEATS +before enabling txcsum, rxcsum, or tso. +.Sh SYSCTL VARIABLES +The following read-only variables are available via +.Xr sysctl 8 : +.Bl -tag -width indent +.It Va dev.xnb.%d.dump_rings +Displays information about the ring buffers used to pass requests between the +netfront and netback. Mostly useful for debugging, but can also be used to +get traffic statistics. +.It Va dev.xnb.%d.unit_test_results +Runs a builtin suite of unit tests and displays the results. Does not affect +the operation of the driver in any way. Note that the test suite simulates +error conditions; this will result in error messages being printed to the +system system log. +.Sh CAVEATS +Packets sent through Xennet pass over shared memory, so the protocol includes +no form of link-layer checksum or CRC. Furthermore, Xennet drivers always +report to their hosts that they support receive and transmit checksum +offloading. They "offload" the checksum calculation by simply skipping it. +That works fine for packets that are exchanged between two domains on the same +machine. However, when a Xennet interface is bridged to a physical interface, +a correct checksum must be attached to any packets bound for that physical +interface. Currently, FreeBSD lacks any mechanism for an ethernet device to +inform the OS that newly received packets are valid even though their checksums +are not. So if the netfront driver is configured to offload checksum +calculations, it will pass non-checksumed packets to +.Nm +, which must then calculate the checksum in software before passing the packet +to the OS. +.Pp +For this reason, it is recommended that if +.Nm +is bridged to a physcal interface, then transmit checksum offloading should be +disabled on the netfront. The Xennet protocol does not have any mechanism for +the netback to request the netfront to do this; the operator must do it +manually. +.Sh SEE ALSO +.Xr arp 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr ifconfig 8 , +.Xr xen 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 +. +.Sh AUTHORS +The +.Nm +driver was written by +.An Alan Somers +.Aq alans@spectralogic.com +and +.An John Suykerbuyk +.Aq johns@spectralogic.com +.Sh BUGS +The +.Nm +driver does not properly checksum UDP datagrams that span more than one +Ethernet frame. Nor does it correctly checksum IPv6 packets. To workaround +that bug, disable transmit checksum offloading on the netfront driver. Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Thu Jan 26 15:23:45 2012 (r230586) +++ head/sys/dev/xen/blkback/blkback.c Thu Jan 26 16:35:09 2012 (r230587) @@ -3434,6 +3434,10 @@ xbb_shutdown(struct xbb_softc *xbb) DPRINTF("\n"); + /* + * Before unlocking mutex, set this flag to prevent other threads from + * getting into this function + */ xbb->flags |= XBBF_IN_SHUTDOWN; mtx_unlock(&xbb->lock); Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Thu Jan 26 15:23:45 2012 (r230586) +++ head/sys/dev/xen/netback/netback.c Thu Jan 26 16:35:09 2012 (r230587) @@ -1,1595 +1,2535 @@ -/* - * Copyright (c) 2006, Cisco Systems, Inc. +/*- + * Copyright (c) 2009-2011 Spectra Logic Corporation * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Cisco Systems, Inc. nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * Authors: Justin T. Gibbs (Spectra Logic Corporation) + * Alan Somers (Spectra Logic Corporation) + * John Suykerbuyk (Spectra Logic Corporation) */ #include __FBSDID("$FreeBSD$"); + +/** + * \file netback.c + * + * \brief Device driver supporting the vending of network access + * from this FreeBSD domain to other domains. + */ +#include "opt_inet.h" +#include "opt_global.h" + #include "opt_sctp.h" #include -#include -#include -#include -#include #include -#include -#include -#include -#include #include +#include +#include +#include +#include #include #include #include -#include #include -#include +#include +#include +#include -#include #include -#include #include +#include +#if __FreeBSD_version >= 700000 #include -#include -#ifdef SCTP -#include -#include #endif +#include +#include +#include -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include + +#include +#include +#include +#include + +/*--------------------------- Compile-time Tunables --------------------------*/ +/*---------------------------------- Macros ----------------------------------*/ +/** + * Custom malloc type for all driver allocations. + */ +static MALLOC_DEFINE(M_XENNETBACK, "xnb", "Xen Net Back Driver Data"); -#ifdef XEN_NETBACK_DEBUG -#define DPRINTF(fmt, args...) \ - printf("netback (%s:%d): " fmt, __FUNCTION__, __LINE__, ##args) +#define XNB_SG 1 /* netback driver supports feature-sg */ +#define XNB_GSO_TCPV4 1 /* netback driver supports feature-gso-tcpv4 */ +#define XNB_RX_COPY 1 /* netback driver supports feature-rx-copy */ +#define XNB_RX_FLIP 0 /* netback driver does not support feature-rx-flip */ + +#undef XNB_DEBUG +#define XNB_DEBUG /* hardcode on during development */ + +#ifdef XNB_DEBUG +#define DPRINTF(fmt, args...) \ + printf("xnb(%s:%d): " fmt, __FUNCTION__, __LINE__, ##args) #else -#define DPRINTF(fmt, args...) ((void)0) +#define DPRINTF(fmt, args...) do {} while (0) #endif -#ifdef XEN_NETBACK_DEBUG_LOTS -#define DDPRINTF(fmt, args...) \ - printf("netback (%s:%d): " fmt, __FUNCTION__, __LINE__, ##args) -#define DPRINTF_MBUF(_m) print_mbuf(_m, 0) -#define DPRINTF_MBUF_LEN(_m, _len) print_mbuf(_m, _len) -#else -#define DDPRINTF(fmt, args...) ((void)0) -#define DPRINTF_MBUF(_m) ((void)0) -#define DPRINTF_MBUF_LEN(_m, _len) ((void)0) +/* Default length for stack-allocated grant tables */ +#define GNTTAB_LEN (64) + +/* Features supported by all backends. TSO and LRO can be negotiated */ +#define XNB_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) + +#define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGE_SIZE) +#define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGE_SIZE) + +/** + * Two argument version of the standard macro. Second argument is a tentative + * value of req_cons + */ +#define RING_HAS_UNCONSUMED_REQUESTS_2(_r, cons) ({ \ + unsigned int req = (_r)->sring->req_prod - cons; \ + unsigned int rsp = RING_SIZE(_r) - \ + (cons - (_r)->rsp_prod_pvt); \ + req < rsp ? req : rsp; \ +}) + +#define virt_to_mfn(x) (vtomach(x) >> PAGE_SHIFT) +#define virt_to_offset(x) ((x) & (PAGE_SIZE - 1)) + +/** + * Predefined array type of grant table copy descriptors. Used to pass around + * statically allocated memory structures. + */ +typedef struct gnttab_copy gnttab_copy_table[GNTTAB_LEN]; + +/*--------------------------- Forward Declarations ---------------------------*/ +struct xnb_softc; +struct xnb_pkt; + +static void xnb_attach_failed(struct xnb_softc *xnb, + int err, const char *fmt, ...) + __printflike(3,4); +static int xnb_shutdown(struct xnb_softc *xnb); +static int create_netdev(device_t dev); +static int xnb_detach(device_t dev); +static int xen_net_read_mac(device_t dev, uint8_t mac[]); +static int xnb_ifmedia_upd(struct ifnet *ifp); +static void xnb_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); +static void xnb_intr(void *arg); +static int xnb_send(netif_rx_back_ring_t *rxb, domid_t otherend, + const struct mbuf *mbufc, gnttab_copy_table gnttab); +static int xnb_recv(netif_tx_back_ring_t *txb, domid_t otherend, + struct mbuf **mbufc, struct ifnet *ifnet, + gnttab_copy_table gnttab); +static int xnb_ring2pkt(struct xnb_pkt *pkt, + const netif_tx_back_ring_t *tx_ring, + RING_IDX start); +static void xnb_txpkt2rsp(const struct xnb_pkt *pkt, + netif_tx_back_ring_t *ring, int error); +static struct mbuf *xnb_pkt2mbufc(const struct xnb_pkt *pkt, struct ifnet *ifp); +static int xnb_txpkt2gnttab(const struct xnb_pkt *pkt, + const struct mbuf *mbufc, + gnttab_copy_table gnttab, + const netif_tx_back_ring_t *txb, + domid_t otherend_id); +static void xnb_update_mbufc(struct mbuf *mbufc, + const gnttab_copy_table gnttab, int n_entries); +static int xnb_mbufc2pkt(const struct mbuf *mbufc, + struct xnb_pkt *pkt, + RING_IDX start, int space); +static int xnb_rxpkt2gnttab(const struct xnb_pkt *pkt, + const struct mbuf *mbufc, + gnttab_copy_table gnttab, + const netif_rx_back_ring_t *rxb, + domid_t otherend_id); +static int xnb_rxpkt2rsp(const struct xnb_pkt *pkt, + const gnttab_copy_table gnttab, int n_entries, + netif_rx_back_ring_t *ring); +static void xnb_add_mbuf_cksum(struct mbuf *mbufc); +static void xnb_stop(struct xnb_softc*); +static int xnb_ioctl(struct ifnet*, u_long, caddr_t); +static void xnb_start_locked(struct ifnet*); +static void xnb_start(struct ifnet*); +static void xnb_ifinit_locked(struct xnb_softc*); +static void xnb_ifinit(void*); +#ifdef XNB_DEBUG +static int xnb_unit_test_main(SYSCTL_HANDLER_ARGS); +static int xnb_dump_rings(SYSCTL_HANDLER_ARGS); #endif +/*------------------------------ Data Structures -----------------------------*/ + + +/** + * Representation of a xennet packet. Simplified version of a packet as + * stored in the Xen tx ring. Applicable to both RX and TX packets + */ +struct xnb_pkt{ + /** + * Array index of the first data-bearing (eg, not extra info) entry + * for this packet + */ + RING_IDX car; + + /** + * Array index of the second data-bearing entry for this packet. + * Invalid if the packet has only one data-bearing entry. If the + * packet has more than two data-bearing entries, then the second + * through the last will be sequential modulo the ring size + */ + RING_IDX cdr; -#define WPRINTF(fmt, args...) \ - printf("netback (%s:%d): " fmt, __FUNCTION__, __LINE__, ##args) + /** + * Optional extra info. Only valid if flags contains + * NETTXF_extra_info. Note that extra.type will always be + * XEN_NETIF_EXTRA_TYPE_GSO. Currently, no known netfront or netback + * driver will ever set XEN_NETIF_EXTRA_TYPE_MCAST_* + */ + netif_extra_info_t extra; + + /** Size of entire packet in bytes. */ + uint16_t size; -#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) -#define BUG_ON PANIC_IF + /** The size of the first entry's data in bytes */ + uint16_t car_size; -#define IFNAME(_np) (_np)->ifp->if_xname + /** + * Either NETTXF_ or NETRXF_ flags. Note that the flag values are + * not the same for TX and RX packets + */ + uint16_t flags; -#define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGE_SIZE) -#define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGE_SIZE) + /** + * The number of valid data-bearing entries (either netif_tx_request's + * or netif_rx_response's) in the packet. If this is 0, it means the + * entire packet is invalid. + */ + uint16_t list_len; -struct ring_ref { - vm_offset_t va; - grant_handle_t handle; - uint64_t bus_addr; + /** There was an error processing the packet */ + uint8_t error; }; -typedef struct netback_info { +/** xnb_pkt method: initialize it */ +static inline void +xnb_pkt_initialize(struct xnb_pkt *pxnb) +{ + bzero(pxnb, sizeof(*pxnb)); +} - /* Schedule lists */ - STAILQ_ENTRY(netback_info) next_tx; - STAILQ_ENTRY(netback_info) next_rx; - int on_tx_sched_list; - int on_rx_sched_list; - - struct xenbus_device *xdev; - XenbusState frontend_state; - - domid_t domid; - int handle; - char *bridge; - - int rings_connected; - struct ring_ref tx_ring_ref; - struct ring_ref rx_ring_ref; - netif_tx_back_ring_t tx; - netif_rx_back_ring_t rx; - evtchn_port_t evtchn; - int irq; - void *irq_cookie; +/** xnb_pkt method: mark the packet as valid */ +static inline void +xnb_pkt_validate(struct xnb_pkt *pxnb) +{ + pxnb->error = 0; +}; - struct ifnet *ifp; - int ref_cnt; +/** xnb_pkt method: mark the packet as invalid */ +static inline void +xnb_pkt_invalidate(struct xnb_pkt *pxnb) +{ + pxnb->error = 1; +}; - device_t ndev; - int attached; -} netif_t; - - -#define MAX_PENDING_REQS 256 -#define PKT_PROT_LEN 64 - -static struct { - netif_tx_request_t req; - netif_t *netif; -} pending_tx_info[MAX_PENDING_REQS]; -static uint16_t pending_ring[MAX_PENDING_REQS]; -typedef unsigned int PEND_RING_IDX; -#define MASK_PEND_IDX(_i) ((_i)&(MAX_PENDING_REQS-1)) -static PEND_RING_IDX pending_prod, pending_cons; -#define NR_PENDING_REQS (MAX_PENDING_REQS - pending_prod + pending_cons) - -static unsigned long mmap_vstart; -#define MMAP_VADDR(_req) (mmap_vstart + ((_req) * PAGE_SIZE)) - -/* Freed TX mbufs get batched on this ring before return to pending_ring. */ -static uint16_t dealloc_ring[MAX_PENDING_REQS]; -static PEND_RING_IDX dealloc_prod, dealloc_cons; - -static multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1]; -static mmu_update_t rx_mmu[NET_RX_RING_SIZE]; -static gnttab_transfer_t grant_rx_op[NET_RX_RING_SIZE]; - -static grant_handle_t grant_tx_handle[MAX_PENDING_REQS]; -static gnttab_unmap_grant_ref_t tx_unmap_ops[MAX_PENDING_REQS]; -static gnttab_map_grant_ref_t tx_map_ops[MAX_PENDING_REQS]; - -static struct task net_tx_task, net_rx_task; -static struct callout rx_task_callout; - -static STAILQ_HEAD(netback_tx_sched_list, netback_info) tx_sched_list = - STAILQ_HEAD_INITIALIZER(tx_sched_list); -static STAILQ_HEAD(netback_rx_sched_list, netback_info) rx_sched_list = - STAILQ_HEAD_INITIALIZER(rx_sched_list); -static struct mtx tx_sched_list_lock; -static struct mtx rx_sched_list_lock; - -static int vif_unit_maker = 0; - -/* Protos */ -static void netback_start(struct ifnet *ifp); -static int netback_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); -static int vif_add_dev(struct xenbus_device *xdev); -static void disconnect_rings(netif_t *netif); +/** xnb_pkt method: Check whether the packet is valid */ +static inline int +xnb_pkt_is_valid(const struct xnb_pkt *pxnb) +{ + return (! pxnb->error); +} + +#ifdef XNB_DEBUG +/** xnb_pkt method: print the packet's contents in human-readable format*/ +static void __unused +xnb_dump_pkt(const struct xnb_pkt *pkt) { + if (pkt == NULL) { + DPRINTF("Was passed a null pointer.\n"); + return; + } + DPRINTF("pkt address= %p\n", pkt); + DPRINTF("pkt->size=%d\n", pkt->size); + DPRINTF("pkt->car_size=%d\n", pkt->car_size); + DPRINTF("pkt->flags=0x%04x\n", pkt->flags); + DPRINTF("pkt->list_len=%d\n", pkt->list_len); + /* DPRINTF("pkt->extra"); TODO */ + DPRINTF("pkt->car=%d\n", pkt->car); + DPRINTF("pkt->cdr=%d\n", pkt->cdr); + DPRINTF("pkt->error=%d\n", pkt->error); +} +#endif /* XNB_DEBUG */ -#ifdef XEN_NETBACK_DEBUG_LOTS -/* Debug code to display the contents of an mbuf */ static void -print_mbuf(struct mbuf *m, int max) +xnb_dump_txreq(RING_IDX idx, const struct netif_tx_request *txreq) { - int i, j=0; - printf("mbuf %08x len = %d", (unsigned int)m, m->m_pkthdr.len); - for (; m; m = m->m_next) { - unsigned char *d = m->m_data; - for (i=0; i < m->m_len; i++) { - if (max && j == max) - break; - if ((j++ % 16) == 0) - printf("\n%04x:", j); - printf(" %02x", d[i]); - } + if (txreq != NULL) { + DPRINTF("netif_tx_request index =%u\n", idx); + DPRINTF("netif_tx_request.gref =%u\n", txreq->gref); + DPRINTF("netif_tx_request.offset=%hu\n", txreq->offset); + DPRINTF("netif_tx_request.flags =%hu\n", txreq->flags); + DPRINTF("netif_tx_request.id =%hu\n", txreq->id); + DPRINTF("netif_tx_request.size =%hu\n", txreq->size); } - printf("\n"); } -#endif -#define MAX_MFN_ALLOC 64 -static unsigned long mfn_list[MAX_MFN_ALLOC]; -static unsigned int alloc_index = 0; +/** + * \brief Configuration data for a shared memory request ring + * used to communicate with the front-end client of this + * this driver. + */ +struct xnb_ring_config { + /** + * Runtime structures for ring access. Unfortunately, TX and RX rings + * use different data structures, and that cannot be changed since it + * is part of the interdomain protocol. + */ + union{ + netif_rx_back_ring_t rx_ring; + netif_tx_back_ring_t tx_ring; + } back_ring; + + /** + * The device bus address returned by the hypervisor when + * mapping the ring and required to unmap it when a connection + * is torn down. + */ + uint64_t bus_addr; -static unsigned long -alloc_mfn(void) -{ - unsigned long mfn = 0; - struct xen_memory_reservation reservation = { - .extent_start = mfn_list, - .nr_extents = MAX_MFN_ALLOC, - .extent_order = 0, - .domid = DOMID_SELF - }; - if ( unlikely(alloc_index == 0) ) - alloc_index = HYPERVISOR_memory_op( - XENMEM_increase_reservation, &reservation); - if ( alloc_index != 0 ) - mfn = mfn_list[--alloc_index]; - return mfn; -} + /** The pseudo-physical address where ring memory is mapped.*/ + uint64_t gnt_addr; -static unsigned long -alloc_empty_page_range(unsigned long nr_pages) + /** KVA address where ring memory is mapped. */ + vm_offset_t va; + + /** + * Grant table handles, one per-ring page, returned by the + * hyperpervisor upon mapping of the ring and required to + * unmap it when a connection is torn down. + */ + grant_handle_t handle; + + /** The number of ring pages mapped for the current connection. */ + unsigned ring_pages; + + /** + * The grant references, one per-ring page, supplied by the + * front-end, allowing us to reference the ring pages in the + * front-end's domain and to map these pages into our own domain. + */ + grant_ref_t ring_ref; +}; + +/** + * Per-instance connection state flags. + */ +typedef enum { - void *pages; - int i = 0, j = 0; - multicall_entry_t mcl[17]; - unsigned long mfn_list[16]; - struct xen_memory_reservation reservation = { - .extent_start = mfn_list, - .nr_extents = 0, - .address_bits = 0, - .extent_order = 0, - .domid = DOMID_SELF - }; + /** Communication with the front-end has been established. */ + XNBF_RING_CONNECTED = 0x01, + + /** + * Front-end requests exist in the ring and are waiting for + * xnb_xen_req objects to free up. + */ + XNBF_RESOURCE_SHORTAGE = 0x02, - pages = malloc(nr_pages*PAGE_SIZE, M_DEVBUF, M_NOWAIT); - if (pages == NULL) - return 0; + /** Connection teardown has started. */ + XNBF_SHUTDOWN = 0x04, - memset(mcl, 0, sizeof(mcl)); + /** A thread is already performing shutdown processing. */ + XNBF_IN_SHUTDOWN = 0x08 +} xnb_flag_t; - while (i < nr_pages) { - unsigned long va = (unsigned long)pages + (i++ * PAGE_SIZE); +/** + * Types of rings. Used for array indices and to identify a ring's control + * data structure type + */ +typedef enum{ + XNB_RING_TYPE_TX = 0, /* ID of TX rings, used for array indices */ + XNB_RING_TYPE_RX = 1, /* ID of RX rings, used for array indices */ + XNB_NUM_RING_TYPES +} xnb_ring_type_t; - mcl[j].op = __HYPERVISOR_update_va_mapping; - mcl[j].args[0] = va; +/** + * Per-instance configuration data. + */ +struct xnb_softc { + /** NewBus device corresponding to this instance. */ + device_t dev; + + /* Media related fields */ + + /** Generic network media state */ + struct ifmedia sc_media; + + /** Media carrier info */ + struct ifnet *xnb_ifp; + + /** Our own private carrier state */ + unsigned carrier; + + /** Device MAC Address */ + uint8_t mac[ETHER_ADDR_LEN]; + + /* Xen related fields */ + + /** + * \brief The netif protocol abi in effect. + * + * There are situations where the back and front ends can + * have a different, native abi (e.g. intel x86_64 and + * 32bit x86 domains on the same machine). The back-end + * always accomodates the front-end's native abi. That + * value is pulled from the XenStore and recorded here. + */ + int abi; - mfn_list[j++] = vtomach(va) >> PAGE_SHIFT; + /** + * Name of the bridge to which this VIF is connected, if any + * This field is dynamically allocated by xenbus and must be free()ed + * when no longer needed + */ + char *bridge; - xen_phys_machine[(vtophys(va) >> PAGE_SHIFT)] = INVALID_P2M_ENTRY; + /** The interrupt driven even channel used to signal ring events. */ + evtchn_port_t evtchn; - if (j == 16 || i == nr_pages) { - mcl[j-1].args[MULTI_UVMFLAGS_INDEX] = UVMF_TLB_FLUSH|UVMF_LOCAL; + /** Xen device handle.*/ + long handle; - reservation.nr_extents = j; + /** IRQ mapping for the communication ring event channel. */ + int irq; + + /** + * \brief Cached value of the front-end's domain id. + * + * This value is used at once for each mapped page in + * a transaction. We cache it to avoid incuring the + * cost of an ivar access every time this is needed. + */ + domid_t otherend_id; - mcl[j].op = __HYPERVISOR_memory_op; - mcl[j].args[0] = XENMEM_decrease_reservation; - mcl[j].args[1] = (unsigned long)&reservation; - - (void)HYPERVISOR_multicall(mcl, j+1); + /** + * Undocumented frontend feature. Has something to do with + * scatter/gather IO + */ + uint8_t can_sg; + /** Undocumented frontend feature */ + uint8_t gso; + /** Undocumented frontend feature */ + uint8_t gso_prefix; + /** Can checksum TCP/UDP over IPv4 */ + uint8_t ip_csum; + + /* Implementation related fields */ + /** + * Preallocated grant table copy descriptor for RX operations. + * Access must be protected by rx_lock + */ + gnttab_copy_table rx_gnttab; - mcl[j-1].args[MULTI_UVMFLAGS_INDEX] = 0; - j = 0; - } - } + /** + * Preallocated grant table copy descriptor for TX operations. + * Access must be protected by tx_lock + */ + gnttab_copy_table tx_gnttab; - return (unsigned long)pages; -} +#ifdef XENHVM + /** + * Resource representing allocated physical address space + * associated with our per-instance kva region. + */ + struct resource *pseudo_phys_res; -#ifdef XEN_NETBACK_FIXUP_CSUM -static void -fixup_checksum(struct mbuf *m) -{ - struct ether_header *eh = mtod(m, struct ether_header *); - struct ip *ip = (struct ip *)(eh + 1); - int iphlen = ip->ip_hl << 2; - int iplen = ntohs(ip->ip_len); - - if ((m->m_pkthdr.csum_flags & CSUM_TCP)) { - struct tcphdr *th = (struct tcphdr *)((caddr_t)ip + iphlen); - th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, - htons(IPPROTO_TCP + (iplen - iphlen))); - th->th_sum = in_cksum_skip(m, iplen + sizeof(*eh), sizeof(*eh) + iphlen); - m->m_pkthdr.csum_flags &= ~CSUM_TCP; -#ifdef SCTP - } else if (sw_csum & CSUM_SCTP) { - sctp_delayed_cksum(m, iphlen); - sw_csum &= ~CSUM_SCTP; -#endif - } else { - u_short csum; - struct udphdr *uh = (struct udphdr *)((caddr_t)ip + iphlen); - uh->uh_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, - htons(IPPROTO_UDP + (iplen - iphlen))); - if ((csum = in_cksum_skip(m, iplen + sizeof(*eh), sizeof(*eh) + iphlen)) == 0) - csum = 0xffff; - uh->uh_sum = csum; - m->m_pkthdr.csum_flags &= ~CSUM_UDP; - } -} + /** Resource id for allocated physical address space. */ + int pseudo_phys_res_id; #endif -/* Add the interface to the specified bridge */ -static int -add_to_bridge(struct ifnet *ifp, char *bridge) -{ - struct ifdrv ifd; - struct ifbreq ifb; - struct ifnet *ifp_bridge = ifunit(bridge); + /** Ring mapping and interrupt configuration data. */ + struct xnb_ring_config ring_configs[XNB_NUM_RING_TYPES]; - if (!ifp_bridge) - return ENOENT; + /** + * Global pool of kva used for mapping remote domain ring + * and I/O transaction data. + */ + vm_offset_t kva; - bzero(&ifd, sizeof(ifd)); - bzero(&ifb, sizeof(ifb)); + /** Psuedo-physical address corresponding to kva. */ + uint64_t gnt_base_addr; - strcpy(ifb.ifbr_ifsname, ifp->if_xname); - strcpy(ifd.ifd_name, ifp->if_xname); - ifd.ifd_cmd = BRDGADD; - ifd.ifd_len = sizeof(ifb); - ifd.ifd_data = &ifb; + /** Various configuration and state bit flags. */ + xnb_flag_t flags; - return bridge_ioctl_kern(ifp_bridge, SIOCSDRVSPEC, &ifd); - -} + /** Mutex protecting per-instance data in the receive path. */ + struct mtx rx_lock; -static int -netif_create(int handle, struct xenbus_device *xdev, char *bridge) -{ - netif_t *netif; - struct ifnet *ifp; + /** Mutex protecting per-instance data in the softc structure. */ + struct mtx sc_lock; - netif = (netif_t *)malloc(sizeof(*netif), M_DEVBUF, M_NOWAIT | M_ZERO); - if (!netif) - return ENOMEM; + /** Mutex protecting per-instance data in the transmit path. */ + struct mtx tx_lock; - netif->ref_cnt = 1; - netif->handle = handle; - netif->domid = xdev->otherend_id; - netif->xdev = xdev; - netif->bridge = bridge; - xdev->data = netif; - - /* Set up ifnet structure */ - ifp = netif->ifp = if_alloc(IFT_ETHER); - if (!ifp) { - if (bridge) - free(bridge, M_DEVBUF); - free(netif, M_DEVBUF); - return ENOMEM; - } + /** The size of the global kva pool. */ + int kva_size; +}; - ifp->if_softc = netif; - if_initname(ifp, "vif", - atomic_fetchadd_int(&vif_unit_maker, 1) /* ifno */ ); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; - ifp->if_output = ether_output; - ifp->if_start = netback_start; - ifp->if_ioctl = netback_ioctl; - ifp->if_snd.ifq_maxlen = NET_TX_RING_SIZE - 1; - - DPRINTF("Created %s for domid=%d handle=%d\n", IFNAME(netif), netif->domid, netif->handle); +/*---------------------------- Debugging functions ---------------------------*/ +#ifdef XNB_DEBUG +static void __unused +xnb_dump_gnttab_copy(const struct gnttab_copy *entry) +{ + if (entry == NULL) { + printf("NULL grant table pointer\n"); + return; + } - return 0; + if (entry->flags & GNTCOPY_dest_gref) + printf("gnttab dest ref=\t%u\n", entry->dest.u.ref); + else *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** ----- End forwarded message ----- -- Kenneth Merry ken@kdm.org From owner-freebsd-xen@FreeBSD.ORG Thu Jan 26 22:43:21 2012 Return-Path: Delivered-To: freebsd-xen@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 933FC106566C; Thu, 26 Jan 2012 22:43:21 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 69E9D8FC13; Thu, 26 Jan 2012 22:43:21 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0QMhLLW076268; Thu, 26 Jan 2012 22:43:21 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0QMhLvk076264; Thu, 26 Jan 2012 22:43:21 GMT (envelope-from linimon) Date: Thu, 26 Jan 2012 22:43:21 GMT Message-Id: <201201262243.q0QMhLvk076264@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-xen@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/164531: [xen] [panic] Boot time crash using XEN HVM enabled kernel. 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: Thu, 26 Jan 2012 22:43:21 -0000 Old Synopsis: Boot time crash using XEN HVM enabled kernel. New Synopsis: [xen] [panic] Boot time crash using XEN HVM enabled kernel. Responsible-Changed-From-To: freebsd-bugs->freebsd-xen Responsible-Changed-By: linimon Responsible-Changed-When: Thu Jan 26 22:42:49 UTC 2012 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=164531 From owner-freebsd-xen@FreeBSD.ORG Fri Jan 27 10:50:12 2012 Return-Path: Delivered-To: freebsd-xen@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1270106567B for ; Fri, 27 Jan 2012 10:50:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9C3758FC08 for ; Fri, 27 Jan 2012 10:50:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0RAoC2h077278 for ; Fri, 27 Jan 2012 10:50:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0RAoCnH077277; Fri, 27 Jan 2012 10:50:12 GMT (envelope-from gnats) Date: Fri, 27 Jan 2012 10:50:12 GMT Message-Id: <201201271050.q0RAoCnH077277@freefall.freebsd.org> To: freebsd-xen@FreeBSD.org From: Sergey Kandaurov Cc: Subject: Re: kern/164531: [xen] [panic] Boot time crash using XEN HVM enabled kernel. X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sergey Kandaurov 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: Fri, 27 Jan 2012 10:50:13 -0000 The following reply was made to PR kern/164531; it has been noted by GNATS. From: Sergey Kandaurov To: bug-followup@FreeBSD.org, joe@tao.org.uk Cc: Subject: Re: kern/164531: [xen] [panic] Boot time crash using XEN HVM enabled kernel. Date: Fri, 27 Jan 2012 13:19:25 +0300 You may try to apply the patch from svn r225708 and see if it helps, or just jump to 9.0: http://svn.freebsd.org/changeset/base/225708