From owner-freebsd-xen@freebsd.org Mon Jul 27 01:03:00 2015 Return-Path: Delivered-To: freebsd-xen@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2FCD9AAA94 for ; Mon, 27 Jul 2015 01:03:00 +0000 (UTC) (envelope-from bounces+73574-0602-freebsd-xen=freebsd.org@sendgrid.net) Received: from o1.l99.sendgrid.net (o1.l99.sendgrid.net [198.37.153.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 874B39BA for ; Mon, 27 Jul 2015 01:03:00 +0000 (UTC) (envelope-from bounces+73574-0602-freebsd-xen=freebsd.org@sendgrid.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=oFlzynLs9Izgk2zCrcjDoAC7gA4=; b=T+6ege9Qp5+/MZwqoB EbAbOcheEkoQeThJESme96EubFu28l/iSfgJjQ6gOuupsUuaAEDTWAkXiadytNCX r8NooGXDdVOfNIo7k/psYsNT0CWDMhflzGeX9iTd9OJ6l2hySThINxOMcQn/wNHw 5aeDWi0PIyZnXH37RFWW4NqQY= Received: by filter0442p1mdw1.sendgrid.net with SMTP id filter0442p1mdw1.28957.55B5833D1 2015-07-27 01:02:53.118587706 +0000 UTC Received: from mail.tarsnap.com (ec2-54-86-246-204.compute-1.amazonaws.com [54.86.246.204]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id GAu2kr36TrWfbFUeDaKZtA for ; Mon, 27 Jul 2015 01:02:53 +0000 (UTC) Received: (qmail 37222 invoked from network); 27 Jul 2015 00:58:51 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 27 Jul 2015 00:58:51 -0000 Received: (qmail 3370 invoked from network); 27 Jul 2015 01:01:21 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 27 Jul 2015 01:01:21 -0000 Message-ID: <55B582E1.5070803@freebsd.org> Date: Sun, 26 Jul 2015 18:01:21 -0700 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Kristof Provost CC: Mark Felder , freebsd-xen@freebsd.org, gnn@freebsd.org Subject: Re: Networking under Xen References: <4E7B7075-4E0D-4EA7-9F5D-6D252CFBD487@gmail.com> <1436890526.3162974.323521249.6B73E6E2@webmail.messagingengine.com> <55A55AE8.4090101@freebsd.org> <1436901780.3211878.323698017.360F8D73@webmail.messagingengine.com> <20F2398D-ECDF-4CF4-966D-18C894779C4C@FreeBSD.org> <55A611B1.6000000@freebsd.org> <20150726131642.GC2484@vega.codepro.be> In-Reply-To: <20150726131642.GC2484@vega.codepro.be> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SG-EID: RUbAm5H8PjswBj/QH+sYVehaJogg3iBnZcyVi1bw/IxTBz5nIqHF+596TznUcf7ShWYzh4sT+zszhk 0aPbjknEqQbs5EQbm5GTp+CV3g5UrdiVT/FOgJ+K4lKk2eqbGQA2skZuzB95PVPY9x567t9o12zuSf eK3ISeI6K0RrvHI= X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.20 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, 27 Jul 2015 01:03:01 -0000 On 07/26/15 06:16, Kristof Provost wrote: > On 2015-07-15 00:54:25 (-0700), Colin Percival wrote: >> In my tests, deleting these lines from pf_ioctl.c >> 3570 /* We need a proper CSUM befor we start (s. OpenBSD ip_output) */ >> [...] >> unbreaks pf+TSO on EC2 instances. I'm not entirely sure why these lines >> are there in the first place, which is why I didn't want to simply go in >> and remove them -- but it may be that wrapping those lines in something >> like "if ((csum_flags & CSUM_TSO) == 0)" would solve the problem without >> breaking anything else. > > I think the reason for this checksum calculation is that pf sometimes > modifies the packet, so it also updates the checksum. Aha, this is exactly the sort of thing I was worried about. I'm glad you understand this stuff better than me. > It doesn't work on Xen TSO interfaces because (I assume) it expects to > get the pseudo header checksum, not the full checksum. > It's not entirely clear to my why it's not broken on my hardware (which > claims TSO support), but perhaps Xen is more picky than actual hardware. I'm not 100% certain about this, but I don't think Xen is doing anything with the checksum; rather, everything is being passed through to the underlying hardware, and some NICs are pickier than others. I'll refrain from commenting on your plans for fixing this since, as I mentioned above, you understand how pf and the network stack work far better than I do. :-) -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid